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

Bitfield members wrongly shown in debugger's expressions view (GDB)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Done
    • Affects Version/s: Qt Creator 4.14.0-beta1
    • Fix Version/s: Qt Creator 4.14.0-beta1
    • Component/s: Debugger
    • Labels:
      None
    • Environment:
      Debian testing, GDB 9.2, Qt Creator self-compiled from master branch as of commit 834cb8d114110d4905c007f45841fd1045851ec7
    • Platform/s:
      Linux/X11
    • Commits:
      d86cf5e2358adc22feaa3cca24d4f6df9b9c457c (qt-creator/qt-creator/master)

      Description

      Bitfield members are not properly shown in the debugger's "Expressions" view. They work correctly when expanding the object they are members of (either in the "Locals" or in the "Expressions" view), but not when using an expression that directly refers to them, like "myobject.mybitmember".

       

      A sample program to reproduce this is as well as a screenshot attached.

      Steps to reproduce:

      1. Compile attached sample program "qtc-test.cpp" (based on existing "Bitfields" test for Qt Creator's debugging helpers)
      2. Set breakpoint at line 23
      3. add expressions to view all of the members for object "s" in the "Expressions" view, e.g. by adding the following expression and then expanding it: "s;s.b;s.c;s.c1;s.d;s.e;s.f;s.front;s.g;s.h;s.i;s.x;s.y;s.z"
      4. start debugging with GDB
      5. expand the object "s" in the "Locals" view and compare the values that are shown for the members there and in the expressions view

      Actual result:

      • The correct values and types are shown for the members in the "Locals" view
      • Wrong values are shown for many of the bitfield expressions in the "Expressions" view, e.g.
        • "s.c1" is shown as having value "18", but it is 0/false
        • "s.x" is shown as having value 301994906, but it's actually 2

        Attachments

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

          Activity

            People

            Assignee:
            hjk hjk
            Reporter:
            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