Hello everyone,
I am using the following commands in Windbg to debug the following simple application, why there is error like, "Note: this object has an invalid CLASS field
Invalid object"?
[Code]
0:004> ~0e!clrstack -a
OS Thread Id: 0x1194 (0)
Child-SP RetAddr Call Site
RSP/REG Object Name
RSP/REG Object Name
RSP/REG Object Name
RSP/REG Object Name
RSP/REG Object Name
000000000012efe0 0000064280150182 TestDebugManaged1.Program.foo()
PARAMETERS:
this = 0x0000000002651ac8
LOCALS:
0x000000000012f000 = 0x0000000000000064
0x000000000012f004 = 0x0000000000000001
RSP/REG Object Name
000000000012f020 000006427f67d4a2 TestDebugManaged1.Program.Main(System.String[])
PARAMETERS:
args = 0x0000000002651aa8
LOCALS:
0x000000000012f040 = 0x0000000002651ac8
0:004> !do 0x000000000012f000
Invalid object
0:004> !do 0x000000000012f004
Invalid object
namespace TestDebugManaged1
{
class Program
{
void foo()
{
int a = 100;
while (true)
{
Thread.Sleep(10000);
a++;
}
}
static void Main(string[] args)
{
Program instance = new Program();
instance.foo();
return;
}
}
}
[/Code]
thanks in advance,
George
Ryan AlfordPosted Jul 8, 2008, 8:05 AM
George GeorgePosted Jul 8, 2008, 1:38 AM
Thanks Ryan!
One disadvantage for the tool is, we have to change code to add code like Debug.XXX. I want to find some way to debug without change the code for current application.
regards,
George
Ryan AlfordPosted Jul 7, 2008, 10:17 AM
I have never used Windbg so I would not be able to help you with that.
Ryan AlfordPosted Jul 7, 2008, 10:14 AM
http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx
then have it open as you are testing your application.
in your application, just do this:
Debug.WriteLine("whatever you want");
and DebugView will show it in it's window.
George GeorgePosted Jul 6, 2008, 9:59 PM
Thanks Ryan!
On the target machine, I can not install Visual Studio, I have to use WinDbg, so my question is how to display local variable values in WinDbg, any comments?
(BTW: why you think using trace or something will solve this issue? I think my issue has nothing to do with which API I used, but how to use WinDbg to display variable values. Please feel free to correct me if I am wrong.)
regards,
George
Ryan AlfordPosted Jul 6, 2008, 9:44 PM