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 ...@@ -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 { if cortexDebugProps := debugProperties.SubTree("cortex-debug.custom"); cortexDebugProps.Size() > 0 {
cortexDebugCustomJson["cortex-debug"] = convertToJsonMap(cortexDebugProps) customConfigs["cortex-debug"] = convertToJsonMap(cortexDebugProps)
} }
return &rpc.GetDebugConfigResponse{ return &rpc.GetDebugConfigResponse{
Executable: debugProperties.Get("executable"), Executable: debugProperties.Get("executable"),
Server: server, Server: server,
ServerPath: debugProperties.Get("server." + server + ".path"), ServerPath: debugProperties.Get("server." + server + ".path"),
ServerConfiguration: &serverConfiguration, ServerConfiguration: &serverConfiguration,
SvdFile: debugProperties.Get("svd_file"), SvdFile: debugProperties.Get("svd_file"),
Toolchain: toolchain, Toolchain: toolchain,
ToolchainPath: debugProperties.Get("toolchain.path"), ToolchainPath: debugProperties.Get("toolchain.path"),
ToolchainPrefix: debugProperties.Get("toolchain.prefix"), ToolchainPrefix: debugProperties.Get("toolchain.prefix"),
ToolchainConfiguration: &toolchainConfiguration, ToolchainConfiguration: &toolchainConfiguration,
CustomConfigurationsJson: cortexDebugCustomJson, CustomConfigs: customConfigs,
Programmer: req.GetProgrammer(), Programmer: req.GetProgrammer(),
}, nil }, nil
} }
......
...@@ -151,7 +151,7 @@ func newDebugInfoResult(info *rpc.GetDebugConfigResponse) *debugInfoResult { ...@@ -151,7 +151,7 @@ func newDebugInfoResult(info *rpc.GetDebugConfigResponse) *debugInfoResult {
} }
} }
customConfigs := map[string]any{} customConfigs := map[string]any{}
for id, configJson := range info.GetCustomConfigurationsJson() { for id, configJson := range info.GetCustomConfigs() {
var config any var config any
if err := json.Unmarshal([]byte(configJson), &config); err == nil { if err := json.Unmarshal([]byte(configJson), &config); err == nil {
customConfigs[id] = config customConfigs[id] = config
......
This diff is collapsed.
...@@ -92,8 +92,10 @@ message GetDebugConfigResponse { ...@@ -92,8 +92,10 @@ message GetDebugConfigResponse {
// Extra configuration parameters wrt GDB server // Extra configuration parameters wrt GDB server
google.protobuf.Any server_configuration = 8; google.protobuf.Any server_configuration = 8;
// Custom debugger configurations (not handled directly by Arduino CLI but // Custom debugger configurations (not handled directly by Arduino CLI but
// provided for 3rd party plugins/debuggers) // provided for 3rd party plugins/debuggers). The map keys identifies which
map<string, string> custom_configurations_json = 9; // 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 // the SVD file to use
string svd_file = 10; string svd_file = 10;
// The programmer specified in the request // 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