Skip to content

Renamed gRPC field to match JSON output #2398

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions commands/debug/debug_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,22 +184,22 @@ func getDebugProperties(req *rpc.GetDebugConfigRequest, pme *packagemanager.Expl
}
}

cortexDebugCustomJson := map[string]string{}
customConfigs := map[string]string{}
if cortexDebugProps := debugProperties.SubTree("cortex-debug.custom"); cortexDebugProps.Size() > 0 {
cortexDebugCustomJson["cortex-debug"] = convertToJsonMap(cortexDebugProps)
customConfigs["cortex-debug"] = convertToJsonMap(cortexDebugProps)
}
return &rpc.GetDebugConfigResponse{
Executable: debugProperties.Get("executable"),
Server: server,
ServerPath: debugProperties.Get("server." + server + ".path"),
ServerConfiguration: &serverConfiguration,
SvdFile: debugProperties.Get("svd_file"),
Toolchain: toolchain,
ToolchainPath: debugProperties.Get("toolchain.path"),
ToolchainPrefix: debugProperties.Get("toolchain.prefix"),
ToolchainConfiguration: &toolchainConfiguration,
CustomConfigurationsJson: cortexDebugCustomJson,
Programmer: req.GetProgrammer(),
Executable: debugProperties.Get("executable"),
Server: server,
ServerPath: debugProperties.Get("server." + server + ".path"),
ServerConfiguration: &serverConfiguration,
SvdFile: debugProperties.Get("svd_file"),
Toolchain: toolchain,
ToolchainPath: debugProperties.Get("toolchain.path"),
ToolchainPrefix: debugProperties.Get("toolchain.prefix"),
ToolchainConfiguration: &toolchainConfiguration,
CustomConfigs: customConfigs,
Programmer: req.GetProgrammer(),
}, nil
}

Expand Down
2 changes: 1 addition & 1 deletion internal/cli/debug/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func newDebugInfoResult(info *rpc.GetDebugConfigResponse) *debugInfoResult {
}
}
customConfigs := map[string]any{}
for id, configJson := range info.GetCustomConfigurationsJson() {
for id, configJson := range info.GetCustomConfigs() {
var config any
if err := json.Unmarshal([]byte(configJson), &config); err == nil {
customConfigs[id] = config
Expand Down
79 changes: 39 additions & 40 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.

6 changes: 4 additions & 2 deletions rpc/cc/arduino/cli/commands/v1/debug.proto
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,10 @@ message GetDebugConfigResponse {
// Extra configuration parameters wrt GDB server
google.protobuf.Any server_configuration = 8;
// Custom debugger configurations (not handled directly by Arduino CLI but
// provided for 3rd party plugins/debuggers)
map<string, string> custom_configurations_json = 9;
// provided for 3rd party plugins/debuggers). The map keys identifies which
// 3rd party plugin/debugger is referred, the map string values contains a
// JSON configuration for it.
map<string, string> custom_configs = 9;
// the SVD file to use
string svd_file = 10;
// The programmer specified in the request
Expand Down