windows 给定崩溃偏移量、.PDB 和源代码,我如何找到源代码行?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/274034/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Given a crash offset, .PDB, and source, how can I find the source line?
提问by Aidan Ryan
I have a Windows Event Log entry giving the offset of the failed call triggering an application crash. I have a release build, the corresponding .PDB file, and the source.
我有一个 Windows 事件日志条目,给出了触发应用程序崩溃的失败调用的偏移量。我有一个发布版本、相应的 .PDB 文件和源代码。
I do not have a .MAP or .COD file.
我没有 .MAP 或 .COD 文件。
How can I find the failing source line?
如何找到失败的源代码行?
回答by Ana Betts
WinDbg has an lncommand that will give you the nearest symbol of an address.
WinDbg 有一个ln命令,可以为您提供最近的地址符号。
Open your binary using:
使用以下命令打开二进制文件:
WinDbg -z somebin.dll
And in the command window, type:
然后在命令窗口中输入:
ln <address>
Once you find the function it's in, run
找到它所在的函数后,运行
uf somebin!SomeFunc
to find the closest line to the address.
找到距离地址最近的行。

