xmllmx
xmllmx

Reputation: 42379

How to trace the call stack under x64 Windows?

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

Answers (1)

Charlie
Charlie

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

Related Questions