Brent Arias
Brent Arias

Reputation: 30215

From Memory Address to Source Line of Code

I'm using WinDBG and have the following stack trace:

ntdll!NtTerminateProcess+0xa
KERNELBASE!TerminateProcess+0x2f
MSVCR90!_invoke_watson+0x11c [f:\dd\vctools\crt_bld\self_64_amd64\crt\src\invarg.c @ 234]
MSVCR90!_invalid_parameter+0x70 [f:\dd\vctools\crt_bld\self_64_amd64\crt\src\invarg.c @ 115]
MSVCR90!fgetpos+0x33 [f:\dd\vctools\crt_bld\self_64_amd64\crt\src\fgetpos.c @ 45]
CleanPayload!DoSomething+0x22 [c:\users\brent.arias\documents\visual studio 2008\projects\samplecpplibrary\cleanpayload\cleanpayload.cpp @ 68]
CleanPayload!main+0x1c [c:\users\brent.arias\documents\visual studio 2008\projects\samplecpplibrary\cleanpayload\cleanpayload.cpp @ 115]
CleanPayload!__tmainCRTStartup+0x11a [f:\dd\vctools\crt_bld\self_64_amd64\crt\src\crtexe.c @ 586]
kernel32!BaseThreadInitThunk+0xd
ntdll!RtlUserThreadStart+0x1d

Clearly the debugger knows what line of code each stack frame points to, as it shows that number after the '@'. I'm glad that I can hit crtl-l on the source pane and type in the line number, but why can't it do this for me? Is there a way to click on the debug window and say "jump to this point in source" without me having to type it in myself?

Upvotes: 2

Views: 2888

Answers (1)

seva titov
seva titov

Reputation: 11920

It can do this, just not from any window. It works from Call Stack window (Alt+6) -- double click on the frame that has mapped to the line of code and it will get you to the line in source file. It opens the file if it is not currently opened in WinDbg.

Upvotes: 1

Related Questions