是否有可能从转储中获得引发异常的行? [英] is it possible to get the line from which the exception was thrown from a dump?
问题描述
我有一个转储文件,并用WinDbg加载了它.
I have a dump file and loaded it with WinDbg.
我已经使用!pe(打印异常)来查看异常(空引用异常).但是,它为我指出了一种包含约100行的方法.
I've used !pe (print exceptions) to see the exception (a null reference exception). However, it points me to a method that contains ~100 lines.
是否可以找出抛出异常的行?
Is it possible to find out the line where the exception is thrown away?
0:000> !pe
Exception object: 00000000822e7e28
Exception type: System.NullReferenceException
Message: Object reference not set to an instance of an object.
InnerException: <none>
StackTrace (generated):
SP IP Function
00000000001FBDC0 000007FF06468F6B Utils.Page.OnActivate()+0x6db
+ 0x6db是什么意思?
What does +0x6db mean?
非常感谢,丹
我有源文件,但无法重现此问题.这就是为什么我想找出确切的行
I have the source files but i cannot reproduce this issue. That's why i want to find out the exact line
EDIT2 :(在Brian建议使用!u命令之后)
(after Brian s suggestion to use the !u command)
这是使用!u命令后的快照
Here's a snapshot after using the !u command
0:000> !u 000007ff03af9a38
Normal JIT generated code
Page.OnActivate()
Begin 000007ff06468890, size 84b
000007ff`06468890 53 push rbx
000007ff`06468891 55 push rbp
000007ff`06468892 56 push rsi
000007ff`06468893 57 push rdi
000007ff`06468894 4883ec78 sub rsp,78h
000007ff`06468898 488d6c2430 lea rbp,[rsp+30h]
000007ff`0646889d 488bf2 mov rsi,rdx
以此类推...
将6db添加到06468890(第一个指针)是否正确?
Is it correct to add 6db to 06468890 (the first pointer)?
推荐答案
+ 0x6db
是引发异常的方法 OnActivate
中的偏移量.您看不到行号的原因是因为您没有正确的PDB文件.如果您有PDB文件,请设置路径以包括这些文件.
+0x6db
is the offset into the method OnActivate
where the exception was thrown. The reason you don't see a line number is because you don't have the correct PDB files. If you have the PDB files set your path to include these.
如果不这样做,您仍然可以很好地指示异常发生的位置.!u
命令将列出该代码的.NET注释版本,您应该可以从中获取源代码中的位置.请参阅此答案以了解更多有关使用!u
命令的详细信息.
If you don't you can still get a pretty good indication of where the exception happened. The !u
command will list a .NET annotated version of the code and from that you should be able to get the location in the source code. Please see this answer for more detail on using the !u
command.
这篇关于是否有可能从转储中获得引发异常的行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!