diff --git a/commands/board/details.go b/commands/board/details.go index 872e5e92da9..0f3eeb5ecfa 100644 --- a/commands/board/details.go +++ b/commands/board/details.go @@ -23,6 +23,7 @@ import ( "github.com/arduino/arduino-cli/arduino/utils" "github.com/arduino/arduino-cli/commands/internal/instances" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" + "github.com/arduino/go-properties-orderedmap" ) // Details returns all details for a board including tools and HW identifiers. @@ -64,9 +65,14 @@ func Details(ctx context.Context, req *rpc.BoardDetailsRequest) (*rpc.BoardDetai details.BuildProperties, _ = utils.ExpandBuildProperties(details.GetBuildProperties()) } - details.DebuggingSupported = boardProperties.ContainsKey("debug.executable") || - boardPlatformRelease.Properties.ContainsKey("debug.executable") || - (boardRefPlatform != nil && boardRefPlatform.Properties.ContainsKey("debug.executable")) + toolProperties := properties.NewMap() + if boardRefPlatform != nil { + toolProperties.Merge(boardRefPlatform.Properties) + } + toolProperties.Merge(boardPlatformRelease.Properties) + toolProperties.Merge(boardPlatformRelease.RuntimeProperties()) + toolProperties.Merge(boardProperties) + details.DebuggingSupported = toolProperties.ContainsKey("debug.executable") && toolProperties.Get("debug.executable") != "" details.Package = &rpc.Package{ Name: boardPackage.Name, diff --git a/commands/debug/debug_info.go b/commands/debug/debug_info.go index ec254e8912e..727f819eca0 100644 --- a/commands/debug/debug_info.go +++ b/commands/debug/debug_info.go @@ -134,7 +134,7 @@ func getDebugProperties(req *rpc.GetDebugConfigRequest, pme *packagemanager.Expl debugProperties.Set(k, toolProperties.ExpandPropsInString(v)) } - 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 b1f9dc1ec25..171c11bfa30 100644 --- a/docs/UPGRADING.md +++ b/docs/UPGRADING.md @@ -2521,6 +2521,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.