public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/12273] New: demangled symbol names unrecognised in non-debug builds
@ 2010-11-29 17:29 taviso at cmpxchg8b dot com
  2010-12-09 16:10 ` [Bug c++/12273] " keiths at redhat dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: taviso at cmpxchg8b dot com @ 2010-11-29 17:29 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=12273

           Summary: demangled symbol names unrecognised in non-debug
                    builds
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned@sourceware.org
        ReportedBy: taviso@cmpxchg8b.com


DSOs that export mangled symbols are unrecognised in their mangled form this
used to work in 7.1, but for some reason doesn't seem to work any more. I'm not
sure what changed that caused it to break.

You can reproduce the problem like this, create an object with an exported
mangled symbol:

$ cat dynsym.cc
#include <stdio.h>

class GDB {
 public:
   static int whatever (void) {
     return fprintf(stderr, "Hello World\n");
 }
};

int main(int argc, char **argv)
{
   return GDB::whatever();
}
$ g++ -export-dynamic dynsym.cc -s -o dynsym

Verify the symbol is present:

$ nm -D dynsym | c++filt | grep GDB
00000000004008ca W GDB::whatever()

Try to break on the demangled symbol name:

$ gdb -q ./dynsym
(gdb) b GDB::whatever()
Can't find member of namespace, class, struct, or union named "GDB::whatever"
Hint: try 'GDB::whatever()<TAB> or 'GDB::whatever()<ESC-?>
(Note leading single quote.)

Note that if I use the mangled symbol name directly, GDB accepts it.

(gdb) b _ZN3GDB8whateverEv
Breakpoint 1 at 0x4008ce
(gdb) r
Breakpoint 1, 0x00000000004008ce in GDB::whatever() ()

I don't think this is a problem with not recognising the symbols, as
it's listed as a completion target if I try to complete on symbol
names, and info address works:

(gdb) info address GDB::whatever()
Symbol "GDB::whatever()" is at 0x4008ca in a file compiled without debugging.

This used to work, in a vanilla GDB 7.1:

$ gdb dynsym
GNU gdb (GDB) 7.1
(gdb) b GDB::whatever()
Breakpoint 1 at 0x8048639

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

end of thread, other threads:[~2011-03-22 21:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-29 17:29 [Bug c++/12273] New: demangled symbol names unrecognised in non-debug builds taviso at cmpxchg8b dot com
2010-12-09 16:10 ` [Bug c++/12273] " keiths at redhat dot com
2011-01-15 20:10 ` jan.kratochvil at redhat dot com
2011-02-10 20:53 ` keiths at redhat dot com
2011-02-17 21:09 ` keiths at redhat dot com
2011-03-16 21:09 ` cvs-commit at gcc dot gnu.org
2011-03-16 21:12 ` cvs-commit at gcc dot gnu.org
2011-03-22 21:51 ` keiths at redhat dot com

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).