Skip to content

Commit 16f2a73

Browse files
author
vuzelac
committed
Demangler for MSVC symbols.
Demangler is implemented using the existing LLVM Demangler. The demangler is built as a separate library (libdemangle_msvc) due to the licensing issues - normally, it would be integrated into libiberty. The library exposes msvc_demangle() call while BFD adds bfd_demangle_new() which automatically demangles using libdemangle_msvc or libiberty. GDB now uses bfd_demangle_new() instead of bfd_demangle(). Binutils that want MSVC demangling should switch to the new function as well. For all it's demangling needs, GDB almost exclusively uses gdb_demangle(), which returns plain demangled string. However, GDB also has a few places where it demangles into the demangle_component AST. These functions are not relavant to PE/COFF binaries and MSVC demangling, however, the appropriate functions are added for completeness: msvc_class_name_from_physname() and msvc_method_name_from_physname().
1 parent 95be922 commit 16f2a73

43 files changed

Lines changed: 13765 additions & 35 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Makefile.def

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ host_modules= { module= zlib; no_install=true; no_check=true;
143143
extra_configure_flags='@extra_host_zlib_configure_flags@ @host_libs_picflag@';};
144144
host_modules= { module= gnulib; };
145145
host_modules= { module= gdbsupport; };
146+
host_modules= { module= libdemangle-msvc; };
146147
host_modules= { module= gdbserver; };
147148
host_modules= { module= gdb; };
148149
host_modules= { module= expect; };
@@ -451,6 +452,7 @@ dependencies = { module=all-gdb; on=all-libiberty; };
451452
dependencies = { module=all-gdb; on=all-libiconv; };
452453
dependencies = { module=all-gdb; on=all-gnulib; };
453454
dependencies = { module=all-gdb; on=all-gdbsupport; };
455+
dependencies = { module=all-gdb; on=all-libdemangle-msvc; };
454456
dependencies = { module=all-gdb; on=all-opcodes; };
455457
dependencies = { module=all-gdb; on=all-readline; };
456458
dependencies = { module=all-gdb; on=all-build-bison; };
@@ -498,6 +500,7 @@ dependencies = { module=configure-binutils; on=configure-gettext; };
498500
dependencies = { module=all-binutils; on=all-libiberty; };
499501
dependencies = { module=all-binutils; on=all-opcodes; };
500502
dependencies = { module=all-binutils; on=all-bfd; };
503+
dependencies = { module=all-binutils; on=all-libdemangle-msvc; };
501504
dependencies = { module=all-binutils; on=all-build-flex; };
502505
dependencies = { module=all-binutils; on=all-build-bison; };
503506
dependencies = { module=all-binutils; on=all-gettext; };

0 commit comments

Comments
 (0)