Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to create a remote debugging session? #29

Open
ceremcem opened this issue Dec 14, 2017 · 11 comments
Open

Is it possible to create a remote debugging session? #29

ceremcem opened this issue Dec 14, 2017 · 11 comments
Labels

Comments

@ceremcem
Copy link

Is it possible to create a remote debugging session? If so, where do we assign

  • gdb executable path: /usr/bin/arm-none-eabi-gdb in my case
  • gdbinit file path
@ProPuke
Copy link
Member

ProPuke commented Dec 15, 2017

Yep. If you save a config it will generate a .atom-dbg.cson file in the root of your project, which you can put things into, or you can write one from scratch as either .atom-dbg.cson or .atom-dbg.json (for cson or json format).

The parameters are listed at the end of the package readme/info, but an example may look something like: (indentation is important)

"remote debug":
    debugger: "dbg-gdb"
    gdb_executable: "/usr/bin/arm-none-eabi-gdb"
    gdb_commands: ["source path_to_gdbinit"]

You'd then push F5 and select "remote debug" to run that config. You can also include multiple commands rather than bundling in a gdbinit if more convenient:

gdb_commands: ["foo", "bar", "baz"]

There's also gdb_arguments if you want to pass custom arguments to gdb when launching, or cwd if you need to set a custom cwd (it defaults to the first directory of the project).

Configs are named, so you can have as many as you want. If you save a configuration with the gui it will non-destructively append it to the end of the file. When you save changes the additions will become available immediately via F5.

@ceremcem
Copy link
Author

ceremcem commented Dec 15, 2017

Thank you for your response.

Since my gdb-init is shared between several debuggers (command-line debugger will stay as an option), going forward with gdb-init is more appropriate right now.

I added following cson file to the project root:

"remote debug":
    debugger: "dbg-gdb"
    gdb_executable: "/usr/bin/arm-none-eabi-gdb"
    gdb_commands: ["source ./mcu-debug/gdb-init"]

and pressed F5, selected "remote debug". Debugger navigation buttons appeared:

image

...but nothing more. No errors, no result. Looking my gdb server, there is no evidence of connection:

image

White section is gdb-server output (left) when I connect with arm-none-eabi-gdb (right). Red section is gdb-server's stand-by output which stays still when I hit F5 and select "remote debug" option.

@ProPuke
Copy link
Member

ProPuke commented Dec 15, 2017

Hmm.. It should just be literally forwarding those commands on to gdb. So if they're the correct commands it should work (I don't have a lot of experience with remote debugging I'm afraid).

If you view package settings for gdb-dbg there's an option to log output to the developer console, turn that on and enable the dev console in atom and you'll see the communication. Hopefully that helps narrow the problem.

@ceremcem
Copy link
Author

Possibly this is the problem:

image

@ProPuke
Copy link
Member

ProPuke commented Dec 15, 2017

Oh, ouch! That's a bug!

Are you by any chance running an old version of Atom? Looks like I used a method added around Atom v1.19 (or somewhere around there) but didn't set the version requirements appropriately. Sorry. Updating atom should make it work.

@ceremcem
Copy link
Author

ceremcem commented Dec 15, 2017

Before I update the atom, do you want to add appropriate error message which I can confirm?

Edit: I created a snapshot of my system, I may make the error message confirmation at any time.

@ProPuke ProPuke added the bug label Dec 15, 2017
@ceremcem
Copy link
Author

ceremcem commented Dec 15, 2017

I updated Atom and F5 correctly connected to gdb server. Here is the current error message:

image

(Edit: console gives nothing.)

@ProPuke
Copy link
Member

ProPuke commented Dec 15, 2017

Ahh, whoops. I need to add an option to disable the run command when remote debugging. This will be fixed in the next update which will hopefully be this weekend. Sorry about that.

I know what the error is from before, so no need for the snapshot. But thanks for the help!

Both will be fixed in the next version. Cheers!

@creationix
Copy link

creationix commented Jan 30, 2018

How's the progress on this going? I'm trying to remote debug and am getting the same "Don't know how to run..." error.

I'm trying to connect to an openocd server. Here is my .atom-dbg.cson file:

"Base-Debug/stm32f042f4px-daplie.elf":
  debugger: "dbg-gdb"
  gdb_executable: "/usr/bin/arm-none-eabi-gdb"
  gdb_commands: [
    "target remote :3333"
    "set print asm-demangle on"
    "monitor arm semihosting enable"
    "load"
    "step"
  ]
  path: "Base-Debug/stm32f042f4px-daplie.elf"
  cwd: "."

@ceremcem
Copy link
Author

@creationix You may want to take a look at mcu-debug, the command line debugging tool for STM microcontrollers untill this issue is solved.

@papyDoctor
Copy link

papyDoctor commented Apr 9, 2020

For remote debugging, here is the solution:
Open ~/.atom/packages/dbg-gdb/lib

At lines 181 - 204 we have:

@sendCommand '-exec-run'
...
@dbg.stop()

Remove or comment (with #) these lines
See also solution for Uncaught Callback must be a function (31i73/atom-dbg#46)

It seems that the maintainer of the debug packages is out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants