Reputation: 42379
Under x64 Windows, the return address is not stored in rbp
; then, how to trace the call stack?
Another related question:
Since the first four arguments are passed via rcx
, rdx
, r8
, and r9
, how should I retrieve them through the stack trace? (Especially compiled with optimization.)
Upvotes: 3
Views: 2733
Reputation: 45
You could use the Windows function CaptureStackBackTrace
. See How to Log Stack Frames with Windows x64 for additional information and code reference.
Upvotes: 3