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 #3 from Jan Kratochvil <jan.kratochvil at redhat dot com> 2011-10-26 14:49:08 UTC ---
(In reply to comment #2)
> > 
> > I bet the .text section does not start at a page boundary (0x...000).
> > See:
> > readelf -WS ./libblah.so | grep '\.text'
> > 
> > You need to add the "Address" field to the base address you see in
> > /proc/pid/maps as the ".text_addr" (when the library starts at 0 - it is
> > unprelinked.  If you run prelink you moreover need to subtract the prelink
> > address).
> 
> I did not know that; I am sorry...   
> How do you check if the library is prelinked?

In `readelf -S' output there is `.gnu.prelink_undo'.  Besides that you can see
there an address shift:

  [Nr] Name              Type             Address           Offset
       Size              EntSize          Flags  Link  Info  Align
  [ 0]                   NULL             0000000000000000  00000000
       0000000000000000  0000000000000000           0     0     0
  [ 1] .note.gnu.build-i NOTE             0000003f15600270  00000270
       0000000000000024  0000000000000000   A       0     0     4

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


> I did try without specifying the extra segments, but the same problem
> persists.

And have you corrected the .text address?  Which one you used?


> But, how is that possible?  Since the kernel module is loaded dynamically;
> vmlinux itself does not have any symbols for the function I am setting
> breakpoint?

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.

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