This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug breakpoints/13346] Multiple breakpoints/losing symbol tableissue
- From: "j.vimal at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Wed, 26 Oct 2011 15:50:27 +0000
- Subject: [Bug breakpoints/13346] Multiple breakpoints/losing symbol tableissue
- Auto-submitted: auto-generated
- References: <bug-13346-4717@http.sourceware.org/bugzilla/>
http://sourceware.org/bugzilla/show_bug.cgi?id=13346
--- Comment #6 from Vimal <j.vimal at gmail dot com> 2011-10-26 15:50:27 UTC ---
(In reply to comment #5)
Thanks for the offset explanation. It cleared things up.
> > guest# cat /sys/module/openvswitch_mod/sections/.text
> > 0xffffffffa00ca000
>
> Not sure why they call it `.text' but there is only a probability of 1:4095
> that this is really a .text address. Most probably you need to add the .text
> section address above (from readelf -WS ./openvswitch_mod.ko | grep '\.text').
I see this info for .text:
Name Type Address Off
.text PROGBITS 0000000000000000 000064
Size ES Flg Lk Inf Al
017518 00 AX 0 0 4
So, I did:
cat /proc/modules/.../.text
0xffffffffa00f9000
(gdb) add-symbol-file ~/vm/openvswitch_mod.ko 0xffffffffa00f9064
add symbol table from file "/home/jvimal/vm/openvswitch_mod.ko" at
.text_addr = 0xffffffffa00f9064
^^ added offset 64
(y or n) y
Reading symbols from /home/jvimal/vm/openvswitch_mod.ko...done.
(gdb) break dp_process_received_packet
Breakpoint 1 at 0xffffffffa00fc42c: file
/home/nikhilh/openvswitch/datapath/linux/datapath.c, line 262. (2 locations)
(gdb) info br
Num Type Disp Enb Address What
1 breakpoint keep y <MULTIPLE>
1.1 y 0xffffffffa00fc42c
/home/nikhilh/openvswitch/datapath/linux/datapath.c:262
1.2 y 0xffffffffa00fc44b
/home/nikhilh/openvswitch/datapath/linux/datapath.c:262
There are still two breakpoints. Which seems weird.
If I hit the breakpoint, the line numbers and locals information is still
missing.
So I tried another approach:
guest# cat /proc/kallsyms | grep dp_process
ffffffffa00d63c8 t dp_process_received_packet [openvswitch_mod]
(gdb) break *0xffffffffa00d63c8
Breakpoint 1 at 0xffffffffa00d63c8
(gdb) c
Continuing.
Breakpoint 1, 0xffffffffa00d63c8 in dp_detach_port ()
(Which is a completely different function altogether! Does this suggest that
the 0x64 offset could be wrong?)
If I do not add the offset 0x64, I see this:
(gdb) add-symbol-file ~/vm/openvswitch_mod.ko 0xffffffffa00bf000
add symbol table from file "/home/jvimal/vm/openvswitch_mod.ko" at
.text_addr = 0xffffffffa00bf000
(y or n) y
Reading symbols from /home/jvimal/vm/openvswitch_mod.ko...done.
(gdb) break *0xffffffffa00c23c8
Breakpoint 1 at 0xffffffffa00c23c8
(gdb) info br
Num Type Disp Enb Address What
1 breakpoint keep y 0xffffffffa00c23c8 <dp_process_received_packet>
^^^^^^^^ This seems correct
(gdb) c
Continuing.
Breakpoint 1, 0xffffffffa00c23c8 in dp_process_received_packet ()
(gdb) info args
No symbol table info available.
Here is the line number info from the kernel module.
# readelf -wil openvswitch_mod.ko
<1><3f4e4>: Abbrev Number: 89 (DW_TAG_subprogram)
<3f4e5> DW_AT_external : 1
<3f4e6> DW_AT_name : (indirect string, offset: 0x1aeb8):
dp_process_received_packet
<3f4ea> DW_AT_decl_file : 29
<3f4eb> DW_AT_decl_line : 261
<3f4ed> DW_AT_prototyped : 1
<3f4ee> DW_AT_low_pc : 0x33c8
<3f4f6> DW_AT_high_pc : 0x3690
<3f4fe> DW_AT_frame_base : 0x322c (location list)
<3f502> DW_AT_sibling : <0x3f67c>
(followed by args/locals information)
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.