druntime icon indicating copy to clipboard operation
druntime copied to clipboard

Add cppdemangle in druntime

Open Nobody143745 opened this issue 5 years ago • 6 comments

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)

Nobody143745 avatar Mar 24 '20 18:03 Nobody143745

Thanks for your pull request and interest in making D better, @ErnyTech! We are looking forward to reviewing it, and you should be hearing from a maintainer soon. Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + druntime#3002"

dlang-bot avatar Mar 25 '20 15:03 dlang-bot

It is now ready for review.

Nobody143745 avatar Apr 01 '20 12:04 Nobody143745

Thanks for the extensive review!

Nobody143745 avatar Apr 01 '20 17:04 Nobody143745

@Geod24, this is ready for second round ;-)

Nobody143745 avatar Apr 12 '20 20:04 Nobody143745

Now that my exams are over I can continue with this! Thanks for the review @MoonlightSentinel

Nobody143745 avatar Jun 24 '20 16:06 Nobody143745

Ping @ErnyTech

MoonlightSentinel avatar Dec 06 '21 19:12 MoonlightSentinel