Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. modifying non-simple data types in Creator debugger
QtWS25 Last Chance

modifying non-simple data types in Creator debugger

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
5 Posts 2 Posters 1.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • mzimmersM Offline
    mzimmersM Offline
    mzimmers
    wrote on last edited by
    #1

    Hi -

    I have a program using complex numbers (from <complex>). I'd like to be able to modify the contents of some of these variables during debugging, but Creator ignores my attempted changes. From the debugger doc:

    *You can use the Locals and Expressions view to change the contents of variables of simple data types, for example, int, float, QString and std::string when the program is interrupted. *

    So, does this mean that you can't modify any other data types? If so, does anyone know of any workarounds for this? Thanks.

    1 Reply Last reply
    0
    • aha_1980A Offline
      aha_1980A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      it looks indeed as there is only basic support for displaying std::complex. However, there is the possibility to extend the so called "debugging helpers" [1] with small python programs. With that, you can modify any data type, as long as you know its internal memory layout.

      [1] http://doc.qt.io/qtcreator/creator-debugging-helpers.html

      Qt has to stay free or it will die.

      1 Reply Last reply
      0
      • aha_1980A Offline
        aha_1980A Offline
        aha_1980
        Lifetime Qt Champion
        wrote on last edited by aha_1980
        #3

        Hi again,

        I found the dumper for std::complex in /opt/qtcreator-4.3.0/share/qtcreator/debugger/stdtypes.py

        It seems the dumper is already prepared to expand in the watch window, making it possible to display real and imaginary part on seperate lines. This should also make it possible to edit them. However, the type has no expandig triangle, so I guess there is a (small) bug somewhere.

        I've therefore created https://bugreports.qt.io/browse/QTCREATORBUG-18680 to track this issue.

        Qt has to stay free or it will die.

        1 Reply Last reply
        0
        • aha_1980A Offline
          aha_1980A Offline
          aha_1980
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Good news, the developer hjk fixed the small bug in stdtypes.py. Either use a Creator 4.4 snapshot starting tomorrow or apply the one-line patch to your stdtypes.py yourself.

          The change is the following: https://codereview.qt-project.org/201972

          I guess this thread can now be closed also :)

          Qt has to stay free or it will die.

          1 Reply Last reply
          2
          • mzimmersM Offline
            mzimmersM Offline
            mzimmers
            wrote on last edited by
            #5

            Thank you for taking the trouble to get this resolved. Currently Creator 4.4 is a bit buggy for my uses (didn't auto-detect my desktop kit), so I'll probably wait for it to settle down a bit, but I do appreciate your work on this.

            1 Reply Last reply
            0
            • aha_1980A aha_1980 has marked this topic as solved on

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved