Commit 71b0d1aa authored by Cristian Maglie's avatar Cristian Maglie

[skip-changelog] Renamed gRPC field to match JSON output (#2398)

* Renamed gRPC field to match JSON output

* Better comment for custom_configs field

* Renamed variable
parent 830e800e
......@@ -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
}
......
......@@ -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
......
This diff is collapsed.
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment