I need a way to record the function stack trace in a debug log to help me diagnose a defect. The problem is that I need to implement this on Windows and Linux using C++.
After a little research, I have found that:
Before starting work, I want some advice if this is the right way and to ask if there is an already written multi-platform library that can help. I suspect that I'm not the first programmer who needs this. :)
Each thread has its own call stack, representing the calls made in that thread. To get a stack trace, use the methods GetStackTrace and GetContextStackTrace. A stack trace can be printed using OutputStackTrace and OutputContextStackTrace.
View the call stack while in the debugger While debugging, in the Debug menu, select Windows > Call Stack or press ctrl + alt + C .
a call stack is a stack data structure that stores information about the active subroutines of a computer program. A stack trace is a report of the active stack frames at a certain point in time during the execution of a program.
Google Breakpad handles all of this for you if you want to get crash dumps back from the field.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With