从内存地址到源代码行
我正在使用 WinDBG 并具有以下堆栈跟踪:
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
显然,调试器知道每个堆栈帧指向哪一行代码,因为它显示“@”后面的数字。我很高兴可以在源窗格中按 crtl-l 并输入行号,但为什么它不能为我执行此操作?有没有办法单击调试窗口并说“跳转到源代码中的这一点”,而无需我自己输入它?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它可以做到这一点,只是不是从任何窗口。它在“调用堆栈”窗口 (Alt+6) 中工作 - 双击已映射到代码行的框架,它将让您到达源文件中的行。如果当前未在 WinDbg 中打开该文件,它将打开该文件。
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.