Is there any methods to implement a 'printstacktrace' method in C++ like the Java do?
Asked
Active
Viewed 3,666 times
2
-
the code would be platform dependent and also you need to check the abi used by your program, say, if there is frame pointer saved on stack, etc. – tristan Oct 11 '13 at 04:44
-
possible duplicate of [C++ display stack trace on exception](http://stackoverflow.com/questions/691719/c-display-stack-trace-on-exception) – Adam Oct 11 '13 at 04:47
1 Answers
2
Use backtrace() or StackWalker for Unix or Windows.
See this previous SO question:

Community
- 1
- 1

Duncan Smith
- 530
- 2
- 10