Question

I use SOS.dll in VisualStudio to debug my C# program. The program is as below.

The debug command is !DumpStackObjects.

class Program
{
    static void Main()
    {
        Int32 result = f(1);
    }

    static Int32 f(Int32 i)
    {
        Int32 j = i + 1;
        return j;            <===========BreakPoint is here
    }
}

After I input the "!dso" command in the immediate window of Visual Studio, the result is as below:

OS Thread Id: 0xf6c (3948)

ESP/REG Object Name

Why there's nothing? I thought there should be the args i and local variable j.

Thanks for my answering my naive questions...

Was it helpful?

Solution

!dumpstackobject dumps references on the stack to objects. I.e. you won't see value types with this command. Use !clrstack -l to see locals (use -p to see parameters, and -a for both).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top