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

GDB pretty printers non-functional

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P3: Somewhat important
    • None
    • Qt Creator 4.14.0
    • Debugger
    • Linux/Other display system

    Description

      I am trying to set up Qt Creator's pretty printers with GDB (Ubuntu 9.2-0ubuntu1~20.04).

      1. I am not getting any errors on load with gdb.
      2. info pretty-printer does not list any Qt types, but it does list other types registered
      3. Expectedly, none of the types are pretty printed by gdb

      With a following .gdbinit:

      set python print-stack full
      python import sys
      python from pathlib import Path
      python sys.path.insert(1, '/root/.gdb')
      python from gdbbridge import *
      

      , and a following sample code: 

      #include <QApplication>
      #include <QString>
      
      int main(int argc, char *argv[])
      {
      QString ss = "Hello";
      QApplication app(argc, argv);
      app.setObjectName(ss);
      }
      

      , I am getting the following results in gdb console:

      root@debug:~# gdb -q -ex "break 8" -ex r ./a.out
      Reading symbols from ./a.out...
      Breakpoint 1 at 0xd10: file test.cpp, line 8.
      Starting program: /root/a.out
      [Thread debugging using libthread_db enabled]
      Using host libthread_db library "/lib/aarch64-linux-gnu/libthread_db.so.1".
      [New Thread 0xfffff394b190 (LWP 19684)]
      QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
      
      Thread 1 "a.out" hit Breakpoint 1, main (argc=1, argv=0xfffffffff708) at test.cpp:8
      8	app.setObjectName(ss);
      (gdb) pp ss
      ss =
         childtype="QChar",addrbase="0xaaaaaaad6238",addrstep="0x2",arrayencoding="uint:2",arraydata="480065006C006C006F00",<QString> = {"{...}"}
      
      Drill down:
          pp ss ss
      
      (gdb) pp app
      app =
         [
            [parent] = <QObject*> = {"0x0"}
            [children] = <QList<QObject *>> = {"3"}
            [extra] = "{...}"
            [properties] = "{...}"
            [methods] = "6"
            [d] = <QObjectPrivate> = {"{...}"}
         ],<QApplication> = {"{...}"}
      
      Drill down:
          pp app app.[extra]
          pp app app.[properties]
          pp app app
          pp app app.[d]
      
      (gdb)
      

       
      I also tested the pretty printers from master branch, to same result. I will much appreciate any help in investigating this further, I run out of the ideas at this point.

      Attachments

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

        Activity

          People

            hjk hjk
            wrobelda Dawid Wrobel
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There is 1 open Gerrit change