How can I pass commands to the gdb client before the program is loaded using the Embedded GDB Server
已回答
Hi,
I''m trying to switch my workflow to Clion + CMake from Keil. For a specific microcontroller, I need to execute few commands which read from and write to the RAM using the GDB client before the program binary is loaded by the debugger. Eclipse has the following option to add initialization commands:

Is there a similar option to do this in CLion? I am ok with writing a script which would perform the same but I cannot use a .gdbinit in my $HOME folder as I would need to share this workflow.
Thanks
请先登录再写评论。
Hello!
Unfortunately, there is no such option. You can try using this workaround. CLion supports reading .gdbinit from the project root, but to enable this behavior, you have to explicitly allow it in your home .gdbinit file, either globally or for a particular project. For the exact commands, see this.
Any update on this?
We have 2023 I like CLion but it has worst embedded capabilities from all IDE.
Poor debugging experience.
Making hacks to run things on microcontrollers.
Really is it so hard to gibe power to the user? Just let us select/pass the configuration to GDB.