This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c++/2385: Mangled C++ names are shown in gdb


>Number:         2385
>Category:       c++
>Synopsis:       Mangled C++ names are shown in gdb
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Dec 14 08:28:02 UTC 2007
>Closed-Date:
>Last-Modified:
>Originator:     Dima S
>Release:        latest snapshot (6.7.50.20071206)
>Organization:
>Environment:
Sun Sparc Solaris 8 or 10
c++ application compiled with gcc 3.4.3
>Description:
When i try to debug my C++ application with gdb i get mangled C++ names in gdb output:

$>gdb <my_cpp_application>
GNU gdb 6.7.50.20071206
Copyright (C) 2007 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "sparc-sun-solaris2.8"...
(gdb) set print demangle on
(gdb) set language c++
(gdb) b WSLCLAG.cpp:120
No source file named WSLCLAG.cpp.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (WSLCLAG.cpp:120) pending.
(gdb) run
Starting program: <my_cpp_application>
warning: Temporarily disabling breakpoints for unloaded shared library "/usr/lib/ld.so.1"
warning: Lowest section in /usr/lib/libdl.so.1 is .dynamic at 00000094
Breakpoint 1, _ZN7WSLCLAG7destroyEv (this=0x14fcd0) at WSLCLAG.cpp:120
120 int actuator_i = 0;
(gdb) backtrace
#0 _ZN7WSLCLAG7destroyEv (this=0x14fcd0) at WSLCLAG.cpp:120
#1 0x0002c5c8 in _ZN12WSLCLAGSStst21test_init_and_destroyEv (this=0x4b62c) at WSLCLAGtst.hpp:97
#2 0x0002c270 in _ZN50TestDescription_WSLCLAGSStst_test_init_and_destroy7runTestEv (this=0x4b660)
at WSLCLAGtst.cpp:32
#3 0x0001df00 in _ZN7CxxTest19RealTestDescription3runEv (this=0x4b660)
at ../../../xinc/cxxtest/RealDescriptions.cpp:96
#4 0x00026f04 in _ZN7CxxTest10TestRunner7runTestERNS_15TestDescriptionE (this=0xffbfe26f, td=@0x4b660)
at ../../../xinc/cxxtest/TestRunner.h:74
#5 0x00026d7c in _ZN7CxxTest10TestRunner8runSuiteERNS_16SuiteDescriptionE (this=0xffbfe26f, sd=@0x4b63c)
at ../../../xinc/cxxtest/TestRunner.h:61
#6 0x00026af0 in _ZN7CxxTest10TestRunner8runWorldEv (this=0xffbfe26f)
at ../../../xinc/cxxtest/TestRunner.h:46
#7 0x00026968 in _ZN7CxxTest10TestRunner11runAllTestsERNS_12TestListenerE (listener=@0xffbfe358)
at ../../../xinc/cxxtest/TestRunner.h:23
#8 0x000268c8 in _ZN7CxxTest14ErrorFormatter3runEv (this=0xffbfe358)
at ../../../xinc/cxxtest/ErrorFormatter.h:47
#9 0x0001be64 in main () at WSLCLAGtst.cpp:20

I also downloaded & built a version of c++filt (version GNU c++filt (GNU Binutils)2.18 to be more precise).

When i run the c++filt program with my mangles names as input i get correct demangled names on the output:
Examples:

./binutils/cxxfilt _ZN7WSLCLAG21select_actuator_parmsEi
WSLCLAG::select_actuator_parms(int)

./binutils/cxxfilt _ZN7CxxTest14ErrorFormatter3runEv
CxxTest::ErrorFormatter::run()

./binutils/cxxfilt _ZN7WSLCLAG7destroyEv
WSLCLAG::destroy()
>How-To-Repeat:
see the description
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]