MANAGED DEBUGGING with WINDBG. Thread Stacks. Part 2

Hi all, This post is a continuation of MANAGED DEBUGGING with WINDBG. Thread Stacks. Part 1.   THREAD STACKS. Part 2   ·         We can inspect the objects with unmanaged commands: The reference to an object points to the method table (which is a pointer to the table with the method descriptors) followed by the…

0

MANAGED DEBUGGING with WINDBG. Thread Stacks. Part 1

Hi all, This post is a continuation of MANAGED DEBUGGING with WINDBG. Threads. Part 2.   THREAD STACKS. Part 1   ·         We can take a look to the objects in the stack: The CLR is stack-based. All references to objects are in the stack, but objects themselves are in the managed heap. We also…

0

MANAGED DEBUGGING with WINDBG. Threads. Part 2

Hi all, This post is a continuation of MANAGED DEBUGGING with WINDBG. Threads. Part 1.   THREADS. Part 2   ·         We can see all .NET related threads in our process: There are different types of .NET threads: finalizer, GC, debugger, timer, threadpool, primary and background threads. But not all threads related to .NET are…

0

MANAGED DEBUGGING with WINDBG. Threads. Part 1

Hi all, This post is a continuation of MANAGED DEBUGGING with WINDBG. Call Stacks. Part 3.   THREADS. Part 1   ·         We can see all threads in our process: If we reach a breakpoint or break on an exception, WinDbg command prompt shows the ID of the thread which reached the breakpoint or raised…

0

MANAGED DEBUGGING with WINDBG. Call Stacks. Part 3

Hi all, This post is a continuation of MANAGED DEBUGGING with WINDBG. Call Stacks. Part 2.   CALL STACKS. Part 3   ·         Let’s review previous commands:         Let’s see a sample where the debugger broke when “PlayWithArray” raised an exception. We can use the return address of the function it called, “mscorwks!JIT_RngChkFail”, to see where…

0

MANAGED DEBUGGING with WINDBG. Call Stacks. Part 2

Hi all, This post is a continuation of MANAGED DEBUGGING with WINDBG. Call Stacks. Part 1.   CALL STACKS. Part 2   ·         We can see the source code of a method in the call stack: First of all, Source Code mode has to be enabled. We’ll need symbols and source code files correctly configured….

0

MANAGED DEBUGGING with WINDBG. Call Stacks. Part 1

Hi all, This post is a continuation of MANAGED DEBUGGING with WINDBG. Setting a Breakpoint. Part 3.   CALL STACKS. Part 1   ·         We can see the call stack of the current thread: When the debugger breaks for any reason (i.e. we reached a breakpoint, we got an exception or we stopped execution manually…

0

MANAGED DEBUGGING with WINDBG. Setting a Breakpoint. Part 3

Hi all, This post is a continuation of MANAGED DEBUGGING with WINDBG. Setting a Breakpoint. Part 2.   SETTING A BREAKPOINT. Part 3  ·        We can step through the code and do some live debugging: When we reach a breakpoint, for instance, we can go step by step through the code as with any unmanaged…

0

MANAGED DEBUGGING with WINDBG. Setting a Breakpoint. Part 2

Hi all, This post is a continuation of MANAGED DEBUGGING with WINDBG. Setting a Breakpoint. Part 1.   SETTING A BREAKPOINT. Part 2   ·        We set the breakpoint: Regardless if method is jitted, we can set a breakpoint on a method by using its Method Descriptor: 0:004> !BPMD -md 00766d60 MethodDesc = 00766d60 Setting…

0

MANAGED DEBUGGING with WINDBG. Setting a Breakpoint. Part 1

Hi all, This post is a continuation of MANAGED DEBUGGING with WINDBG. Preparing the Environment.   SETTING A BREAKPOINT. Part 1   We can only set breakpoints when doing live debugging, but many of the commands explained here can be used when doing dump analysis, too. ·         We find the method where we want to…

1