Does gdb support weak/normal symbols?

H. J. Lu hjl@lucon.org
Mon Jan 16 00:48:00 GMT 2006


I got

[hjl@gnu-10 weak]$ make
cc -o foo -O -g main.c foo.c weak.c
for f in foo; do ./$f; done
Normal foo
[hjl@gnu-10 weak]$ gdb foo
GNU gdb 6.4.50.20060115-cvs
...
(gdb) b foo
Breakpoint 1 at 0x804839a: file weak.c, line 8.
(gdb) r
Starting program: /export/home/hjl/bugs/gdb/weak/foo
Normal foo

Program exited normally.
(gdb) b *0x08048380
Breakpoint 2 at 0x8048380: file foo.c, line 5.
(gdb) r
Starting program: /export/home/hjl/bugs/gdb/weak/foo
Breakpoint 1 at 0x8048386: file foo.c, line 6.

Breakpoint 2, foo () at foo.c:5
5       {
(gdb)

foo in weak.c isn't in the symbol table. But gdb sets the breakpoint
of foo on it. Shouldn't gdb be clever enough to know to check the
other one?

H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bug.tar.gz
Type: application/x-gzip
Size: 466 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb/attachments/20060116/8f744d9e/attachment.bin>


More information about the Gdb mailing list