Skip to content

Commit c78afde

Browse files
committed
Show if debugging is supported in board details command
1 parent b62d320 commit c78afde

File tree

5 files changed

+168
-142
lines changed

5 files changed

+168
-142
lines changed

cli/board/details.go

+3
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ func (dr detailsResult) String() string {
124124
t.AddRow(tr("Board name:"), details.Name)
125125
t.AddRow("FQBN:", details.Fqbn)
126126
addIfNotEmpty(tr("Board version:"), details.Version)
127+
if details.GetDebuggingSupported() {
128+
t.AddRow(tr("Debugging supported:"), table.NewCell("✔", color.New(color.FgGreen)))
129+
}
127130

128131
if details.Official {
129132
t.AddRow() // get some space from above

commands/board/details.go

+9-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ func Details(ctx context.Context, req *rpc.BoardDetailsReq) (*rpc.BoardDetailsRe
3838
return nil, fmt.Errorf("parsing fqbn: %s", err)
3939
}
4040

41-
boardPackage, boardPlatform, board, _, _, err := pm.ResolveFQBN(fqbn)
41+
boardPackage, boardPlatform, board, boardProperties, boardRefPlatform, err := pm.ResolveFQBN(fqbn)
42+
4243
if err != nil {
4344
return nil, fmt.Errorf("loading board data: %s", err)
4445
}
@@ -50,6 +51,13 @@ func Details(ctx context.Context, req *rpc.BoardDetailsReq) (*rpc.BoardDetailsRe
5051
details.Official = fqbn.Package == "arduino"
5152
details.Version = board.PlatformRelease.Version.String()
5253

54+
details.DebuggingSupported = boardProperties.ContainsKey("debug.executable") ||
55+
boardPlatform.Properties.ContainsKey("debug.executable") ||
56+
(boardRefPlatform != nil && boardRefPlatform.Properties.ContainsKey("debug.executable")) ||
57+
// HOTFIX: Remove me when the `arduino:samd` core is updated
58+
boardPlatform.String() == "arduino:[email protected]" ||
59+
boardPlatform.String() == "arduino:[email protected]"
60+
5361
details.Package = &rpc.Package{
5462
Name: boardPackage.Name,
5563
Maintainer: boardPackage.Maintainer,

commands/debug/debug_info.go

+1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ func getDebugProperties(req *debug.DebugConfigReq, pm *packagemanager.PackageMan
8181
toolProperties.Merge(boardProperties)
8282

8383
// HOTFIX: Remove me when the `arduino:samd` core is updated
84+
// (remember to remove it also in arduino/board/details.go)
8485
if !toolProperties.ContainsKey("debug.executable") {
8586
if platformRelease.String() == "arduino:[email protected]" || platformRelease.String() == "arduino:[email protected]" {
8687
toolProperties.Set("debug.executable", "{build.path}/{build.project_name}.elf")

0 commit comments

Comments
 (0)