[Bug c++/15831] New: bad debug info
igodard at pacbell dot net
gcc-bugzilla@gcc.gnu.org
Sat Jun 5 04:11:00 GMT 2004
If you debug this program and step into the function equal_range the debugger finds no symbol/line info. gdb output:
~/ootbc/common/test/src$ gdb testPowerset
gdb: Symbol `emacs_ctlx_keymap' has different size in shared object, consider re-linking
GNU gdb 2002-04-01-cvs
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-linux"...
(gdb) b 95
Breakpoint 1 at 0x8049856: file testPowerset.cc, line 95.
(gdb) r
Starting program: /home/ivan/ootbc/common/test/src/testPowerset
Breakpoint 1, main () at testPowerset.cc:95
95 pr = pie.equal_range(15);
(gdb) s
0x0804e2fe in Powerset<short, StdAllocator>::equal_range(short const&) const (
this=0xbffffb30, k=@0xbffffa9e)
(gdb) n
Single stepping until exit from function _ZNK8PowersetIs12StdAllocatorE11equal_rangeERKs,
which has no line number information.
main () at testPowerset.cc:96
96 Assert(pr.first == pie.lower_bound(15));
(gdb) c
Continuing.
However, if you put a break on a function called by equal_range ("Hide::Die()" in this case) and then exit that back into equal_range then you *can step within it. gdb output:
~/ootbc/common/test/src$ gdb testPowerset
gdb: Symbol `emacs_ctlx_keymap' has different size in shared object, consider re-linking
GNU gdb 2002-04-01-cvs
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-linux"...
(gdb) b Hide::Die()
Breakpoint 1 at 0x8053893: file exception.cc, line 15.
(gdb) r
Starting program: /home/ivan/ootbc/common/test/src/testPowerset
Breakpoint 1 at 0x8053893: file exception.cc, line 16.
Breakpoint 1, Hide::Die() () at exception.cc:16
16 return defeatOptimization;
(gdb) fin
Run till exit from #0 Hide::Die() () at exception.cc:16
Powerset<short, StdAllocator>::equal_range(short const&) const (
this=0xbffffb30, k=@0xbfffface) at powerset.hh:731
731 E* p = Search(k);
Value returned is $1 = 0 '\0'
(gdb) l
726 inline
727 std::pair<typename Powerset<E, Alloc>::iterator,
728 typename Powerset<E, Alloc>::iterator>
729 Powerset<E, Alloc>::equal_range(const key_type& k) const {
730 Hide::Die();
731 E* p = Search(k);
732 if (RefMember(p)) {
733 iterator i = find(p, k);
734 iterator j = i;
735 return std::pair<iterator, iterator>(i, ++j);
(gdb) n
732 if (RefMember(p)) {
(gdb)
733 iterator i = find(p, k);
(gdb)
734 iterator j = i;
(gdb)
735 return std::pair<iterator, iterator>(i, ++j);
(gdb)
So you can't step into the function, but if you get into it you can step within it. This might be gdb, but I supect the compiler is more likely. Attached are the (innocuous) compiler output, the source, the executable, and a static library needed to rebuild the executable.
Ivan
--
Summary: bad debug info
Product: gcc
Version: 3.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: igodard at pacbell dot net
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15831
More information about the Gcc-bugs
mailing list