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

Debugger not always showing pointer types as such

    XMLWordPrintable

Details

    • Linux/X11
    • f4dc3fd5c519e9181db5d241eee989b0284950db (qt-creator/qt-creator/master)

    Description

      Currently, Qt Creator does not always show pointer types as such in the debugger.
      Steps to reproduce:

      1) Set up a new project with the sample program given at the end that uses `QString` pointer types.
      2) set up the project to use either GDB or LLDB as debugger
      3) set a breakpoint for the `return a.exec()`
      4) start program in debugger
      5) check what the debugger view shows for the local variables, in particular `str`, `ptr` and `ptrptr`

      Result:

      The following values are shown in the "Name", "Value" and "Type" columns:

      • str, "hello", QString
      • ptr, "hello", QString
      • ptrptr, "hello", QString

      Expected result:

      Since `ptr` and `ptrptr` are of pointer types `QString*` and `QString**`, those should be shown in their "Type" column, i.e.:

      • str, "hello", QString
      • ptr, "hello", QString *
      • ptrptr, "hello", QString * *

      Small sample program:

          #include <QCoreApplication>
      
          int main(int argc, char *argv[])
          {
              QCoreApplication a(argc, argv);
              QString str("hello");
              QString *ptr = &str;
              QString **ptrptr = &ptr;
              return a.exec();
          }
      

       

      I also tested this with the current development version (master branch as of commit 0f96f735f009a8f79a97ef81183bb43eaedc3a1e).

      Attachments

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

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes