Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. GLM Vector Debugging Issues in Qt Creator
Qt 6.12 LTS is out! See what's new in the release blog

GLM Vector Debugging Issues in Qt Creator

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
2 Posts 1 Posters 169 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.
  • W Offline
    W Offline
    William_Kappler
    wrote last edited by
    #1

    I'm afraid this is an extremely niche issue, but hopefully somebody has an idea because I have none left.

    I use Qt Creator for 3D programming and frequently use glm types. However, at some point, the IDE stopped being able to display glm vectors in some contexts while debugging.

    The main case I've found this happening is glm vector member variables, however I have also had it happen with glm vector locals inside of lambdas and inlined functions. I'm not really sure if there is a pattern to this or if it's coincidence it is happening in these locations.

    When it fails, I see an error in the debugger like the following. This error in particular was with the debugger broken in a member function and the variable is a member variable of the same class:

    <100python theDumper.fetchVariables({"allowinferiorcalls":1,"autoderef":1,"context":"","displaystring
    >&"python theDumper.fetchVariables({\"allowinferiorcalls\":1,\"autoderef\":1,\"context\":\"\",\"displaystringlimit\":300,\"dyntype\":1,\"expanded\":{\"inspect\":100,\"local\":100,\"local.rootNode\":100,\"local.rootNode.object\":100,\"return\":100,\"watch\":100},\"fancy\":1,\"formats\":{},\"nativemixed\":0,\"partialvar\":\"watch.0\",\"passexceptions\":0,\"qobjectnames\":1,\"qtnamespace\":\"\",\"qtversion\":331539,\"resultvarname\":\"\",\"stringcutoff\":10000,\"timestamps\":0,\"token\":100,\"typeformats\":{},\"watchers\":[{\"exp\":\"6d446972656374696f6e\",\"iname\":\"watch.0\"}]})\n"
    >~"bridgemessage={msg=\"b'  COULD NOT ACCESS FIELD: union {...}'\"},\n"
    >~"bridgemessage={msg=\"b'  COULD NOT ACCESS FIELD: union {...}'\"},\n"
    >~"bridgemessage={msg=\"b'  COULD NOT ACCESS FIELD: union {...}'\"},\n"
    >~"result={token=\"100\",data=[{iname=\"watch.0\",wname=\"6D446972656374696F6E\",address=\"0x7fffffffdcb4\",type=\"glm::vec3\",value=\"Unreachable/Invalid\",},],typeinfo=[],partial=\"1\",runtime=\"0.0011958219997723063\",counts={}}\n"
    >100^done
     <Rebuild Watchmodel 18 @ 02:42:10.560 [9987ms] >
     [GDB] Finished retrieving data.
    

    When this happens, the value is shown as only the address and the arrow to extend the variable disappears. When it works "correctly" (how it had before), it looks like the following (for a vec4 of 1,2,3,4):

    testVec	@0x7fffffffdfe0	glm::vec4
    	#1	@0x7fffffffdfe0	union {...}
    		r	1	float
    		s	1	float
    		x	1	float
    	#2	@0x7fffffffdfe4	union {...}
    		g	2	float
    		t	2	float
    		y	2	float
    	#3	@0x7fffffffdfe8	union {...}
    		b	3	float
    		p	3	float
    		z	3	float
    	#4	@0x7fffffffdfec	union {...}
    		a	4	float
    		q	4	float
    		w	4	float
    

    Perhaps what's most perplexing is that this problem doesn't seem to affect matrix types, despite those being made out of vector types. I don't think I have found a case where those exhibit the same problem.

    I'm not sure what caused this issue. My guess is either an update over the last month-ish, or something that I unwittingly changed in my system config; but I have no idea what the second would be. I have not meaningfully changed my build config to have caused this and this seems to be the only thing with debugging issues.

    Additionally, GDB itself can apparently see these variables without problem, as I can "print" them in the debugging console.

    <168print mDirection
    >&"print mDirection\n"
    >~"$3 = {{x = -0.836884081, r = -0.836884081, s = -0.836884081}, {y = 0.453796178, g = 0.453796178, t = 0.453796178}, {z = 0.306094706, b = 0.306094706, p = 0.306094706}}\n"
    >168^done
    

    It seems like this has something to do with the Qt Creator python-debugger bridge no longer being able to use anonymous unions. But like I said, this only happens some of the time, and I'm not sure why it would have an issue with anonymous unions only in some uses of the class.

    I have tried most of the common suggestions:

    • Enabling/disabling "Load .gdbinit file on startup"
    • Enabling/disabling "Load system DB pretty printers"
    • Enabling/disabling "Use Debugging Helpers"
    • Enabling/disabling most of the other settings around those
    • Restarting Creator and my system
    • Clean rebuilding with re-running cmake
    • Made sure the kit is using the correct g++ (it's using /usr/bin/x86_64-pc-linux-gnu-g++)
    • Made sure the kit is using the correct gdb (it's using /usr/bin/gdb which is as far as I know the only one I have)

    My system information:

    • Arch Linux
    • extra/linux-zen 7.2.6.zen2-1 [my active kernel]
    • extra/qtcreator 20.0.1-2
    • extra/gdb 17.2-1
    • core/gcc 16.2.1+r23+gd564253eb6c8-1
    • core/python 3.14.7-1
    • My project uses a local version of GLM, but as part of my attempts to fix this I updated an outdated version and it had no impact on this.

    Additionally, this is built with C++23 and the -g3 -O0 flags.

    1 Reply Last reply
    0
    • W Offline
      W Offline
      William_Kappler
      wrote last edited by
      #2

      Sorry; I would have edited the post but the site does not allow me. The error message I posted was from when I had my custom debugging helpers on. Them being on or not (or even present) has no impact on this failure, but they do change the error message slightly and I didn't want to confuse the issue with that oversight. Here is a version of the error with no involvement from those:

      <718python theDumper.fetchVariables({"allowinferiorcalls":1,"autoderef":1,"context":"","displaystring
      >&"python theDumper.fetchVariables({\"allowinferiorcalls\":1,\"autoderef\":1,\"context\":\"\",\"displaystringlimit\":300,\"dyntype\":1,\"expanded\":{\"inspect\":100,\"local\":100,\"local.boxHigh\":100,\"return\":100,\"watch\":100},\"fancy\":0,\"formats\":{},\"nativemixed\":0,\"partialvar\":\"local.boxHigh\",\"passexceptions\":0,\"qobjectnames\":1,\"qtnamespace\":\"\",\"qtversion\":331539,\"resultvarname\":\"\",\"stringcutoff\":10000,\"timestamps\":0,\"token\":718,\"typeformats\":{},\"watchers\":[{\"exp\":\"6d446972656374696f6e\",\"iname\":\"watch.0\"}]})\n"
      >~"bridgemessage={msg=\"b'  COULD NOT ACCESS FIELD: union {...}'\"},\n"
      >~"bridgemessage={msg=\"b'  COULD NOT ACCESS FIELD: union {...}'\"},\n"
      >~"bridgemessage={msg=\"b'  COULD NOT ACCESS FIELD: union {...}'\"},\n"
      >~"result={token=\"718\",data=[{iname=\"local.boxHigh\",name=\"boxHigh\",address=\"0x555555f48b78\",size=\"12\",numchild=\"1\",sortable=\"1\",children=[],type=\"glm::vec3&\",value=\"\",},{iname=\"watch.0\",wname=\"6D446972656374696F6E\",numchild=\"0\",type=\" \",value=\"<no such value>\",},],typeinfo=[],partial=\"1\",runtime=\"0.012951968994457275\",counts={}}\n"
      >718^done
       <Rebuild Watchmodel 92 @ 23:19:10.586 [3141ms] >
       [GDB] Finished retrieving data.
      
      1 Reply Last reply
      0

      • Login

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