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

Debugger cannot display vector when compiled with '-D_GLIBCXX_DEBUG'

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • Qt Creator 4.10.0-beta2
    • Qt Creator 4.10.0-beta1
    • Debugger
    • None
    • Debian testing with
      * GDB 8.2.1
      * g++ (Debian 8.3.0-6) 8.3.0
    • Linux/X11
    • aedc0ca91bd1bc0ad9a3e411f8c9996250e14d61 (qt-creator/qt-creator/4.10)

    Description

      Displaying the value of std::vector (and presumable other std library container) objects in the local variable pane doesn't work correctly if the program is compiled with the '-D_GLIBCXX_DEBUG' compiler flag (which results in obect size changes).

      Sample program to reproduce ("test.cpp"):

      #include <vector>
      
      int main() {
          std::vector<int> v;
          v.push_back(1);
          return 0; // breakpoint here, check value of 'v'
      };
      

       
      Makefile:

      all:
              g++ -g -O0 -D_GLIBCXX_DEBUG -o test test.cpp
      

      Sample steps to reproduce (possible with other project type than CompilationDatabase as well):

      • make sure that GDB system pretty printers are disabled, so that Qt Creator's own printers are used
      • run 'bear make' to compile the program and generate the compilation database
      • import the project into Qt Creator using the generated 'compile_commands.json' file
      • set breakpoint at the return statement
      • start debugging
      • observe the displayed value for the vector 'v' in the debugger's locals view

      Result: The value "<0 items>" is displayed for 'v' and there's no possibility to expand the vector to see the element that was inserted.

      Expected result: The value "<1 item>" should be displayed for 'v' and it should be possible to expand it to see that the vector contains an element with value '1'.

      Attachments

        For Gerrit Dashboard: QTCREATORBUG-22606
        # Subject Branch Project Status CR V

        Activity

          People

            hjk hjk
            michaelweghorn Michael Weghorn
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes