Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

[WIP] [DONT MERGE] Enable demangling of C++ symbols in the stacktrace #3003

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Apr 12, 2020

  1. Add cppdemangle in druntime

    Having a C++ symbol demangler is very useful, with this it will
    be possible to implement the C++ symbol demangle in the stacktrace.
    
    The demangling is done in Posix platform by function __cxa_demangle
    presents in Itanium C++ ABI (https://itanium-cxx-abi.github.io/cxx-abi/abi.html#demangler).
    
    Itanium C++ ABI is used practically in all modern C++ compilers on Posix,
    however old compilers (like GCC < 3.0) used a different name mangling,
    this is not a problem because DMD in fact only supports Itanium C++ ABI on Posix.
    
    For Windows instead the implementation it is provided by the UnDecorateSymbolName
    function present in the Debug Help Library.
    (https://docs.microsoft.com/en-us/windows/win32/api/dbghelp/nf-dbghelp-undecoratesymbolname)
    
    Signed-off-by: Ernesto Castellotti <mail@ernestocastellotti.it>
    Ernesto Castellotti committed Apr 12, 2020
    Configuration menu
    Copy the full SHA
    f7e3b10 View commit details
    Browse the repository at this point in the history
  2. Enable demangling of C++ symbols in the stacktrace

    This allows you to view demangled and pretty printed C++ symbols
    in the stacktrace.
    Is especially useful considering that D is getting more and more support for C++.
    
    Now the C++ symbols in the stacktrace will be printed like this:
    	test.d:7 [C++] Test<int>::SomeName(int, long, int) [0x55711efee36f]
            test.d:18 [C++] testcpp() [0x557228e17978]
    
    Signed-off-by: Ernesto Castellotti <mail@ernestocastellotti.it>
    Ernesto Castellotti committed Apr 12, 2020
    Configuration menu
    Copy the full SHA
    d4c40a5 View commit details
    Browse the repository at this point in the history