public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "igodard at pacbell dot net" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/15831] New: bad debug info
Date: Sat, 05 Jun 2004 04:11:00 -0000	[thread overview]
Message-ID: <20040605041109.15831.igodard@pacbell.net> (raw)

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


             reply	other threads:[~2004-06-05  4:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-05  4:11 igodard at pacbell dot net [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040605041109.15831.igodard@pacbell.net \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).