Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demangle RTTI type names in debug messages #52633

Merged
merged 2 commits into from
Nov 5, 2021

Conversation

BrettDong
Copy link
Member

@BrettDong BrettDong commented Nov 4, 2021

Summary

Infrastructure "Demangle RTTI type names in debug messages"

Purpose of change

In GCC and Clang, typeid( X ).name() returns mangled names, so debug messages showing RTTI type names may look a little bit confusing:

Describe the solution

Move demangle() function to a separate source/header file to avoid circular dependency between string formatter and debug.h, and call demangle() where RTTI type names are included in debug messages.

Describe alternatives you've considered

Testing

Additional context

@BrettDong BrettDong added [C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style Code: Debug Debugging and troubleshooting the game, also includes the debug menu labels Nov 4, 2021
@kevingranade kevingranade merged commit 8110261 into CleverRaven:master Nov 5, 2021
@BrettDong BrettDong deleted the demangle branch November 5, 2021 10:35
scarf005 added a commit to scarf005/Cataclysm-BN that referenced this pull request Aug 30, 2023
demangle RTTI type names in debug messages

from: CleverRaven/Cataclysm-DDA#52633

Co-authored-by: Brett Dong <brett.browning.dong@gmail.com>
scarf005 added a commit to scarf005/Cataclysm-BN that referenced this pull request Aug 31, 2023
demangle RTTI type names in debug messages

from: CleverRaven/Cataclysm-DDA#52633

Co-authored-by: Brett Dong <brett.browning.dong@gmail.com>
scarf005 added a commit to scarf005/Cataclysm-BN that referenced this pull request Sep 1, 2023
demangle RTTI type names in debug messages

from: CleverRaven/Cataclysm-DDA#52633

Co-authored-by: Brett Dong <brett.browning.dong@gmail.com>
Firestorm01X2 pushed a commit to cataclysmbnteam/Cataclysm-BN that referenced this pull request Sep 3, 2023
* chore: unindent common messages

was very confusing with `CMAKE_BUILD_TYPE`

* fix(port): BSD macro in src/debug.cpp

from: CleverRaven/Cataclysm-DDA#47440

Co-authored-by: Brett Dong <brett.browning.dong@gmail.com>

* fix(port): Implement C++ symbol demangling on macOS

from: CleverRaven/Cataclysm-DDA#47486

Co-authored-by: Brett Dong <brett.browning.dong@gmail.com>

* refactor(port):  Extract symbol demangling to a separate function

from: CleverRaven/Cataclysm-DDA#47517

Co-authored-by: Brett Dong <brett.browning.dong@gmail.com>

* feat(port):  Demangle symbol names on MinGW

from: CleverRaven/Cataclysm-DDA#47517

Co-authored-by: Brett Dong <brett.browning.dong@gmail.com>

* feat(port):  Implement C++ symbol demangling on Linux

from: CleverRaven/Cataclysm-DDA#47621

Co-authored-by: Brett Dong <brett.browning.dong@gmail.com>

* feat(port):  Implement C++ symbol demangling on FreeBSD and OpenBSD

from: CleverRaven/Cataclysm-DDA#48152

Co-authored-by: Brett Dong <brett.browning.dong@gmail.com>

* fix(port):  C++ symbol demangling on cross-compile MinGW

from: CleverRaven/Cataclysm-DDA#48220

Co-authored-by: Brett Dong <brett.browning.dong@gmail.com>

* fix(port): memory leak in demangle()

from: CleverRaven/Cataclysm-DDA#48230

Co-authored-by: Brett Dong <brett.browning.dong@gmail.com>

* feat(port):
Backtrace on Android

from: CleverRaven/Cataclysm-DDA#48371

Co-authored-by: Brett Dong <brett.browning.dong@gmail.com>

* chore(port): hide write_demangled_frame() for Android build

from: CleverRaven/Cataclysm-DDA#48414

Co-authored-by: Brett Dong <brett.browning.dong@gmail.com>

* feat(port):
demangle RTTI type names in debug messages

from: CleverRaven/Cataclysm-DDA#52633

Co-authored-by: Brett Dong <brett.browning.dong@gmail.com>

* perf(port): optimize null stream in DebugLog

from: CleverRaven/Cataclysm-DDA#55156

Co-authored-by: Brett Dong <brett.browning.dong@gmail.com>

* fix(port): reported version of newer Windows 10 releases

from: CleverRaven/Cataclysm-DDA#55506

Co-authored-by: xuv <18742123+xuvatilavv@users.noreply.github.com>

* feat(port): include build number in windows version report

CleverRaven/Cataclysm-DDA#55646

Co-authored-by: xuv <18742123+xuvatilavv@users.noreply.github.com>

* feat(port): get the actual static image base of modules

from: CleverRaven/Cataclysm-DDA#55782

Co-authored-by: Qrox <qrox@sina.com>

* ci: fix version typo

* feat(port): support libbacktrace on linux

from: CleverRaven/Cataclysm-DDA#59020

Co-authored-by: John Bytheway <jbytheway@gmail.com>

* build(cmake): support custom linker

context:
https://stackoverflow.com//questions/1867745/cmake-use-a-custom-linker#answer-66730019

* docs(cmake): linker, backtrace and libbacktrace

---------

Co-authored-by: Brett Dong <brett.browning.dong@gmail.com>
Co-authored-by: xuv <18742123+xuvatilavv@users.noreply.github.com>
Co-authored-by: Qrox <qrox@sina.com>
Co-authored-by: John Bytheway <jbytheway@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Code: Debug Debugging and troubleshooting the game, also includes the debug menu Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants