Skip to content

Commit

Permalink
Added programmer field in debug info output (#2391)
Browse files Browse the repository at this point in the history
* Added `programmer` field to debug info response

* Added integration test
  • Loading branch information
cmaglie committed Oct 26, 2023
1 parent 5ed8d4b commit c1db8cb
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 6 deletions.
1 change: 1 addition & 0 deletions commands/debug/debug_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ func getDebugProperties(req *rpc.GetDebugConfigRequest, pme *packagemanager.Expl
ToolchainPrefix: debugProperties.Get("toolchain.prefix"),
ToolchainConfiguration: &toolchainConfiguration,
CortexDebugCustomJson: cortexDebugCustomJson,
Programmer: req.GetProgrammer(),
}, nil
}

Expand Down
2 changes: 2 additions & 0 deletions internal/cli/debug/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ type debugInfoResult struct {
ServerConfig any `json:"server_configuration,omitempty"`
SvdFile string `json:"svd_file,omitempty"`
CortexDebugCustomConfig any `json:"cortex-debug_custom_configuration,omitempty"`
Programmer string `json:"programmer"`
}

type openOcdServerConfigResult struct {
Expand Down Expand Up @@ -166,6 +167,7 @@ func newDebugInfoResult(info *rpc.GetDebugConfigResponse) *debugInfoResult {
ServerConfig: serverConfig,
SvdFile: info.SvdFile,
CortexDebugCustomConfig: cortexDebugCustomConfig,
Programmer: info.Programmer,
}
}

Expand Down
12 changes: 8 additions & 4 deletions internal/integrationtest/debug/debug_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ func testAllDebugInformation(t *testing.T, env *integrationtest.Environment, cli
"thb setup",
"c"
]
}
},
"programmer": "atmel_ice"
}`)
}

Expand Down Expand Up @@ -189,7 +190,8 @@ func testAllDebugInformation(t *testing.T, env *integrationtest.Environment, cli
"thb setup",
"c"
]
}
},
"programmer": "my_cold_ice"
}`)

{
Expand All @@ -211,7 +213,8 @@ func testAllDebugInformation(t *testing.T, env *integrationtest.Environment, cli
"single-script"
]
},
"svd_file": "svd-file"
"svd_file": "svd-file",
"programmer": "atmel_ice"
}`)
}

Expand All @@ -234,7 +237,8 @@ func testAllDebugInformation(t *testing.T, env *integrationtest.Environment, cli
"cold_ice_script"
]
},
"svd_file": "svd-file"
"svd_file": "svd-file",
"programmer": "my_cold_ice"
}`)
}

Expand Down
15 changes: 13 additions & 2 deletions rpc/cc/arduino/cli/commands/v1/debug.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions rpc/cc/arduino/cli/commands/v1/debug.proto
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ message GetDebugConfigResponse {
string cortex_debug_custom_json = 9;
// the SVD file to use
string svd_file = 10;
// The programmer specified in the request
string programmer = 11;
}

// Configurations specific for the 'gcc' toolchain
Expand Down

0 comments on commit c1db8cb

Please sign in to comment.