This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug breakpoints/13346] Multiple breakpoints/losing symbol tableissue


http://sourceware.org/bugzilla/show_bug.cgi?id=13346

--- Comment #4 from Vimal <j.vimal at gmail dot com> 2011-10-26 15:05:47 UTC ---
(In reply to comment #3)
> The Address column is shifter by 0x3f15600000 upwards.  After `prelink -u'
> there is just:
> 
>   [ 1] .note.gnu.build-i NOTE             0000000000000270  00000270
>        0000000000000024  0000000000000000   A       0     0     4
> 
> (Be careful with prelink on your vital system libraries.)


Thanks for the clarification.   On libblah.so, I see this:

  [ 1] .note.gnu.build-i NOTE             00000000000001c8  000001c8
       0000000000000024  0000000000000000   A       0     0     4

Should I be looking at section information for .text?

libblah.so:
  [12] .text             PROGBITS         0000000000000540  00000540
       0000000000000138  0000000000000000  AX       0     0     16

> 
> 
> > I did try without specifying the extra segments, but the same problem
> > persists.
> 
> And have you corrected the .text address?  Which one you used?
> 

I used the address output by /sys/module/$mod/sections/.text.   Here's some
additional info:

guest# insmod ./openvswitch_mod.ko

guest# cat /sys/module/openvswitch_mod/sections/.text
0xffffffffa00ca000

guest# cat /proc/kallsyms | grep dp_process
ffffffffa00cd3c8 t dp_process_received_packet   [openvswitch_mod]

(gdb) add-symbol-file ~/vm/openvswitch_mod.ko 0xffffffffa00ca000
add symbol table from file "/home/jvimal/vm/openvswitch_mod.ko" at
        .text_addr = 0xffffffffa00ca000
(y or n) y
Reading symbols from /home/jvimal/vm/openvswitch_mod.ko...done.
(gdb) info addr dp_process_received_packet
Symbol "dp_process_received_packet" is a function at address
0xffffffffa00cd3c8.

So, both gdb and guest say that the function dp_process_received_packet is at
0xffffffffa00cd3c8.

But once I set a breakpoint:

(gdb) break dp_process_received_packet 
Breakpoint 1 at 0xffffffffa00cd3cc (2 locations)
                ^^^^^^^^^^^^^^^^^^ ??

(gdb) info br
Num     Type           Disp Enb Address            What
1       breakpoint     keep y   <MULTIPLE>         
1.1                         y     0xffffffffa00cd3cc
<dp_process_received_packet+4>
1.2                         y     0xffffffffa00cd3e7
<dp_process_received_packet+31>

This is what I have trouble understanding...  I understand that there could be
prologue skipping, but why are there two breakpoints?

Now, if I run and hit the breakpoint:
(gdb) c
Continuing.

Breakpoint 1, 0xffffffffa00cd3cc in dp_process_received_packet ()
(gdb) info locals
No symbol table info available.


> 
> I was talking about about vmlinux itself, not about the module.  You were
> adding manually also vmlinux.
> 
> 
> > BTW, the above commands for kernel module work correctly with gdb-7.1.
> 
> If you have symbol duplication it works very randomly which symbol gets chosen
> which time, there could be more luck with this or that version of GDB.

Got it. :)

-- 
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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]