From 99c3ea8d48857b3460573acf6bf967fa3c4c5f89 Mon Sep 17 00:00:00 2001 From: Luca Burelli <l.burelli@arduino.cc> Date: Mon, 27 Nov 2023 15:58:55 +0100 Subject: [PATCH 1/2] fix: debugging requires a non empty debug.executable --- commands/debug/debug_info.go | 2 +- docs/UPGRADING.md | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/commands/debug/debug_info.go b/commands/debug/debug_info.go index 6b8064e9d8f..1f6561331ad 100644 --- a/commands/debug/debug_info.go +++ b/commands/debug/debug_info.go @@ -140,7 +140,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())} } diff --git a/docs/UPGRADING.md b/docs/UPGRADING.md index 6c67f404b60..69cef7ebc24 100644 --- a/docs/UPGRADING.md +++ b/docs/UPGRADING.md @@ -2533,6 +2533,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. From 6518e5a14c8828d4bff9ef57b47dae73731aca31 Mon Sep 17 00:00:00 2001 From: Cristian Maglie <c.maglie@arduino.cc> Date: Mon, 27 Nov 2023 16:24:09 +0100 Subject: [PATCH 2/2] Updated docs --- docs/platform-specification.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/platform-specification.md b/docs/platform-specification.md index 8e690cb0787..fce10932c4a 100644 --- a/docs/platform-specification.md +++ b/docs/platform-specification.md @@ -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