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. Help on mac: "Debugging Helpers"
Forum Updated to NodeBB v4.3 + New Features

Help on mac: "Debugging Helpers"

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
4 Posts 2 Posters 1.2k Views 2 Watching
  • 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.
  • D Offline
    D Offline
    davecotter
    wrote on last edited by davecotter
    #1

    Using Qt Creator 4.3.1

    The documentation here seems, shall we say, lacking. It's as if it describes all the constituent parts of a car: valves, hoses, bolts, tubes, etc, but fails to describe how to put it together.

    I've googled a lot and tried many different things. I can't for the life of me even get my script to run, much less have it show something interesting in the debugger.

    Would someone, who knows what they're doing on a mac, please illuminate this for us all? Pretty please? Free pro karaoke software for the one who solves this! ;-)

    1 Reply Last reply
    0
    • D Offline
      D Offline
      davecotter
      wrote on last edited by
      #2

      i got it sorta working, but have a new Q.
      steps i took were this:

      • go to folder that contains Qt Creator.app
      • right click "Qt Creator"->show package contents (obviously, right?)
      • go into Contents->Resources->debugger
      • edit the file "personaltypes.py"
      • at the bottom, enter the SIMPLEST POSSIBLE function, like this:
      def qdump__YOUR_CLASS(d, value):
      	d.putValue("i see the light!")
      	d.putNumChild(0)
      
      • substitute your actual class name, above, for "YOUR_CLASS"
      • now run
      • you SHOULD see "i see the light!" in the debugger, next to any var of type YOUR_CLASS

      so far so good?

      • copy the file "personaltypes.py" into your own dev tree, wherever you want to keep your python code
      • revert the changes to the original one (so they do not conflict)
      • in Qt Creator 4.3, go to preferences->debuggers->gdb (note: in 4.4 or later, go to "preferences->debuggers->locals & expressions")
      • in that panel, in "Extra Debugging Helpers", put the path to your version of the "personaltypes.py" script
      • run your app again. you should still see "i see the light!". if not, check your steps

      note that if ANYTHING unexpected is in your python file, it will fail silently, no message in the debug log. this is a large part of why i could not figure this out.

      now that you have your script actually RUNNING, you can fiddle with it to make it do what you need.

      My last question is this:
      If I have a class:

      class foo {
          type1   var1;
          type2   var2;
          type3   var3;
      };
      

      and say var2 and var3 are implementation details and all i care about is just seeing var1 WITHOUT having to click the little "disclosure triangle" (twirly arrow), i thought i could just have my helper say this:

      def qdump__foo(d, value):
      	d.putValue(value["var1"])
      	d.putNumChild(0)
      

      but then all i get is TYPEINFO about "type1", i do not get the VALUE of type1. what do i do to see the value?

      1 Reply Last reply
      0
      • D Offline
        D Offline
        davecotter
        wrote on last edited by
        #3

        is it really true that nobody in the universe of Qt development (who browses the forums) knows the answer to this question?

        kshegunovK 1 Reply Last reply
        0
        • D davecotter

          is it really true that nobody in the universe of Qt development (who browses the forums) knows the answer to this question?

          kshegunovK Offline
          kshegunovK Offline
          kshegunov
          Moderators
          wrote on last edited by
          #4

          It is possible. As a user programmer (for many years) I have never had the need to write my own debug helpers. You should try asking in the mailing list, where you may attract the attention of Qt's developers (they don't frequent the forum).

          Read and abide by the Qt Code of Conduct

          1 Reply Last reply
          1

          • Login

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