Hacker News new | ask | show | jobs
by PaulDavisThe1st 1083 days ago
If you don't care about exotica like async or signal safety, and just need to see the callstack from arbitray points, this can do the job without C++23:

https://github.com/Ardour/ardour/blob/master/libs/pbd/stackt...

(2 different implementations, one for POSIX-y systems with the execinfo.h header, and one for Windows)

The demange() function is elsewhere.

1 comments

Ime the execinfo.h backtraces are unfortunately not that useful in practice, due to being unable to resolve symbol names of static functions. But FWIW, you can use it for async signals with the _fd variant.