Skip to content

Commit

Permalink
Removed debugging_supported field from BoardDetailsResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
cmaglie committed Nov 24, 2023
1 parent a4e7eb4 commit 47c87ff
Show file tree
Hide file tree
Showing 7 changed files with 178 additions and 189 deletions.
6 changes: 1 addition & 5 deletions commands/board/details.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func Details(ctx context.Context, req *rpc.BoardDetailsRequest) (*rpc.BoardDetai
return nil, &arduino.InvalidFQBNError{Cause: err}
}

boardPackage, boardPlatformRelease, board, boardProperties, boardRefPlatform, err := pme.ResolveFQBN(fqbn)
boardPackage, boardPlatformRelease, board, boardProperties, _, err := pme.ResolveFQBN(fqbn)
if err != nil {
return nil, &arduino.UnknownFQBNError{Cause: err}
}
Expand All @@ -64,10 +64,6 @@ 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"))

details.Package = &rpc.Package{
Name: boardPackage.Name,
Maintainer: boardPackage.Maintainer,
Expand Down
12 changes: 12 additions & 0 deletions docs/UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,18 @@ To address all the inconsistencies/inaccuracies we introduced two messages:
- `PlatformMetadata` contains generic information about a platform (not correlated to a specific release).
- `PlatformRelease` contains information about a specific release of a platform.

### `debugging_supported` field has been removed from gRPC `cc.arduino.cli.commands.v1.BoardDetails` and `board details` command in CLI

The `debuggin_supported` field has been removed, since the possibility to debug is determined by:

- the board selected
- the board option selected
- the programmer selected

the `board details` command has no sufficient information to determine it. If you need to determine if a specific
selection of board + option + programmer supports debugging, use the gRPC call
`cc.arduino.cli.commands.v1.GetDebugConfig`: if the call is successful, it means that the debugging is supported.

## 0.35.0

### CLI `debug --info` changed JSON output.
Expand Down
3 changes: 0 additions & 3 deletions internal/cli/board/details.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,6 @@ func (dr detailsResult) String() string {
t.AddRow(tr("Board name:"), details.Name)
t.AddRow(tr("FQBN:"), details.Fqbn)
addIfNotEmpty(tr("Board version:"), details.Version)
if details.DebuggingSupported {
t.AddRow(tr("Debugging supported:"), table.NewCell("✔", color.New(color.FgGreen)))
}

if details.Official {
t.AddRow() // get some space from above
Expand Down
2 changes: 0 additions & 2 deletions internal/cli/feedback/result/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,6 @@ type BoardDetailsResponse struct {
ToolsDependencies []*ToolsDependency `json:"tools_dependencies,omitempty"`
ConfigOptions []*ConfigOption `json:"config_options,omitempty"`
Programmers []*Programmer `json:"programmers,omitempty"`
DebuggingSupported bool `json:"debugging_supported,omitempty"`
IdentificationProperties []*BoardIdentificationProperties `json:"identification_properties,omitempty"`
BuildProperties []string `json:"build_properties,omitempty"`
DefaultProgrammerID string `json:"default_programmer_id,omitempty"`
Expand All @@ -441,7 +440,6 @@ func NewBoardDetailsResponse(b *rpc.BoardDetailsResponse) *BoardDetailsResponse
ToolsDependencies: NewToolsDependencies(b.GetToolsDependencies()),
ConfigOptions: NewConfigOptions(b.GetConfigOptions()),
Programmers: NewProgrammers(b.GetProgrammers()),
DebuggingSupported: b.GetDebuggingSupported(),
IdentificationProperties: NewBoardIdentificationProperties(b.GetIdentificationProperties()),
BuildProperties: buildProperties,
DefaultProgrammerID: b.GetDefaultProgrammerId(),
Expand Down
1 change: 0 additions & 1 deletion internal/integrationtest/board/board_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,6 @@ func TestBoardDetails(t *testing.T) {
"name": "Atmel SAM-ICE"
}
],
"debugging_supported": true,
"identification_properties": [
{
"properties": {
Expand Down
Loading

0 comments on commit 47c87ff

Please sign in to comment.