I'm using backtrace to print application's stack trace and I'm getting something like
libQtCore.so.4(_ZN11QMetaObject8activateEP7QObjectPKS_iPPv+0x843) [0x7f889d20cf33]
libQtGui.so.4(_ZN7QAction9triggeredEb+0x32) [0x7f889d76c2f2]
libQtGui.so.4(_ZN7QAction8activateENS_11ActionEventE+0xb0) [0x7f889d76d670]
libQtGui.so.4(+0x6242f4) [0x7f889db862f4]
Is there any way to convert "linker-names" to "source-names" and get code line numbers from offsets?
I want to have backtrace, looking like this:
libQtCore.so.4 (QMetaObject::activate(QObject):1022)
libQtGui.so.4 (QAction::triggered()::47)
UPD.
I understand, this technique may work or not work or work bad because of compiler specifics. I want to "demangle" linker symbols at least in gcc and visual c++.
Under gcc you can use c++filt to decipher the mangling.
Under Visual studio you can undname
Once you have the function name you at least on Windows you can use DIA SDK to get the source file line numbers etc
This is called name mangling. Read the article on Wikipedia please, since citing it here would be too much for an answer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With