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 symtab/17201] problems with gdb-generated plt symbols


https://sourceware.org/bugzilla/show_bug.cgi?id=17201

--- Comment #4 from dje at google dot com ---
Re: "I have another bug to add here that may be related":

Turns out this is c++ related.

In c++ foo(int)@plt == foo(int),
whereas in C, which is what "testcase, part 1,2" use, I don't see the problem
because foo@plt != foo.

Here's what I see with C:

bash$ gdb plt-shared-user.x64
(gdb) b foo
Breakpoint 1 at 0x400580
(gdb) i b
Num     Type           Disp Enb Address            What
1       breakpoint     keep y   0x0000000000400580 <foo@plt>
(gdb) r
Starting program: /home/dje/src/play/plt-shared-user.x64

Breakpoint 1, foo () at plt-shared-lib.c:4
4       int foo () { return bar (); }
(gdb) i b
Num     Type           Disp Enb Address            What
1       breakpoint     keep y   0x00007ffff7ff26f7 in foo at plt-shared-lib.c:4
        breakpoint already hit 1 time
(gdb) 

Note that gdb properly transferred the breakpoint from foo@plt in the
executable to foo in the shared library.
[We can certainly have a discussion on whether gdb should even set a breakpoint
on foo@plt.  I'm leaving that for a separate step.]

Here's what I see with C++:

bash$ gdb plt-shared-user-cc.x64
(gdb) b foo
Breakpoint 1 at 0x400590
(gdb) i b
Num     Type           Disp Enb Address            What
1       breakpoint     keep y   0x0000000000400590 <foo()@plt>
(gdb) r
Starting program: /home/dje/src/play/plt-shared-user-cc.x64

Breakpoint 1, 0x0000000000400590 in foo()@plt ()
(gdb) i b
Num     Type           Disp Enb Address            What
1       breakpoint     keep y   <MULTIPLE>
        breakpoint already hit 1 time
1.1                         y     0x0000000000400590 <foo()@plt>
1.2                         y     0x00007ffff7ff2590 <foo()@plt>
1.3                         y     0x00007ffff7ff2707 in foo()
                                                   at plt-shared-lib-cc.cc:4
(gdb) 

Geez.

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