Thread: error display variable value/type

  1. #1
    Registered User
    Join Date
    May 2006
    Posts
    1,579

    error display variable value/type

    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
    <Note: this object has an invalid CLASS field>
    Invalid object
    
    0:004> !do 0x000000000012f004
    <Note: this object has an invalid CLASS field>
    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;
            }
        }
    }

    thanks in advance,
    George

  2. #2
    Registered User subdene's Avatar
    Join Date
    Jan 2002
    Posts
    367
    Hi,

    I compiled that program, and just added a console.write after the increment on a, and everything seems fine. Was is it you are trying to achieve?

    Thanks.
    Be a leader and not a follower.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Question about printing a variable???
    By Hoser83 in forum C++ Programming
    Replies: 2
    Last Post: 03-31-2006, 01:57 PM
  2. How accurate is the following...
    By emeyer in forum C Programming
    Replies: 22
    Last Post: 12-07-2005, 12:07 PM
  3. Use of variable
    By alice in forum C Programming
    Replies: 8
    Last Post: 06-05-2004, 07:32 AM
  4. Replies: 2
    Last Post: 04-12-2004, 01:37 AM
  5. write Variable and open Variable and get Information
    By cyberbjorn in forum C++ Programming
    Replies: 2
    Last Post: 04-09-2004, 01:30 AM