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,9 +184,9 @@ 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"),
......@@ -198,7 +198,7 @@ func getDebugProperties(req *rpc.GetDebugConfigRequest, pme *packagemanager.Expl
ToolchainPath: debugProperties.Get("toolchain.path"),
ToolchainPrefix: debugProperties.Get("toolchain.prefix"),
ToolchainConfiguration: &toolchainConfiguration,
CustomConfigurationsJson: cortexDebugCustomJson,
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
......
......@@ -296,8 +296,10 @@ type GetDebugConfigResponse struct {
// Extra configuration parameters wrt GDB server
ServerConfiguration *anypb.Any `protobuf:"bytes,8,opt,name=server_configuration,json=serverConfiguration,proto3" json:"server_configuration,omitempty"`
// Custom debugger configurations (not handled directly by Arduino CLI but
// provided for 3rd party plugins/debuggers)
CustomConfigurationsJson map[string]string `protobuf:"bytes,9,rep,name=custom_configurations_json,json=customConfigurationsJson,proto3" json:"custom_configurations_json,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
// 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.
CustomConfigs map[string]string `protobuf:"bytes,9,rep,name=custom_configs,json=customConfigs,proto3" json:"custom_configs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
// the SVD file to use
SvdFile string `protobuf:"bytes,10,opt,name=svd_file,json=svdFile,proto3" json:"svd_file,omitempty"`
// The programmer specified in the request
......@@ -392,9 +394,9 @@ func (x *GetDebugConfigResponse) GetServerConfiguration() *anypb.Any {
return nil
}
func (x *GetDebugConfigResponse) GetCustomConfigurationsJson() map[string]string {
func (x *GetDebugConfigResponse) GetCustomConfigs() map[string]string {
if x != nil {
return x.CustomConfigurationsJson
return x.CustomConfigs
}
return nil
}
......@@ -565,7 +567,7 @@ var file_cc_arduino_cli_commands_v1_debug_proto_rawDesc = []byte{
0x65, 0x62, 0x75, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04,
0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61,
0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x92, 0x05, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x44, 0x65,
0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0xe4, 0x04, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x44, 0x65,
0x62, 0x75, 0x67, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x61, 0x62, 0x6c,
......@@ -589,39 +591,36 @@ var file_cc_arduino_cli_commands_v1_debug_proto_rawDesc = []byte{
0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x13, 0x73,
0x65, 0x72, 0x76, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69,
0x6f, 0x6e, 0x12, 0x8e, 0x01, 0x0a, 0x1a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x63, 0x6f,
0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x6a, 0x73, 0x6f,
0x6e, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x50, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64,
0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64,
0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x65, 0x62, 0x75, 0x67, 0x43, 0x6f, 0x6e,
0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x43, 0x75, 0x73, 0x74,
0x6f, 0x6d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73,
0x4a, 0x73, 0x6f, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x18, 0x63, 0x75, 0x73, 0x74, 0x6f,
0x6d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x4a,
0x73, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x76, 0x64, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x18,
0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x76, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x1e,
0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x6d, 0x65, 0x72, 0x18, 0x0b, 0x20, 0x01,
0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x6d, 0x65, 0x72, 0x1a, 0x4b,
0x0a, 0x1d, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x4a, 0x73, 0x6f, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12,
0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65,
0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x20, 0x0a, 0x1e, 0x44,
0x65, 0x62, 0x75, 0x67, 0x47, 0x43, 0x43, 0x54, 0x6f, 0x6f, 0x6c, 0x63, 0x68, 0x61, 0x69, 0x6e,
0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x70, 0x0a,
0x1f, 0x44, 0x65, 0x62, 0x75, 0x67, 0x4f, 0x70, 0x65, 0x6e, 0x4f, 0x43, 0x44, 0x53, 0x65, 0x72,
0x76, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
0x70, 0x61, 0x74, 0x68, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x73, 0x5f,
0x64, 0x69, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x63, 0x72, 0x69, 0x70,
0x74, 0x73, 0x44, 0x69, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x73,
0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x73, 0x42,
0x48, 0x5a, 0x46, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x72,
0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2d, 0x63, 0x6c,
0x69, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x63, 0x63, 0x2f, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f,
0x2f, 0x63, 0x6c, 0x69, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2f, 0x76, 0x31,
0x3b, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
0x6f, 0x6e, 0x12, 0x6c, 0x0a, 0x0e, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x63, 0x6f, 0x6e,
0x66, 0x69, 0x67, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x45, 0x2e, 0x63, 0x63, 0x2e,
0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d,
0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x65, 0x62, 0x75, 0x67,
0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x43,
0x75, 0x73, 0x74, 0x6f, 0x6d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72,
0x79, 0x52, 0x0d, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73,
0x12, 0x19, 0x0a, 0x08, 0x73, 0x76, 0x64, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x0a, 0x20, 0x01,
0x28, 0x09, 0x52, 0x07, 0x73, 0x76, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x70,
0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x6d, 0x65, 0x72, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52,
0x0a, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x6d, 0x65, 0x72, 0x1a, 0x40, 0x0a, 0x12, 0x43,
0x75, 0x73, 0x74, 0x6f, 0x6d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72,
0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01,
0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x20, 0x0a,
0x1e, 0x44, 0x65, 0x62, 0x75, 0x67, 0x47, 0x43, 0x43, 0x54, 0x6f, 0x6f, 0x6c, 0x63, 0x68, 0x61,
0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22,
0x70, 0x0a, 0x1f, 0x44, 0x65, 0x62, 0x75, 0x67, 0x4f, 0x70, 0x65, 0x6e, 0x4f, 0x43, 0x44, 0x53,
0x65, 0x72, 0x76, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69,
0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74,
0x73, 0x5f, 0x64, 0x69, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x63, 0x72,
0x69, 0x70, 0x74, 0x73, 0x44, 0x69, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x63, 0x72, 0x69, 0x70,
0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74,
0x73, 0x42, 0x48, 0x5a, 0x46, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2d,
0x63, 0x6c, 0x69, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x63, 0x63, 0x2f, 0x61, 0x72, 0x64, 0x75, 0x69,
0x6e, 0x6f, 0x2f, 0x63, 0x6c, 0x69, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2f,
0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
}
var (
......@@ -644,7 +643,7 @@ var file_cc_arduino_cli_commands_v1_debug_proto_goTypes = []interface{}{
(*GetDebugConfigResponse)(nil), // 3: cc.arduino.cli.commands.v1.GetDebugConfigResponse
(*DebugGCCToolchainConfiguration)(nil), // 4: cc.arduino.cli.commands.v1.DebugGCCToolchainConfiguration
(*DebugOpenOCDServerConfiguration)(nil), // 5: cc.arduino.cli.commands.v1.DebugOpenOCDServerConfiguration
nil, // 6: cc.arduino.cli.commands.v1.GetDebugConfigResponse.CustomConfigurationsJsonEntry
nil, // 6: cc.arduino.cli.commands.v1.GetDebugConfigResponse.CustomConfigsEntry
(*Instance)(nil), // 7: cc.arduino.cli.commands.v1.Instance
(*Port)(nil), // 8: cc.arduino.cli.commands.v1.Port
(*anypb.Any)(nil), // 9: google.protobuf.Any
......@@ -655,7 +654,7 @@ var file_cc_arduino_cli_commands_v1_debug_proto_depIdxs = []int32{
8, // 2: cc.arduino.cli.commands.v1.GetDebugConfigRequest.port:type_name -> cc.arduino.cli.commands.v1.Port
9, // 3: cc.arduino.cli.commands.v1.GetDebugConfigResponse.toolchain_configuration:type_name -> google.protobuf.Any
9, // 4: cc.arduino.cli.commands.v1.GetDebugConfigResponse.server_configuration:type_name -> google.protobuf.Any
6, // 5: cc.arduino.cli.commands.v1.GetDebugConfigResponse.custom_configurations_json:type_name -> cc.arduino.cli.commands.v1.GetDebugConfigResponse.CustomConfigurationsJsonEntry
6, // 5: cc.arduino.cli.commands.v1.GetDebugConfigResponse.custom_configs:type_name -> cc.arduino.cli.commands.v1.GetDebugConfigResponse.CustomConfigsEntry
6, // [6:6] is the sub-list for method output_type
6, // [6:6] is the sub-list for method input_type
6, // [6:6] is the sub-list for extension type_name
......
......@@ -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