Skip to content

Commit

Permalink
fix: debugging requires a non empty debug.executable (#2439)
Browse files Browse the repository at this point in the history
* fix: debugging requires a non empty debug.executable

* Updated docs

---------

Co-authored-by: Cristian Maglie <[email protected]>
  • Loading branch information
pillo79 and cmaglie committed Nov 27, 2023
1 parent 5b2f729 commit 4d20a25
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion commands/debug/debug_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func getDebugProperties(req *rpc.GetDebugConfigRequest, pme *packagemanager.Expl
}
}

if !debugProperties.ContainsKey("executable") {
if !debugProperties.ContainsKey("executable") || debugProperties.Get("executable") == "" {
return nil, &arduino.FailedDebugError{Message: tr("Debugging not supported for board %s", req.GetFqbn())}
}

Expand Down
2 changes: 2 additions & 0 deletions docs/UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2264,6 +2264,8 @@ debug.server.openocd.scripts_dir={runtime.tools.openocd-0.10.0-arduino7.path}/sh
debug.server.openocd.script={runtime.platform.path}/variants/{build.variant}/{build.openocdscript}
```
The `debug.executable` key must be present and non-empty for debugging to be supported.
The `debug.server.XXXX` subkeys are optional and also "free text", this means that the configuration may be extended as
needed by the specific server. For now only `openocd` is supported. Anyway, if this change works, any other kind of
server may be fairly easily added.
Expand Down
3 changes: 3 additions & 0 deletions docs/platform-specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -1369,12 +1369,15 @@ to provide some debug configuration directives.
All the debug directives are grouped under the `debug.*` directives. Here is the complete list of the supported
directives:

- `debug.executable`: is the absolute path to the compiled binary of the sketch
- `debug.toolchain`: is a unique identifier of the required toolchain, currently we support `gcc` (and compatible) only
- `debug.toolchain.path`: is the absolute path to the toolchain directory
- `debug.toolchain.prefix`: is the prefix of the toolchain (for example `arm-none-eabi-`)
- `debug.server`: is a unique identifier of the required debug server, currently we support only `openocd`
- `debug.svd_file`: is the absolute path to the SVD descriptor.

If the `debug.executable` property is not present or is empty debugging will not be allowed.

OpenOCD server specific configurations:

- `debug.server.openocd.path`: is the absolute path to the OpenOCD directory
Expand Down

0 comments on commit 4d20a25

Please sign in to comment.