8 ms·
If you're on *NIX have you tried just invoking gstack or similar as an external process? https://linux.die.net/man/1/gstack https://linux.die.net/man/1/gstack
by mark_undoio 2y ago
If you're on *NIX have you tried just invoking gstack or similar as an external process? https://linux.die.net/man/1/gstack https://linux.die.net/man/1/gstack
Or, indeed, getting a core dump and applying GDB to it. GDB seems generally pretty good at reconstructing stacks at arbitrary points in application runtime.
We've also used a combination of libunwind and https://linux.die.net/man/1/addr2line https://linux.die.net/man/1/addr2line to produce good crash dumps when GDB is not necessarily available.
- jeffbee 2y agoTo which of the projects that are all named "libunwind" do you refer?
- mark_undoio 2y agoThis one, I believe: https://github.com/libunwind/libunwind https://github.com/libunwind/libunwind ETA: Thinking about it, I'm not really sure what it'd do for C++ - I guess you'd end up with mangled names, so if you want sensible names you might need to demangle (either as a post-processing step or within the dumper) too. I don't think you'll get any decoded argument values out of it either, so I guess it depends what backtrace info is needed.