diff --git a/commands/debug/debug_info.go b/commands/debug/debug_info.go index 997145d491d..10e0e604c37 100644 --- a/commands/debug/debug_info.go +++ b/commands/debug/debug_info.go @@ -184,22 +184,22 @@ func getDebugProperties(req *rpc.GetDebugConfigRequest, pme *packagemanager.Expl } } - cortexDebugCustomJson := "" + cortexDebugCustomJson := map[string]string{} if cortexDebugProps := debugProperties.SubTree("cortex-debug.custom"); cortexDebugProps.Size() > 0 { - cortexDebugCustomJson = convertToJsonMap(cortexDebugProps) + cortexDebugCustomJson["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, - CortexDebugCustomJson: 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, + CustomConfigurationsJson: cortexDebugCustomJson, + Programmer: req.GetProgrammer(), }, nil } diff --git a/internal/cli/debug/debug.go b/internal/cli/debug/debug.go index 756b662cb2e..b5f86b0d84e 100644 --- a/internal/cli/debug/debug.go +++ b/internal/cli/debug/debug.go @@ -116,17 +116,17 @@ func runDebugCommand(command *cobra.Command, args []string) { } type debugInfoResult struct { - Executable string `json:"executable,omitempty"` - Toolchain string `json:"toolchain,omitempty"` - ToolchainPath string `json:"toolchain_path,omitempty"` - ToolchainPrefix string `json:"toolchain_prefix,omitempty"` - ToolchainConfig any `json:"toolchain_configuration,omitempty"` - Server string `json:"server,omitempty"` - ServerPath string `json:"server_path,omitempty"` - ServerConfig any `json:"server_configuration,omitempty"` - SvdFile string `json:"svd_file,omitempty"` - CortexDebugCustomConfig any `json:"cortex-debug_custom_configuration,omitempty"` - Programmer string `json:"programmer"` + Executable string `json:"executable,omitempty"` + Toolchain string `json:"toolchain,omitempty"` + ToolchainPath string `json:"toolchain_path,omitempty"` + ToolchainPrefix string `json:"toolchain_prefix,omitempty"` + ToolchainConfig any `json:"toolchain_configuration,omitempty"` + Server string `json:"server,omitempty"` + ServerPath string `json:"server_path,omitempty"` + ServerConfig any `json:"server_configuration,omitempty"` + SvdFile string `json:"svd_file,omitempty"` + CustomConfigs map[string]any `json:"custom_configs,omitempty"` + Programmer string `json:"programmer"` } type openOcdServerConfigResult struct { @@ -150,24 +150,25 @@ func newDebugInfoResult(info *rpc.GetDebugConfigResponse) *debugInfoResult { Scripts: openocdConf.Scripts, } } - var cortexDebugCustomConfig any - if info.CortexDebugCustomJson != "" { - if err := json.Unmarshal([]byte(info.CortexDebugCustomJson), &cortexDebugCustomConfig); err != nil { - feedback.Fatal(tr("Error during Debug: %v", err), feedback.ErrGeneric) + customConfigs := map[string]any{} + for id, configJson := range info.GetCustomConfigurationsJson() { + var config any + if err := json.Unmarshal([]byte(configJson), &config); err == nil { + customConfigs[id] = config } } return &debugInfoResult{ - Executable: info.Executable, - Toolchain: info.Toolchain, - ToolchainPath: info.ToolchainPath, - ToolchainPrefix: info.ToolchainPrefix, - ToolchainConfig: toolchainConfig, - Server: info.Server, - ServerPath: info.ServerPath, - ServerConfig: serverConfig, - SvdFile: info.SvdFile, - CortexDebugCustomConfig: cortexDebugCustomConfig, - Programmer: info.Programmer, + Executable: info.Executable, + Toolchain: info.Toolchain, + ToolchainPath: info.ToolchainPath, + ToolchainPrefix: info.ToolchainPrefix, + ToolchainConfig: toolchainConfig, + Server: info.Server, + ServerPath: info.ServerPath, + ServerConfig: serverConfig, + SvdFile: info.SvdFile, + CustomConfigs: customConfigs, + Programmer: info.Programmer, } } @@ -209,10 +210,12 @@ func (r *debugInfoResult) String() string { } default: } - if r.CortexDebugCustomConfig != nil { - t.AddRow(tr("Custom configuration for cortex-debug IDE plugin:")) - data, _ := json.MarshalIndent(r.CortexDebugCustomConfig, " ", " ") - return t.Render() + " " + string(data) + if custom := r.CustomConfigs; custom != nil { + for id, config := range custom { + configJson, _ := json.MarshalIndent(config, "", " ") + t.AddRow(tr("Custom configuration for %s:", id)) + return t.Render() + " " + string(configJson) + } } return t.Render() } diff --git a/internal/integrationtest/debug/debug_test.go b/internal/integrationtest/debug/debug_test.go index 8c547ba04fa..8d3d972af8f 100644 --- a/internal/integrationtest/debug/debug_test.go +++ b/internal/integrationtest/debug/debug_test.go @@ -132,34 +132,36 @@ func testAllDebugInformation(t *testing.T, env *integrationtest.Environment, cli ] }, "svd_file": "svd-file", - "cortex-debug_custom_configuration": { - "aBoolean": true, - "aStringBoolean": "true", - "aStringNumber": "10", - "aNumber": 10, - "anotherNumber": 10.2, - "anObject": { - "boolean": true, - "key": "value" - }, - "anotherObject": { - "boolean": true, - "key": "value" + "custom_configs": { + "cortex-debug": { + "aBoolean": true, + "aStringBoolean": "true", + "aStringNumber": "10", + "aNumber": 10, + "anotherNumber": 10.2, + "anObject": { + "boolean": true, + "key": "value" + }, + "anotherObject": { + "boolean": true, + "key": "value" + }, + "anotherStringParamer": "hellooo", + "overrideRestartCommands": [ + "monitor reset halt", + "monitor gdb_sync", + "thb setup", + "c" + ], + "postAttachCommands": [ + "set remote hardware-watchpoint-limit 2", + "monitor reset halt", + "monitor gdb_sync", + "thb setup", + "c" + ] }, - "anotherStringParamer": "hellooo", - "overrideRestartCommands": [ - "monitor reset halt", - "monitor gdb_sync", - "thb setup", - "c" - ], - "postAttachCommands": [ - "set remote hardware-watchpoint-limit 2", - "monitor reset halt", - "monitor gdb_sync", - "thb setup", - "c" - ] }, "programmer": "atmel_ice" }`) @@ -188,34 +190,36 @@ func testAllDebugInformation(t *testing.T, env *integrationtest.Environment, cli ] }, "svd_file": "svd-file", - "cortex-debug_custom_configuration": { - "aBoolean": true, - "aStringBoolean": "true", - "aStringNumber": "10", - "aNumber": 10, - "anotherNumber": 10.2, - "anObject": { - "boolean": true, - "key": "value" - }, - "anotherObject": { - "boolean": true, - "key": "value" + "custom_configs": { + "cortex-debug": { + "aBoolean": true, + "aStringBoolean": "true", + "aStringNumber": "10", + "aNumber": 10, + "anotherNumber": 10.2, + "anObject": { + "boolean": true, + "key": "value" + }, + "anotherObject": { + "boolean": true, + "key": "value" + }, + "anotherStringParamer": "hellooo", + "overrideRestartCommands": [ + "monitor reset halt", + "monitor gdb_sync", + "thb setup", + "c" + ], + "postAttachCommands": [ + "set remote hardware-watchpoint-limit 2", + "monitor reset halt", + "monitor gdb_sync", + "thb setup", + "c" + ] }, - "anotherStringParamer": "hellooo", - "overrideRestartCommands": [ - "monitor reset halt", - "monitor gdb_sync", - "thb setup", - "c" - ], - "postAttachCommands": [ - "set remote hardware-watchpoint-limit 2", - "monitor reset halt", - "monitor gdb_sync", - "thb setup", - "c" - ] }, "programmer": "my_cold_ice" }`) diff --git a/rpc/cc/arduino/cli/commands/v1/debug.pb.go b/rpc/cc/arduino/cli/commands/v1/debug.pb.go index ff514779bf5..b06bf0c1ad1 100644 --- a/rpc/cc/arduino/cli/commands/v1/debug.pb.go +++ b/rpc/cc/arduino/cli/commands/v1/debug.pb.go @@ -295,9 +295,9 @@ type GetDebugConfigResponse struct { ToolchainConfiguration *anypb.Any `protobuf:"bytes,7,opt,name=toolchain_configuration,json=toolchainConfiguration,proto3" json:"toolchain_configuration,omitempty"` // Extra configuration parameters wrt GDB server ServerConfiguration *anypb.Any `protobuf:"bytes,8,opt,name=server_configuration,json=serverConfiguration,proto3" json:"server_configuration,omitempty"` - // cortex-debug custom JSON configuration, it is provided as is from - // the platform developers. - CortexDebugCustomJson string `protobuf:"bytes,9,opt,name=cortex_debug_custom_json,json=cortexDebugCustomJson,proto3" json:"cortex_debug_custom_json,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"` // 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,11 +392,11 @@ func (x *GetDebugConfigResponse) GetServerConfiguration() *anypb.Any { return nil } -func (x *GetDebugConfigResponse) GetCortexDebugCustomJson() string { +func (x *GetDebugConfigResponse) GetCustomConfigurationsJson() map[string]string { if x != nil { - return x.CortexDebugCustomJson + return x.CustomConfigurationsJson } - return "" + return nil } func (x *GetDebugConfigResponse) GetSvdFile() string { @@ -565,7 +565,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, 0xed, 0x03, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x44, 0x65, + 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x92, 0x05, 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,28 +589,39 @@ 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, 0x37, 0x0a, 0x18, 0x63, 0x6f, 0x72, 0x74, 0x65, 0x78, 0x5f, 0x64, 0x65, 0x62, - 0x75, 0x67, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x18, 0x09, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x15, 0x63, 0x6f, 0x72, 0x74, 0x65, 0x78, 0x44, 0x65, 0x62, 0x75, - 0x67, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 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, 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, 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, } var ( @@ -625,7 +636,7 @@ func file_cc_arduino_cli_commands_v1_debug_proto_rawDescGZIP() []byte { return file_cc_arduino_cli_commands_v1_debug_proto_rawDescData } -var file_cc_arduino_cli_commands_v1_debug_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_cc_arduino_cli_commands_v1_debug_proto_msgTypes = make([]protoimpl.MessageInfo, 7) var file_cc_arduino_cli_commands_v1_debug_proto_goTypes = []interface{}{ (*DebugRequest)(nil), // 0: cc.arduino.cli.commands.v1.DebugRequest (*GetDebugConfigRequest)(nil), // 1: cc.arduino.cli.commands.v1.GetDebugConfigRequest @@ -633,21 +644,23 @@ 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 - (*Instance)(nil), // 6: cc.arduino.cli.commands.v1.Instance - (*Port)(nil), // 7: cc.arduino.cli.commands.v1.Port - (*anypb.Any)(nil), // 8: google.protobuf.Any + nil, // 6: cc.arduino.cli.commands.v1.GetDebugConfigResponse.CustomConfigurationsJsonEntry + (*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 } var file_cc_arduino_cli_commands_v1_debug_proto_depIdxs = []int32{ 1, // 0: cc.arduino.cli.commands.v1.DebugRequest.debug_request:type_name -> cc.arduino.cli.commands.v1.GetDebugConfigRequest - 6, // 1: cc.arduino.cli.commands.v1.GetDebugConfigRequest.instance:type_name -> cc.arduino.cli.commands.v1.Instance - 7, // 2: cc.arduino.cli.commands.v1.GetDebugConfigRequest.port:type_name -> cc.arduino.cli.commands.v1.Port - 8, // 3: cc.arduino.cli.commands.v1.GetDebugConfigResponse.toolchain_configuration:type_name -> google.protobuf.Any - 8, // 4: cc.arduino.cli.commands.v1.GetDebugConfigResponse.server_configuration:type_name -> google.protobuf.Any - 5, // [5:5] is the sub-list for method output_type - 5, // [5:5] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name + 7, // 1: cc.arduino.cli.commands.v1.GetDebugConfigRequest.instance:type_name -> cc.arduino.cli.commands.v1.Instance + 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, // [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 + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name } func init() { file_cc_arduino_cli_commands_v1_debug_proto_init() } @@ -737,7 +750,7 @@ func file_cc_arduino_cli_commands_v1_debug_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cc_arduino_cli_commands_v1_debug_proto_rawDesc, NumEnums: 0, - NumMessages: 6, + NumMessages: 7, NumExtensions: 0, NumServices: 0, }, diff --git a/rpc/cc/arduino/cli/commands/v1/debug.proto b/rpc/cc/arduino/cli/commands/v1/debug.proto index 944250cfd65..3ee564b83e4 100644 --- a/rpc/cc/arduino/cli/commands/v1/debug.proto +++ b/rpc/cc/arduino/cli/commands/v1/debug.proto @@ -91,9 +91,9 @@ message GetDebugConfigResponse { google.protobuf.Any toolchain_configuration = 7; // Extra configuration parameters wrt GDB server google.protobuf.Any server_configuration = 8; - // cortex-debug custom JSON configuration, it is provided as is from - // the platform developers. - string cortex_debug_custom_json = 9; + // Custom debugger configurations (not handled directly by Arduino CLI but + // provided for 3rd party plugins/debuggers) + map custom_configurations_json = 9; // the SVD file to use string svd_file = 10; // The programmer specified in the request