is it possible to get the line from which the exception was thrown from a dump?

孤人 提交于 2019-12-11 02:11:42

问题


I have a dump file and loaded it with WinDbg.

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

What does +0x6db mean?

Thanks a lot, Dan

EDIT:

I have the source files but i cannot reproduce this issue. That's why i want to find out the exact line

EDIT2: (after Brian s suggestion to use the !u command)

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

and so on...

Is it correct to add 6db to 06468890 (the first pointer)?


回答1:


+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.

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.



来源:https://stackoverflow.com/questions/12823066/is-it-possible-to-get-the-line-from-which-the-exception-was-thrown-from-a-dump

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!