Monday, January 16, 2012

How to read managed function parameter values from call stack when they read in WinDBG?

This week I was debugging a managed code Application with WinDBG and PSSCOR2 extension.

I had to take a look at the managed call stack including it’s function parameter using !CLRStack –p

The output looked similar to this one (the problem is the <no data> tag for the argument “args”)

0034f260 003d018d ConsoleApplication5.Program.Main(System.String[]) [C:\Users\me\Documents\Visual Studio 2010\Projects\ConsoleApplication5\ConsoleApplication5\Program.cs @ 28]

PARAMETERS:
args (0x0034f290) = <no data>

After quite some time of research I gave up and later on met a colleague who was able to give me the answer.

The assemblies I was debugging were release assemblies and the Just In Time Compiler (JIT) does lots of performance optimizations so that the debugging extensions are not able to extract the parameter values.

The solution to this problem is to tell the JIT compiler to avoid optimization during while debugging. Unfortunately this means that there is no easy way to fix the issue when only looking at post mortem memory dumps.

Read more: DAU-Blog
QR: how-to-read-managed-function-parameter-values-from-call-stack-when-they-read-lt-no-data-gt-in-windbg.aspx

Posted via email from Jasper-Net