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:
- For the Windows implementation, I can use StackWalk64 API function and family.
- Under Linux, I have found libunwind that sounds great.
- Or, I can use glibc’s backtrace
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. 🙂
Google Breakpad handles all of this for you if you want to get crash dumps back from the field.