public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/15831] New: bad debug info
@ 2004-06-05  4:11 igodard at pacbell dot net
  2004-06-05  4:13 ` [Bug c++/15831] " igodard at pacbell dot net
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: igodard at pacbell dot net @ 2004-06-05  4:11 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/15831] bad debug info
  2004-06-05  4:11 [Bug c++/15831] New: bad debug info igodard at pacbell dot net
@ 2004-06-05  4:13 ` igodard at pacbell dot net
  2004-06-05  4:15 ` igodard at pacbell dot net
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: igodard at pacbell dot net @ 2004-06-05  4:13 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From igodard at pacbell dot net  2004-06-05 04:13 -------
Created an attachment (id=6467)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=6467&action=view)
Compiler output (-v -save-temps)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15831


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/15831] bad debug info
  2004-06-05  4:11 [Bug c++/15831] New: bad debug info igodard at pacbell dot net
  2004-06-05  4:13 ` [Bug c++/15831] " igodard at pacbell dot net
@ 2004-06-05  4:15 ` igodard at pacbell dot net
  2004-06-05  4:16 ` igodard at pacbell dot net
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: igodard at pacbell dot net @ 2004-06-05  4:15 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From igodard at pacbell dot net  2004-06-05 04:15 -------
Created an attachment (id=6468)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=6468&action=view)
Source code (-save-temps)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15831


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/15831] bad debug info
  2004-06-05  4:11 [Bug c++/15831] New: bad debug info igodard at pacbell dot net
  2004-06-05  4:13 ` [Bug c++/15831] " igodard at pacbell dot net
  2004-06-05  4:15 ` igodard at pacbell dot net
@ 2004-06-05  4:16 ` igodard at pacbell dot net
  2004-06-05  4:18 ` igodard at pacbell dot net
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: igodard at pacbell dot net @ 2004-06-05  4:16 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From igodard at pacbell dot net  2004-06-05 04:16 -------
Created an attachment (id=6469)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=6469&action=view)
executable


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15831


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/15831] bad debug info
  2004-06-05  4:11 [Bug c++/15831] New: bad debug info igodard at pacbell dot net
                   ` (2 preceding siblings ...)
  2004-06-05  4:16 ` igodard at pacbell dot net
@ 2004-06-05  4:18 ` igodard at pacbell dot net
  2004-08-15  3:23 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: igodard at pacbell dot net @ 2004-06-05  4:18 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From igodard at pacbell dot net  2004-06-05 04:18 -------
Created an attachment (id=6470)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=6470&action=view)
necessary static library


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15831


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/15831] bad debug info
  2004-06-05  4:11 [Bug c++/15831] New: bad debug info igodard at pacbell dot net
                   ` (3 preceding siblings ...)
  2004-06-05  4:18 ` igodard at pacbell dot net
@ 2004-08-15  3:23 ` pinskia at gcc dot gnu dot org
  2004-08-15  7:42 ` igodard at pacbell dot net
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-08-15  3:23 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-08-15 03:23 -------
Can you try a newer gdb, like 6.2.1?
I almost think this is gdb problem rather than a gcc problem.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15831


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/15831] bad debug info
  2004-06-05  4:11 [Bug c++/15831] New: bad debug info igodard at pacbell dot net
                   ` (4 preceding siblings ...)
  2004-08-15  3:23 ` pinskia at gcc dot gnu dot org
@ 2004-08-15  7:42 ` igodard at pacbell dot net
  2004-08-16 19:27 ` wilson at specifixinc dot com
  2004-09-22 13:24 ` pinskia at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: igodard at pacbell dot net @ 2004-08-15  7:42 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From igodard at pacbell dot net  2004-08-15 07:42 -------
I don't have a more recent gdb available, and while I am prodding our sysadmin, that is not likely to get much soon. I uploaded the binary - what happens if you try a more recent gdb?

Ivan

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15831


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/15831] bad debug info
  2004-06-05  4:11 [Bug c++/15831] New: bad debug info igodard at pacbell dot net
                   ` (5 preceding siblings ...)
  2004-08-15  7:42 ` igodard at pacbell dot net
@ 2004-08-16 19:27 ` wilson at specifixinc dot com
  2004-09-22 13:24 ` pinskia at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: wilson at specifixinc dot com @ 2004-08-16 19:27 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From wilson at specifixinc dot com  2004-08-16 19:27 -------
Subject: Re:  bad debug info

igodard at pacbell dot net wrote:
> ------- Additional Comments From igodard at pacbell dot net  2004-08-15 07:42 -------
> I don't have a more recent gdb available, and while I am prodding our sysadmin, that is not likely to get much soon. I uploaded the binary - what happens if you try a more recent gdb?

I took a quick look.  readelf -w can be used to look at the debug info.
  The functions debug info looks OK.  The function has been inlined, and
there is out out-of-line instance of it.

readelf does report an error
readelf: Error: Not enough comp units for .debug_lines section
but this seems to be harmless.  I would guess that this is a
gcc/binutils problem with unused sections being optimized away in the
linker.  So we just are optimizing away all of the unused debug info.

I tried gdb 6.1, and it seemed to work fine.  I could step through the
function after setting a breakpoint there.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15831


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/15831] bad debug info
  2004-06-05  4:11 [Bug c++/15831] New: bad debug info igodard at pacbell dot net
                   ` (6 preceding siblings ...)
  2004-08-16 19:27 ` wilson at specifixinc dot com
@ 2004-09-22 13:24 ` pinskia at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-09-22 13:24 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-09-22 13:24 -------
Assuming gdb bug.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15831


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2004-09-22 13:24 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-05  4:11 [Bug c++/15831] New: bad debug info igodard at pacbell dot net
2004-06-05  4:13 ` [Bug c++/15831] " igodard at pacbell dot net
2004-06-05  4:15 ` igodard at pacbell dot net
2004-06-05  4:16 ` igodard at pacbell dot net
2004-06-05  4:18 ` igodard at pacbell dot net
2004-08-15  3:23 ` pinskia at gcc dot gnu dot org
2004-08-15  7:42 ` igodard at pacbell dot net
2004-08-16 19:27 ` wilson at specifixinc dot com
2004-09-22 13:24 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).