DukeOfMarmalade
DukeOfMarmalade

Reputation: 2788

WinDBG ESP and EIP

I am trying to get to the bottom of an exception thrown in my application using WinDBG, at the start of the stack there is this:

04a4f25c 746fc477 System.Threading._ThreadPoolWaitOrTimerCallback.PerformWaitOrTimerCallback(System.Object, Boolean)
    PARAMETERS:
    state = <no data>
    timedOut = <no data>
    LOCALS:
    <no data>
    <no data>

04a4f3ec 74b91b5c [GCFrame: 04a4f3ec] 

I can see the ESP Stack pointers (04a4f25c and 04a4f3ec) and EIP Instruction pointers (746fc477 and 74b91b5c), is there a WinDBG command or anyway I can find out how this thread was started?

Upvotes: 0

Views: 1753

Answers (2)

Sebastian
Sebastian

Reputation: 3874

From you call stack I assume that you are probably not looking at the thread that threw the exception. Have you tried issuing: ~*e !CLRStack or !Threads ? This should give you information which thread holds the exception context. You can then switch to that thread using ~<thread_id>s command and investigate further.

Upvotes: 0

jcopenha
jcopenha

Reputation: 3975

!CLRStack will show you the managed stack. However, since this is a ThreadPoolWaitOrTimerCallback it's likely not to be in code you own. You should investigate where you queue callbacks.

Upvotes: 1

Related Questions