Re: Demangling in backtraces

Eli Zaretskii via Gdb <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <[email protected]>
> From: Simon Marchi <[email protected]>
> Date: Sat, 13 Mar 2021 21:46:32 -0500
> 
> >> I have built a C program linked against libgccjit.  When it crashes,
> >> the backtrace shows mangled names, like this:
> >>
> >>  #0  0x70f5ac3e in libgccjit-0!_Z17gimple_build_callP9tree_nodejz ()
> >>     from D:\usr\bin\libgccjit-0.dll
> >>  #1  0x7190fa7b in libgccjit-0!_ZN19evrp_range_analyzer5leaveEP15basic_block_def
> >>  () from D:\usr\bin\libgccjit-0.dll
> >>  #2  0x71910eef in libgccjit-0!_Z36stmt_uses_0_or_null_in_undefined_wayP6gimple
> >>      () from D:\usr\bin\libgccjit-0.dll
> >>  #3  0x710fba2c in libgccjit-0!_Z16execute_one_passP8opt_pass ()
> >>     from D:\usr\bin\libgccjit-0.dll
> >>
> >> (This is because libgccjit is written in C++, and because the DLL is
> >> stripped.)
> >>
> >> How can I cause GDB to demangle the function names when showing the
> >> backtrace in this case?  I tried setting language to c++, but that
> >> didn't help.
> >>
> >> TIA
> >>
> 
> I don't really know.  I've tried making a toy program and shared library
> on Linux in C++, without debug symbols, and it "just works":
> 
>     #0  0x00007ffff7fc00ed in foo(int) () from ./libfoo.so
>     #1  0x0000555555555147 in main ()
> 
> So maybe it's supposed to "just work" on Windows as well and it doesn't?
> I don't really have time to dig into it further.

Thanks.  So does this mean we don't have any kind of "manual
demangler" in GDB that could be turned on in cases like this, when
"just works" doesn't?  Hannes, any ideas?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.