QtCreator debugging split executable/debug files ?
-
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
-
@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.
-
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
-
If memory serves well, you have to set the build type as RelWithDebInfo.