switching to user stack in kernel dumps

北城以北 提交于 2021-02-06 09:33:06

问题


Is there a way to switch to user mode of a particular process in a kernel dump while doing postmortem debugging ?

I remember doing this while live debugging using the .process command.


回答1:


.process also works in kernel dumps. First, you can find your process using

!process 0 0 myprocess.exe

and then switch to that process using

.process <address>

where <address> is the hex number after PROCESS.

Note that you are still kernel debugging and you have only the physical memory of that process available (a.k.a. Working Set). The majority of virtual address space is probably swapped to disk and you cannot analyze that process as you would in user mode (especially for .NET programs, where you need the complete .NET heap).




回答2:


As a follow up to Thomas's response, you can use .process /p /r . This will set your usermode context and reload usermode symbols. This will make your subsequent thread commands in this new process context be able to show the usermode side of the stack. You can skip process navigation if you know your target thread by using .thread /p /r .




回答3:


  1. Find ProcessID

    !process 0 0 process.exe enter image description here

  2. Using ProcessID to find ThreadID

    !process <ProcessID> enter image description here

  3. Switch to the thread

    .thread /p /r <ThreadID>




回答4:


I have an article that talks about the issues around this and the best ways to do it in both live and crash dump debugging scenarios:

http://www.osronline.com/article.cfm?id=576




回答5:


!dml_proc extension provides a convenient way to switch to user mode processes with a menu drawn in DML markup: example.



来源:https://stackoverflow.com/questions/22249728/switching-to-user-stack-in-kernel-dumps

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