Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-2895

Debugging with gdb does not show static variables in member functions

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P4: Low P4: Low
    • Qt Creator 2.1.0
    • Qt Creator 2.0.1, Qt Creator 2.1.0-rc1
    • Debugger
    • Windows Vista x64
      GNU gdb (GDB) 7.1.0.20100329-cvs

      Let's have a simple program:

      class SomeClass
      {
      public:
          SomeClass()
          {
              static int a = 4;
              ++a;
          }
      
          void someFunction()
          {
              static int b = 4;
              ++b;
          }
      };
      
      int main(int argc, char *argv[])
      {
          SomeClass someObject;
          someObject.someFunction();
          return 0;
      }
      

      Set breakpoints at the incrementations. Debugger will stop there but Locals and Watchers will show neither of the static ints.
      This is not because of compiler optimization. a and b are there, I can assign their value to other variables.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            hjk hjk
            rlohning Robert Löhning
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes