When debugging, some of you may have noticed that looking at a managed callstack looks a little different then a native one. One of the big differences is that you don't see the parameters that are passed to the function. So what can we do about that?
So the first choice that we have is to try looking at the output from !dumpstackobjects and seeing if we got lucky and the parameter that we are interested in was pushed onto the stack. One thing that helps with this is if you are using the clr10\sos.dll that ships with the debugger package (which only works against .NET 1.0 and 1.1), you can run !clrstack -a and it will combine the output of these two commands and sort them so you can see what stack objects are associated with which frame on the callstack.
If that doesn't work, then we need to try to look at making a change and having the problem happen again. .NET checks for two things before removing this information to save on space and performance. So we can change either of them in order to get the parameters to show up with !clrstack. Our choices are:
The first option is pretty straight forward. For the second one, you can get more information here. But basically you just create a text file in the same directory where your assembly is located that has the same name as your assembly but .ini instead of .exe or .dll. Then in the file, you just put these lines:
[.NET Framework Debugging Control]
Then to see this additional information in a debugger, you can run !clrstack -p to see parameters, -l to see locals, -a to see everything, etc.