floooh / oryol

A small, portable and extensible C++ 3D coding framework
MIT License
2k stars 200 forks source link

Demangle C++ function names in stack trace #314

Closed pixelherodev closed 5 years ago

pixelherodev commented 6 years ago

This improves stack traces.

An example stack trace:

  msg=none
  file=/home/noam/Development/Zany80/Lua/src/main.cpp
  line=110
  func=virtual Oryol::AppState::Code Zany80::OnRunning()
  callstack:
/home/noam/Development/Zany80/Lua/build/fips-deploy/Lua/linux-make-debug/zany80: Oryol::StackTrace::Dump(char*, int) [0x5590f035451b]
/home/noam/Development/Zany80/Lua/build/fips-deploy/Lua/linux-make-debug/zany80: Oryol::Log::AssertMsg(char const*, char const*, char const*, int, char const*) [0x5590f034fe98]
/home/noam/Development/Zany80/Lua/build/fips-deploy/Lua/linux-make-debug/zany80: Zany80::OnRunning() [0x5590f0271cb6]
/home/noam/Development/Zany80/Lua/build/fips-deploy/Lua/linux-make-debug/zany80: Oryol::App::onFrame() [0x5590f034d0c1]
/home/noam/Development/Zany80/Lua/build/fips-deploy/Lua/linux-make-debug/zany80: Oryol::App::StartMainLoop() [0x5590f034ce39]
/home/noam/Development/Zany80/Lua/build/fips-deploy/Lua/linux-make-debug/zany80(main+0x6a) [0x5590f02711ea]
/lib64/libc.so.6(__libc_start_main+0xea) [0x7f35e2e0caca]
/home/noam/Development/Zany80/Lua/build/fips-deploy/Lua/linux-make-debug/zany80(_start+0x2a) [0x5590f0264a1a]

Before, that would have been this:

  msg=none
  file=/home/noam/Development/Zany80/Lua/src/main.cpp
  line=110
  func=virtual Oryol::AppState::Code Zany80::OnRunning()
  callstack:
/home/noam/Development/Zany80/Lua/build/fips-deploy/Lua/linux-make-debug/zany80(_ZN5Oryol10StackTrace4DumpEPci+0x45) [0x55b5acdc64cb]
/home/noam/Development/Zany80/Lua/build/fips-deploy/Lua/linux-make-debug/zany80(_ZN5Oryol3Log9AssertMsgEPKcS2_S2_iS2_+0x76) [0x55b5acdc1e48]
/home/noam/Development/Zany80/Lua/build/fips-deploy/Lua/linux-make-debug/zany80(_ZN6Zany809OnRunningEv+0x180) [0x55b5acce3c66]
/home/noam/Development/Zany80/Lua/build/fips-deploy/Lua/linux-make-debug/zany80(_ZN5Oryol3App7onFrameEv+0x17f) [0x55b5acdbf071]
/home/noam/Development/Zany80/Lua/build/fips-deploy/Lua/linux-make-debug/zany80(_ZN5Oryol3App13StartMainLoopEv+0x7d) [0x55b5acdbede9]
/home/noam/Development/Zany80/Lua/build/fips-deploy/Lua/linux-make-debug/zany80(main+0x6a) [0x55b5acce319a]
/lib64/libc.so.6(__libc_start_main+0xea) [0x7ff7790b7aca]
/home/noam/Development/Zany80/Lua/build/fips-deploy/Lua/linux-make-debug/zany80(_start+0x2a) [0x55b5accd69ca]
pixelherodev commented 6 years ago

oops, let me fix that...

floooh commented 6 years ago

...any thoughts about my StringBuilder review-comment above?

pixelherodev commented 6 years ago

I don't see any review/comments?

floooh commented 6 years ago

Oh noes, I forgot to hit a button "submit review". Blame it on the shitty github UI ;)

pixelherodev commented 6 years ago

Ah, that explains it. Bad shitty GH UI! Bad!

Anyways, yeah, I'll fix that soon.

pixelherodev commented 5 years ago

Crap, completely forgot about this. Adding this to my todo list...