1
votes

When my c++ app crashes I would like to generate stackdump and display dumped register values.

My app runs on Linux.

I would like my program to be able to generate stackdump and display dumped register values when it crashes and the next time the user run's it, it will ask them if it is ok to send these to me so I can track down the problem. I can handle the stacktrace info but I don't know how to generate these two things. Any ideas?

Advance thanks to all repliers

Thank you vlc

1
Google's stacktrace.cc made a big splash when it was introduced a few years ago; I'm not sure if it is still popular, but the header does mention libunwind, which is available on my Ubuntu system in package libunwind7 and -dev.sarnold

1 Answers

1
votes

The answer in this question could be of some use in your case. But the code in the answer prints a stacktrace and registers up on SIGSEGV only. You might have to do some more work to meet your needs.