Commit c1db8cb6 authored by Cristian Maglie's avatar Cristian Maglie

Added `programmer` field in debug info output (#2391)

* Added `programmer` field to debug info response

* Added integration test
parent 5ed8d4bb
......@@ -197,6 +197,7 @@ func getDebugProperties(req *rpc.GetDebugConfigRequest, pme *packagemanager.Expl
ToolchainPrefix: debugProperties.Get("toolchain.prefix"),
ToolchainConfiguration: &toolchainConfiguration,
CortexDebugCustomJson: cortexDebugCustomJson,
Programmer: req.GetProgrammer(),
}, nil
}
......
......@@ -126,6 +126,7 @@ type debugInfoResult struct {
ServerConfig any `json:"server_configuration,omitempty"`
SvdFile string `json:"svd_file,omitempty"`
CortexDebugCustomConfig any `json:"cortex-debug_custom_configuration,omitempty"`
Programmer string `json:"programmer"`
}
type openOcdServerConfigResult struct {
......@@ -166,6 +167,7 @@ func newDebugInfoResult(info *rpc.GetDebugConfigResponse) *debugInfoResult {
ServerConfig: serverConfig,
SvdFile: info.SvdFile,
CortexDebugCustomConfig: cortexDebugCustomConfig,
Programmer: info.Programmer,
}
}
......
......@@ -147,7 +147,8 @@ func testAllDebugInformation(t *testing.T, env *integrationtest.Environment, cli
"thb setup",
"c"
]
}
},
"programmer": "atmel_ice"
}`)
}
......@@ -189,7 +190,8 @@ func testAllDebugInformation(t *testing.T, env *integrationtest.Environment, cli
"thb setup",
"c"
]
}
},
"programmer": "my_cold_ice"
}`)
{
......@@ -211,7 +213,8 @@ func testAllDebugInformation(t *testing.T, env *integrationtest.Environment, cli
"single-script"
]
},
"svd_file": "svd-file"
"svd_file": "svd-file",
"programmer": "atmel_ice"
}`)
}
......@@ -234,7 +237,8 @@ func testAllDebugInformation(t *testing.T, env *integrationtest.Environment, cli
"cold_ice_script"
]
},
"svd_file": "svd-file"
"svd_file": "svd-file",
"programmer": "my_cold_ice"
}`)
}
......
......@@ -300,6 +300,8 @@ type GetDebugConfigResponse struct {
CortexDebugCustomJson string `protobuf:"bytes,9,opt,name=cortex_debug_custom_json,json=cortexDebugCustomJson,proto3" json:"cortex_debug_custom_json,omitempty"`
// 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
Programmer string `protobuf:"bytes,11,opt,name=programmer,proto3" json:"programmer,omitempty"`
}
func (x *GetDebugConfigResponse) Reset() {
......@@ -404,6 +406,13 @@ func (x *GetDebugConfigResponse) GetSvdFile() string {
return ""
}
func (x *GetDebugConfigResponse) GetProgrammer() string {
if x != nil {
return x.Programmer
}
return ""
}
// Configurations specific for the 'gcc' toolchain
type DebugGCCToolchainConfiguration struct {
state protoimpl.MessageState
......@@ -556,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, 0xcd, 0x03, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x44, 0x65,
0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0xed, 0x03, 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,
......@@ -585,7 +594,9 @@ var file_cc_arduino_cli_commands_v1_debug_proto_rawDesc = []byte{
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, 0x22, 0x20, 0x0a, 0x1e, 0x44, 0x65, 0x62, 0x75, 0x67, 0x47,
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,
......
......@@ -96,6 +96,8 @@ message GetDebugConfigResponse {
string cortex_debug_custom_json = 9;
// the SVD file to use
string svd_file = 10;
// The programmer specified in the request
string programmer = 11;
}
// Configurations specific for the 'gcc' toolchain
......
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