[Barrelfish-users] Debugging symbols
Patrik Eklöf
peklof at kth.se
Mon Jun 4 16:53:23 CEST 2012
I seriously don't know. I know I WANT to debug netd.
I know I've tried setting a breakpoint in netd: break -x (netd_sym.pos idc_barrelfish.c:304)
I haven't yet tried gdb.
Though you may be right on the whole "so it would just stop at the specified location whenever the
instruction pointer ends up there."
Though I've tried breakpoints in both virtual and physical memory and they end up at the same place.
The stack trace is as follows:
simics> stack-trace
#0 0x46d270 in interdisp_ump_send_handler () in interdisp_flounder_bindings.c
#1 0x4031ab in redirect_pause (cc=0x0, type=netd_PORT_TCP, local_ip_addr=0,
local_port=12, remote_ip_addr=4292608, remote_port=7,
buffer_id_rx=2307039277867075616, buffer_id_tx=1306048839739770386)
at G:/Server/Legal/KTH/Bachelor/Barrelfish.dwarf/build/../source/usr/netd/idc_barrelfish.c:1196
#2 0x4016f9 in register_filter_response (st=0x6492d0, id=6591120, err=0,
filter_id=18, buffer_id_rx=18, buffer_id_tx=7, ftype=0)
at G:/Server/Legal/KTH/Bachelor/Barrelfish.dwarf/build/./x86_64/include/errors/errno.h:621
#3 0x40082f in ?? ()
#4 0x40be3f in netd_get_port_call__ump_send () in netd_flounder_bindings.c
#5 0x40cca0 in netd_export (st=0x0, export_cb=0x649290, connect_cb=0x12,
ws=0x12, flags=0)
at G:/Server/Legal/KTH/Bachelor/Barrelfish.dwarf/build/./x86_64/usr/netd/_for_app_netd/netd_flounder_bindings.c:27
#6 0x40d524 in netd_ump_connect_handler (st=0x649290, mb=0x8, mon_id=18,
frame=, inchanlen=18, outchanlen=1, notify_cap=)
at G:/Server/Legal/KTH/Bachelor/Barrelfish.dwarf/build/./x86_64/include/errors/errno.h:621
#7 0x0 in ?? ()
interdisp_flounder_bindings is apparently some library. I can see the function name, even in the stack trace, but I can't get the simulator to show the source, nor step properly.
Using objdump shows the function in the netd executable at:
000000000046d1c0 <interdisp_send_cap_reply__ump_send>:
And in this function, the address occurs between two instructions:
46d26f: 00 00 00
46d272: c7 83 f0 01 00 00 00 movl $0x0,0x1f0(%rbx)
I don't know which is better - using the simulator debugger or gdb. But I haven't gotten gdb to work yet so I have been unable to test it.
Regards,
Patrik Eklöf
Student at ICT, Master of Science in Engineering Education, IT Programme, KTH, Kista
________________________________________
From: Simon Peter [speter at inf.ethz.ch]
Sent: Monday, June 04, 2012 16:39
To: Patrik Eklöf
Cc: Kornilios Kourtis; barrelfish-users at lists.inf.ethz.ch
Subject: Re: [Barrelfish-users] Debugging symbols
How do you know you're debugging /sbin/netd?
A common problem we faced with simulator debugging is that the debugger
does not know it is debugging user code multiplexed by an operating
system, so it would just stop at the specified location whenever the
instruction pointer ends up there.
A good way to check is to look at your stack. Does it show a valid call
chain for the binary you expect to debug?
Simon
On 04.06.2012 13:45, Patrik Eklöf wrote:
> Well, I haven't been able to fully get symbolic debugging to work, so I can't say specifics I am missing which I need, but I have noticed some symbols missing, so I am going to use them as an example.
>
> At address 0x00000000004028d1, /source/usr/netd/idc_barrelfish.c seems to be loaded (so /sbin/netd then).
> The very first assembly instruction I see is call 0x46d270, which jumps into some unknown location.
>
> [cpu0] cs:0x000000000046d270 p:0x0005be6270 push rbp
> interdisp_ump_send_handler () in interdisp_flounder_bindings.c
> simics> whereis -d 0x000000000046d270
> Address 0x46d270 is not in any known location.
>
> At this point, it seems to mess up. It LOOKS like some information is missing, but I can't be sure, so I figured I'd ask.
> I can't see any source for this location and I seem to be unable to get any information about what source file and line it's associated with.
> At this point, symbolic debugging just breaks down. It stops working correctly.
>
> I haven't yet tried gdb, however (have not been able to get it to read symbols from the binaries; it complains it can't read them).
> This is sort of a little game where I have to find out if the culprit is the simulator or the OS.
> So this may be a little premature, and if so, I apologize.
>
> Regards,
> Patrik Eklöf
> Student at ICT, Master of Science in Engineering Education, IT Programme, KTH, Kista
>
> ________________________________________
> From: Kornilios Kourtis [kornilios.kourtis at inf.ethz.ch]
> Sent: Monday, June 04, 2012 13:03
> To: Patrik Eklöf
> Cc: barrelfish-users at lists.inf.ethz.ch
> Subject: Re: [Barrelfish-users] Debugging symbols
>
> Hi Patrik,
>
> On Mon, Jun 04, 2012 at 08:29:08AM +0000, Patrik Eklöf wrote:
>> Hi all,
>>
>> I am trying to get debugging symbols for entire Barrelfish in order to
>> debug in more easily. I managed to load symbols from all the
>> executables in /sbin, but it doesn't seem to be all of them. Some are
>> missing, such as the libraries (reent is one of them, I think). So my
>> questions are as follows: Do I have to do something more in order to
>> produce debugging symbols for all the source code than just compiling
>> Barrelfish with the default settings? What other files, if any, should
>> I load symbols from, other than /sbin in order to get all the debugging
>> symbols for the entire BF?
>
> Since in barrelfish libraries are not dynamically loaded, all debugging
> symbols should be in the binaries themselves. What are the symbols you
> seem to be missing?
>
> cheers,
> Kornilios.
>
>
> --
> Kornilios Kourtis
>
> _______________________________________________
> Barrelfish-users mailing list
> Barrelfish-users at lists.inf.ethz.ch
> https://lists.inf.ethz.ch/mailman/listinfo/barrelfish-users
More information about the Barrelfish-users
mailing list