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

Debugger: std::vector not properly shown when using GDB system pretty printers

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Fixed
    • Affects Version/s: Qt Creator 4.8.0-beta1
    • Fix Version/s: Qt Creator 4.8.0-beta1
    • Component/s: Debugger
    • Labels:
      None
    • Platform/s:
      Linux/X11
    • Commits:
      1ae96a909059f4605d67b6b54280080914047b2a

      Description

      When using system GDB pretty printers (i.e. the "Load system gdb pretty printers" checkbox in "Tools" -> "Options" -> "Debugger" -> "GDB" is enabled), vectors are not properly displayed in the debugger view when expanded.

      Steps to reproduce:

       

      1) Use the sample program from below and set a breakpoint at the line where the output is done.

      2) Start debugging with GDB and system GDB pretty printers enabled.

      3) Observe that the "Locals" view initially shows the value "std::vector of length 2, capacity 2" for the local variable "someVector" and a small arrow key to expand (as expected).

      4) toggle the expansion, so that the value is expanded

       

      Result:

      • the value "<not accessible>" is now shown for "someVector"
      • Only a single subelement/child with name "[0]" is shown and no value is displayed for it

      Expected result:

      • the displayed value for "someVector" remains unchanged
      • both elements in the vector are shown with their respective values (23, 44)

       

      Small sample program:

      #include <iostream>
      #include <vector>
      
      int main()
      {
          std::vector<int> someVector;
          someVector.push_back(23);
          someVector.push_back(44);
          std::cout << "Hello world!" << std::endl;
          return 0;
      }

       

        Attachments

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

          Activity

            People

            Assignee:
            michaelweghorn Michael Weghorn
            Reporter:
            michaelweghorn Michael Weghorn
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes