Skip to content

Commit c1db8cb

Browse files
committed
Added programmer field in debug info output (#2391)
* Added `programmer` field to debug info response * Added integration test
1 parent 5ed8d4b commit c1db8cb

File tree

5 files changed

+26
-6
lines changed

5 files changed

+26
-6
lines changed

Diff for: commands/debug/debug_info.go

+1
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ func getDebugProperties(req *rpc.GetDebugConfigRequest, pme *packagemanager.Expl
197197
ToolchainPrefix: debugProperties.Get("toolchain.prefix"),
198198
ToolchainConfiguration: &toolchainConfiguration,
199199
CortexDebugCustomJson: cortexDebugCustomJson,
200+
Programmer: req.GetProgrammer(),
200201
}, nil
201202
}
202203

Diff for: internal/cli/debug/debug.go

+2
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ type debugInfoResult struct {
126126
ServerConfig any `json:"server_configuration,omitempty"`
127127
SvdFile string `json:"svd_file,omitempty"`
128128
CortexDebugCustomConfig any `json:"cortex-debug_custom_configuration,omitempty"`
129+
Programmer string `json:"programmer"`
129130
}
130131

131132
type openOcdServerConfigResult struct {
@@ -166,6 +167,7 @@ func newDebugInfoResult(info *rpc.GetDebugConfigResponse) *debugInfoResult {
166167
ServerConfig: serverConfig,
167168
SvdFile: info.SvdFile,
168169
CortexDebugCustomConfig: cortexDebugCustomConfig,
170+
Programmer: info.Programmer,
169171
}
170172
}
171173

Diff for: internal/integrationtest/debug/debug_test.go

+8-4
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@ func testAllDebugInformation(t *testing.T, env *integrationtest.Environment, cli
147147
"thb setup",
148148
"c"
149149
]
150-
}
150+
},
151+
"programmer": "atmel_ice"
151152
}`)
152153
}
153154

@@ -189,7 +190,8 @@ func testAllDebugInformation(t *testing.T, env *integrationtest.Environment, cli
189190
"thb setup",
190191
"c"
191192
]
192-
}
193+
},
194+
"programmer": "my_cold_ice"
193195
}`)
194196

195197
{
@@ -211,7 +213,8 @@ func testAllDebugInformation(t *testing.T, env *integrationtest.Environment, cli
211213
"single-script"
212214
]
213215
},
214-
"svd_file": "svd-file"
216+
"svd_file": "svd-file",
217+
"programmer": "atmel_ice"
215218
}`)
216219
}
217220

@@ -234,7 +237,8 @@ func testAllDebugInformation(t *testing.T, env *integrationtest.Environment, cli
234237
"cold_ice_script"
235238
]
236239
},
237-
"svd_file": "svd-file"
240+
"svd_file": "svd-file",
241+
"programmer": "my_cold_ice"
238242
}`)
239243
}
240244

Diff for: rpc/cc/arduino/cli/commands/v1/debug.pb.go

+13-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: rpc/cc/arduino/cli/commands/v1/debug.proto

+2
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ message GetDebugConfigResponse {
9696
string cortex_debug_custom_json = 9;
9797
// the SVD file to use
9898
string svd_file = 10;
99+
// The programmer specified in the request
100+
string programmer = 11;
99101
}
100102

101103
// Configurations specific for the 'gcc' toolchain

0 commit comments

Comments
 (0)