I want to load a GDB command file into a SlickEdit debug session. I've trying adding it as a command line argument to the debug configuration, but that doesn't seem to work. Can I do this and if so, how? TIA

You are on the right track, pass the command file to GDB using -x <gdbinit>. You might want to try passing it in using an absolute path. You can turn on the def_debug_logging option (Macro > Set Variable...) in order to see what is going on with the debugger. The logging information will be in vs.log in your configuration directory.

Note that when you give GDB a command file for it to run at startup, there is a limited number of things you can do, because certain commands are not enabled in GDB/MI mode, and also some commands, such as setting breakpoints, running, stepping, etc, will leave GDB in a state which is out of sync with SlickEdit.

You can also send individual commands to GDB after starting your debug session by using the SlickEdit command "debug_send_command".

You can also send individual commands to GDB after starting your debug session by using the SlickEdit command "debug_send_command".

Sorry for a newbie question, but how to use "debug_send_command"? Write a script? Can I instead send commands interactively during a debug session? I need it to load shared libraries symbols when connected to a gdbserver.

You can also send individual commands to GDB after starting your debug session by using the SlickEdit command "debug_send_command".

Sorry for a newbie question, but how to use "debug_send_command"? Write a script? Can I instead send commands interactively during a debug session? I need it to load shared libraries symbols when connected to a gdbserver.

If you do this a lot you can specify a configuration file to load in the Debugging|Configurations|Arguments:--command=~/etc/my-gdb-commands-ls.txt

To enter commands interactively, try clicking on the status bar at the bottom of the editor (to the left of the line number display)

If you do this a lot you can specify a configuration file to load in the Debugging|Configurations|Arguments:--command=~/etc/my-gdb-commands-ls.txt

This won't do. I need to load symbols for shared libraries. To do it I need first check where in memory the libraries were loaded on the target system (where gdbserver is running), and then issue a command to gdb in the middle of the debugging session, not during invocation of gdb.

You are on the right track, pass the command file to GDB using -x <gdbinit>. You might want to try passing it in using an absolute path.

Nope!This can not work. On starting GDB SlickEdit is secretly passing the option "--nx" which directly contradicts the "-x" option. Both are mutually exclusive and "--nx" has a higher priority. So, on starting GDB no configuration files whatsoever are loaded. (Which, in my particular case, sucks big time )

@SlickEdit: Is there any way to remove the "--nx" option from the invocation of GDB?

Two things. One, the log doesn't show that anything extra was passed to gdb, so I don't think you put that in the arguments correctly, or if you did, you did not put it into the GDB configuration that you were actually using.

Look again at Debug > Debugger Options... > Configurations.

With respect to -nx, in my experience with GDB, the last argument specified wins, so, it does not matter that -nx is specified first. I've never seen it behave differently. Try "gdb -nx -ex help" from the unix command line as proof.

OK found something interesting. The --command does work. But the arguments parameter doesn't take effect until the second time you run it.I put this on the arguments line:--command=~/.slickedit/19.0.1/gdb_init.iniAnd filled the file with:handle SIG32 pass nostop noprintThen my program is not interrupted with the pthread_cancel function.