Skip to content

Run gdb commands before connection #97

Open

Description

@Gaswigue

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 !

Activity

  1. WebFreak001 commented on Mar 5, 2017

    @WebFreak001
    Owner

    Hm making those commands more configurable sounds like a good idea

  2. Gaswigue commented on Mar 6, 2017

    @Gaswigue
    Author

    I can code this feature if needed. But how do you want I implement it ? the "before-connection-autorun" argument is good for you ?

  3. WebFreak001 commented on Mar 6, 2017

    @WebFreak001
    Owner

    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

  4. WebFreak001 commented on Mar 8, 2017

    @WebFreak001
    Owner

    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

  5. WebFreak001 commented on Mar 8, 2017

    @WebFreak001
    Owner

    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

  6. spir6s commented on Jan 7, 2019

    @spir6s

    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.

  7. dlshutch commented on Aug 1, 2020

    @dlshutch

    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!

  8. GitMensch commented on Mar 7, 2022

    @GitMensch
    Collaborator

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions