code-debug
code-debug copied to clipboard
Run gdb commands before connection
With Renesas RX gdb (embedded system - remote GdbServer). We need to provide gdb commands before to make the connection.
For example "-gdb-set non-stop on" and only after we can use "target extended-remote :*****".
I find a way to workaround this issue.
First remove this 3 lines of mi2.js (222-224) on 0.17.0 this.sendCommand("gdb-set target-async on"), this.sendCommand("environment-directory "" + escape(cwd) + """), this.sendCommand("target-select remote " + target)
And set all needed commands in "autorun" argument in launch.json.
A way to solve this issues is maybe to provide a new arguments as "autorun" but to be triggered before.
Otherwise, it's a really good piece of extension !
Hm making those commands more configurable sounds like a good idea
I can code this feature if needed. But how do you want I implement it ? the "before-connection-autorun" argument is good for you ?
Yes, as config value with the default of ["gdb-set target-async on", "environment-directory \"$(cwd)\"", "target-select remote $(target)"]. For the variables just use a simple replace and only allow cwd and target for now. If you find other good candidates for variables, you are free to implement them as well though
if you include them in the package.json you need to escape the string like this I think: https://github.com/WebFreak001/code-debug/blob/master/package.json#L305
And yes you need them both in the package.json as well as in the js code by checking for undefined. The package.json default one is the auto completion the user will receive, your code needs to have a value that will replace the value
Are there any plans to integrate this into master? @Gaswigue Are you now able to directly debug RX processors out of vs-code? I'm trying to get this running for days now.
Just moving to vscode and am blown away by all the features. This extension is excellent, and I appreciate all the work to make it happen! My old debugger worked in non-stop mode, and it would be great if we could not only have that mode, but have it be optional! I see the patch has been around for a while, is there a reason it's not in master? Or is there a way to use a .gdbinit file as a workaround? Thanks again!
Or is there a way to use a .gdbinit file as a workaround?
Yes, if your setup uses a .gdbinit file (depend on the GDB configuration, commonly "in the folder", "in home folder" in system folder) then this will still be used.
You can also explicit request a "pre-connection script loading" by adding "debugger_args": ["-ix", "yourscript"] to the launch configuration.