Important: Please read the Qt Code of Conduct -

Qt Creator 3.0: GDB "Additional Startup Commands" executing too late

  • I'm using Qt Creator 3.0 and Qt 5.2.0, developing on a QNX Device.

    When the debugger starts up, many shared library symbols aren't found. Using

    @show solib-search-path@

    indicates that the solib-search-path is being automatically set somehow (maybe by the QNX Device kit?) but it's missing important directories for finding symbols.

    I can issue a

    @set solib-search-path \some\path:\another\path:\yet\another\path@

    command to the debugger and the symbols are loaded properly. However, the path is really long, consisting of many different directories - basically, it's a pain to have to issue the command manually to the debugger for each debug session.

    In order to simplify things, in Qt Creator's Debugger Preferences, I went to the "GDB" tab and entered the command in the "Additional Startup Commands" field:

    @set solib-search-path \some\path:\another\path:\yet\another\path:\there\are\lots\of\libraries\in\my\project@

    After changing this setting I launch a new debug session. My command is executed by the debugger, but then the next command is the "default" "set solib-search-path" command, which clobbers my custom startup command.

    I tried putting my command in ~.gdbinit as well - with the same result: my custom command is executed before the default command and is essentially overwritten.

    My question is: how do I automatically set the solib-search-path in a way that it doesn't get overwritten by the "automatic" GDB commands?

  • You can put global changes into your .gdbinit.

  • Unfortunately that doesn't work. The .gdbinit commands are executed but then the "default" commands are executed right after, squashing the .gdbinit commands.

  • Did you ever find a solution for this? I have the same problem.

  • I was able to get it to work using QtCreator 3.6 by adding the commands to the "Additional Attach Commands" box instead of "Additional Startup Commands."

Log in to reply