I have been using GDB and Openocd to debug my embedded platform. GDB connects to GDB server run by Openocd, which is in turn invoked using a customized version of OpenOCD + STM32CubeMX plugin. Everything was working great until the latency of remote connection increased. The openocd startup script now takes longer to execute so the remote connection is apparently timing out. I can reproduce the issue without CLion on the command line and can solve it by setting a higher connection timeout by either sending gdb command "set remotetimeout <num>" before target connection, or by providing the commandline option "-l <timeout>" when starting gdb. How can I do either of these while starting gdb from CLion?
One option I tried was to create .gdbinit and add "set remotetimeout" there. This works, but is not the ideal solution for me as I will have to instruct a large team of people to do this. I am looking some solution through the Openocd plugin, which I can deploy without much disruption. Can I pass in commandline options from the plugin while starting gdb? Or could I somehow customize the plugin to run a set of instructions before the remote connection like what .gdbinit does?
BTW, I also tried changing various timeouts I found in CLion registry too, but nothing worked.
CLion Version: 2018.3.3