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

Debugging with gdb does not show static variables in member functions

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • 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

    Description

      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.

      Attachments

        1. debugger.log
          20 kB
          Robert Löhning

        Issue Links

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

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes