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

* [Bug c++/12273] demangled symbol names unrecognised in non-debug builds
  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 ` keiths at redhat dot com
  2011-01-15 20:10 ` jan.kratochvil at redhat dot com
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: keiths at redhat dot com @ 2010-12-09 16:10 UTC (permalink / raw)
  To: gdb-prs

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

Keith Seitz <keiths at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |keiths at redhat dot com
         AssignedTo|unassigned at sourceware    |keiths at redhat dot com
                   |dot org                     |

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

* [Bug c++/12273] demangled symbol names unrecognised in non-debug builds
  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
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jan.kratochvil at redhat dot com @ 2011-01-15 20:10 UTC (permalink / raw)
  To: gdb-prs

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

Jan Kratochvil <jan.kratochvil at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jan.kratochvil at redhat
                   |                            |dot com

--- Comment #1 from Jan Kratochvil <jan.kratochvil at redhat dot com> 2011-01-15 20:10:30 UTC ---
From: Keith Seitz
http://sourceware.org/ml/gdb-patches/2010-12/msg00264.html

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

* [Bug c++/12273] demangled symbol names unrecognised in non-debug builds
  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
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: keiths at redhat dot com @ 2011-02-10 20:53 UTC (permalink / raw)
  To: gdb-prs

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

Keith Seitz <keiths at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sss@li-snyder.org

--- Comment #2 from Keith Seitz <keiths at redhat dot com> 2011-02-10 20:53:25 UTC ---
*** Bug 12462 has been marked as a duplicate of this bug. ***

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

* [Bug c++/12273] demangled symbol names unrecognised in non-debug builds
  2010-11-29 17:29 [Bug c++/12273] New: demangled symbol names unrecognised in non-debug builds taviso at cmpxchg8b dot com
                   ` (2 preceding siblings ...)
  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
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: keiths at redhat dot com @ 2011-02-17 21:09 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #3 from Keith Seitz <keiths at redhat dot com> 2011-02-17 21:09:23 UTC ---
Another revision:

http://sourceware.org/ml/gdb-patches/2011-02/msg00428.html

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

* [Bug c++/12273] demangled symbol names unrecognised in non-debug builds
  2010-11-29 17:29 [Bug c++/12273] New: demangled symbol names unrecognised in non-debug builds taviso at cmpxchg8b dot com
                   ` (3 preceding siblings ...)
  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
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2011-03-16 21:09 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #4 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> 2011-03-16 21:09:00 UTC ---
CVSROOT:    /cvs/src
Module name:    src
Changes by:    kseitz@sourceware.org    2011-03-16 21:08:57

Modified files:
    gdb/testsuite  : ChangeLog 
Added files:
    gdb/testsuite/gdb.cp: cmpd-minsyms.cc cmpd-minsyms.exp 
                          ovsrch1.cc ovsrch2.cc ovsrch3.cc 
                          ovsrch4.cc ovsrch.exp ovsrch.h 

Log message:
    PR c++/12273
    * gdb.cp/cmpd-minsyms.exp: New test.
    * gdb.cp/cmpd-minsyms.cc: New file.

    PR c++/11734
    * gdb.cp/ovsrch.exp: New test.
    * gdb.cp/ovsrch.h: New file.
    * gdb.cp/ovsrch1.cc: New file.
    * gdb.cp/ovsrch2.cc: New file.
    * gdb.cp/ovsrch3.cc: New file.
    * gdb.cp/ovsrch4.cc: New file.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&r1=1.2636&r2=1.2637
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.cp/cmpd-minsyms.cc.diff?cvsroot=src&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.cp/cmpd-minsyms.exp.diff?cvsroot=src&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.cp/ovsrch1.cc.diff?cvsroot=src&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.cp/ovsrch2.cc.diff?cvsroot=src&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.cp/ovsrch3.cc.diff?cvsroot=src&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.cp/ovsrch4.cc.diff?cvsroot=src&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.cp/ovsrch.exp.diff?cvsroot=src&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.cp/ovsrch.h.diff?cvsroot=src&r1=NONE&r2=1.1

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

* [Bug c++/12273] demangled symbol names unrecognised in non-debug builds
  2010-11-29 17:29 [Bug c++/12273] New: demangled symbol names unrecognised in non-debug builds taviso at cmpxchg8b dot com
                   ` (4 preceding siblings ...)
  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
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2011-03-16 21:12 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #5 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> 2011-03-16 21:12:16 UTC ---
CVSROOT:    /cvs/src
Module name:    src
Changes by:    kseitz@sourceware.org    2011-03-16 21:12:13

Modified files:
    gdb            : ChangeLog linespec.c psymtab.c 
    gdb/cli        : cli-utils.h cli-utils.c 

Log message:
    * linespec.c (find_methods): Canonicalize NAME before looking
    up the symbol.
    (name_end): New function.
    (keep_name_info): New function.
    (decode_line_1): Use keep_name_info.
    (decode_compound): Likewise.
    * cli/cli-utils.h (remove_trailing_whitespace): New function.
    * cli/cli-utils.c (remove_trailing_whitespace): Likewise.

    PR c++/12273
    * linespec.c (locate_first_half): Keep overload information, too.
    (decode_compound): Use a string to represent break characters
    to escape the loop.
    If P points to a break character, do not increment it.
    For C++ and Java, keep overload information and relevant keywords.
    If we cannot find a symbol, search the minimal symbols.

    PR c++/11734
    * linespec.c (decode_compound): Rename SAVED_ARG to
    THE_REAL_SAVED_ARG.
    Make a copy of THE_REAL_SAVED_ARG in SAVED_ARG and strip
    single-quotes.
    Pass a valid block to lookup_symbol.
    (lookup_prefix_sym): Likewise.
    (find_method): Construct search name based on SYM_CLASS instead
    of SAVED_ARG.
    * psymtab.c (lookup_partial_symbol): Add language parameter.
    (lookup_symbol_aux_psymtabs): Likewise.
    Don't assume that the psymtab we found was the right one. Search
    for the desired symbol in the symtab to be certain.
    (psymtab_search_name): New function.
    (lookup_partial_symbol): Use psymtab_search_name.
    Add language parameter.
    (read_symtabs_for_function): Add language parameter and pass to
    lookup_partial_symbol.
    (find_symbol_file_from_partial): Likewise.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.12823&r2=1.12824
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/linespec.c.diff?cvsroot=src&r1=1.113&r2=1.114
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/psymtab.c.diff?cvsroot=src&r1=1.24&r2=1.25
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/cli/cli-utils.h.diff?cvsroot=src&r1=1.12&r2=1.13
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/cli/cli-utils.c.diff?cvsroot=src&r1=1.12&r2=1.13

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

* [Bug c++/12273] demangled symbol names unrecognised in non-debug builds
  2010-11-29 17:29 [Bug c++/12273] New: demangled symbol names unrecognised in non-debug builds taviso at cmpxchg8b dot com
                   ` (5 preceding siblings ...)
  2011-03-16 21:12 ` cvs-commit at gcc dot gnu.org
@ 2011-03-22 21:51 ` keiths at redhat dot com
  6 siblings, 0 replies; 8+ messages in thread
From: keiths at redhat dot com @ 2011-03-22 21:51 UTC (permalink / raw)
  To: gdb-prs

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

Keith Seitz <keiths at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #6 from Keith Seitz <keiths at redhat dot com> 2011-03-22 20:10:03 UTC ---
I think this has now been fixed.  If there are still problems, please re-open
this bug.

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