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

Creator won't see arrays if GDB makes them pretty

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Done
    • Affects Version/s: Qt Creator 4.11.0, Qt Creator 4.14.0
    • Fix Version/s: Qt Creator 5.0.0-rc1
    • Component/s: Debugger
    • Labels:
      None
    • Platform/s:
      Linux/X11
    • Commits:
      185ceda8f10daca8692a35c5e18e762c5379c27c (qt-creator/qt-creator/5.0)

      Description

      I run qtcreator with the option "Load system GDB pretty printers" set on. This works on my C projects as long as objects are not cells of a C array, but fails as soon as they are. In the following example, I ask GDB to render Point as (x y) :

       

      typedef struct Point { int x, y; } Point;
      int main()
      {
        Point
          line[] = { {0, 0}, {1, 1} },
          point = line[1];
        return 0; // breakpoint here
      

      Creator displays array items as <not accessible> , as much as in this ASCII rendering:

       Name     Value             Type 
       + line   0x7f...10           Point[2]
           [0]  <not accessible>  Point
           [1]  <not accessible>  Point
         point  (1 1)             Point

       

      Both gdb and qtcreator are under Ubuntu 20.04:

      • GNU gdb (Ubuntu 9.2-0ubuntu1~20.04) 9.2
      • Qt Creator 4.11.0

      I've also tried Creator 4.14.0 with the same results.

      I've investigated a bit, and found that PlainDumper.call in /usr/share/qtcreator/debugger/gdbbridge.py is missing a value.nativeValue in the situation. Rebuilding locally some nativeValue from value and theDumper  does fix  the present example.

        Attachments

        1. gdbbridge.patch
          0.7 kB
        2. gdbbridge-1.patch
          0.7 kB
        3. test-gdb.py
          0.4 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            hjk hjk
            Reporter:
            champignac Bruno Vasselle
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes