Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QtCreator debugging split executable/debug files ?
Forum Update on Monday, May 27th 2025

QtCreator debugging split executable/debug files ?

Scheduled Pinned Locked Moved Solved Mobile and Embedded
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.
  • R Offline
    R Offline
    Rich v
    wrote on 16 Mar 2022, 21:11 last edited by Rich v
    #1

    I haven't quite stumbled on the right documentation, yet. I'm trying to debug remotely from a Linux workstation to my QNX target. The debug version of the executable is enormous and requires removing things temporarily from the filesystem in order to get it to fit. I wanted to try splitting the debug information into a separate file if possible which seems like something gdb is capable of. I'd place the stripped-down image on the filesystem and the host/gdb-client would be aware of the symbols associated with that image.

    I can build my executable in Debug mode, then split it like this:

    ntoarmv7-objcopy --only-keep-debug myprog myprog.debug
    ntoarmv7-objcopy --strip-debug myprog
    

    But I don't know how to do the equivalent of this within QtCreator:

    gdb --exec=myprog --symbols=myprog.debug
    

    When debugging smaller executables I haven't had any issues using QtCreator and setting up the build/run configuration to sftp the image and start debugging. However, without the debug information I effectively can't set breakpoints and single-step.

    Can anyone provide a good link or a summary describing how to do this?

    I found here [1] a box to check to allow separate debug info and I checked it, but it doesn't seem to affect the CMake build at all.

    [1] https://doc.qt.io/qtcreator/creator-cpu-usage-analyzer.html#using-the-performance-analyzer

    R 1 Reply Last reply 23 Mar 2022, 22:43
    0
    • R Rich v
      16 Mar 2022, 21:11

      I haven't quite stumbled on the right documentation, yet. I'm trying to debug remotely from a Linux workstation to my QNX target. The debug version of the executable is enormous and requires removing things temporarily from the filesystem in order to get it to fit. I wanted to try splitting the debug information into a separate file if possible which seems like something gdb is capable of. I'd place the stripped-down image on the filesystem and the host/gdb-client would be aware of the symbols associated with that image.

      I can build my executable in Debug mode, then split it like this:

      ntoarmv7-objcopy --only-keep-debug myprog myprog.debug
      ntoarmv7-objcopy --strip-debug myprog
      

      But I don't know how to do the equivalent of this within QtCreator:

      gdb --exec=myprog --symbols=myprog.debug
      

      When debugging smaller executables I haven't had any issues using QtCreator and setting up the build/run configuration to sftp the image and start debugging. However, without the debug information I effectively can't set breakpoints and single-step.

      Can anyone provide a good link or a summary describing how to do this?

      I found here [1] a box to check to allow separate debug info and I checked it, but it doesn't seem to affect the CMake build at all.

      [1] https://doc.qt.io/qtcreator/creator-cpu-usage-analyzer.html#using-the-performance-analyzer

      R Offline
      R Offline
      Rich v
      wrote on 23 Mar 2022, 22:43 last edited by
      #2

      @Rich-v I got this more or less working by using a stripped executable with the same name as the full debug executable.

      QtCreator's Debug->Start Debugging->Debug without Deploying then calls gdb with exec-and-symbol-file that you specify for the host side. I manually place the stripped file on the target and list that file in the Kit's 'run' configuration for the target-side file.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 24 Mar 2022, 20:35 last edited by
        #3

        Hi,

        If memory serves well, you can build in release mode with:

        CONFIG += force_debug_info
        

        that should generate the debug symbols.

        Hope it helps

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        R 1 Reply Last reply 4 Apr 2022, 15:06
        1
        • S SGaist
          24 Mar 2022, 20:35

          Hi,

          If memory serves well, you can build in release mode with:

          CONFIG += force_debug_info
          

          that should generate the debug symbols.

          Hope it helps

          R Offline
          R Offline
          Rich v
          wrote on 4 Apr 2022, 15:06 last edited by
          #4

          @SGaist That's good to know. Do you know offhand what the equivalent is for a CMake project?

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 4 Apr 2022, 19:23 last edited by
            #5

            If memory serves well, you have to set the build type as RelWithDebInfo.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            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 Extensions
            • Unsolved