在x64 Windows下,返回地址不存储在rbp
中;那么,如何追踪调用栈呢?
另一个相关问题:
由于前四个参数是通过rcx
、rdx
、r8
和r9
传递的,应该如何我通过堆栈跟踪检索它们? (特别优化编译。)
最佳答案
您可以使用 Windows 函数 CaptureStackBackTrace
。参见 How to Log Stack Frames with Windows x64获取更多信息和代码引用。
关于c++ - 如何在 x64 Windows 下跟踪调用堆栈?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18889376/