debugcppMajor
How to display a stack trace when an exception is thrown
Viewed 0 times
thrownhowtracedisplayexceptionwhenstack
Problem
I want to have a way to report the stack trace to the user if an exception is thrown. What is the best way to do this?
I'd like it to be portable if possible. I want information to pop up, so the user can copy the stack trace and email it to me if an error comes up.
I'd like it to be portable if possible. I want information to pop up, so the user can copy the stack trace and email it to me if an error comes up.
Solution
It depends which platform.
On GCC it's pretty trivial, see this post for more details.
On MSVC then you can use the StackWalker library that handles all of the underlying API calls needed for Windows.
You'll have to figure out the best way to integrate this functionality into your app, but the amount of code you need to write should be minimal.
On GCC it's pretty trivial, see this post for more details.
On MSVC then you can use the StackWalker library that handles all of the underlying API calls needed for Windows.
You'll have to figure out the best way to integrate this functionality into your app, but the amount of code you need to write should be minimal.
Context
Stack Overflow Q#691719, score: 83
Revisions (0)
No revisions yet.