Skip to content

Commit e5685ae

Browse files
committed
Added svd-file debug option
1 parent ae120e9 commit e5685ae

File tree

6 files changed

+37
-17
lines changed

6 files changed

+37
-17
lines changed

Diff for: commands/debug/debug_info.go

+1
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ func getDebugProperties(req *rpc.GetDebugConfigRequest, pme *packagemanager.Expl
191191
Server: server,
192192
ServerPath: debugProperties.Get("server." + server + ".path"),
193193
ServerConfiguration: &serverConfiguration,
194+
SvdFile: debugProperties.Get("svd_file"),
194195
Toolchain: toolchain,
195196
ToolchainPath: debugProperties.Get("toolchain.path"),
196197
ToolchainPrefix: debugProperties.Get("toolchain.prefix"),

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

+5
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ type debugInfoResult struct {
124124
Server string `json:"server,omitempty"`
125125
ServerPath string `json:"server_path,omitempty"`
126126
ServerConfig any `json:"server_configuration,omitempty"`
127+
SvdFile string `json:"svd_file,omitempty"`
127128
CortexDebugCustomConfig any `json:"cortex-debug_custom_configuration,omitempty"`
128129
}
129130

@@ -163,6 +164,7 @@ func newDebugInfoResult(info *rpc.GetDebugConfigResponse) *debugInfoResult {
163164
Server: info.Server,
164165
ServerPath: info.ServerPath,
165166
ServerConfig: serverConfig,
167+
SvdFile: info.SvdFile,
166168
CortexDebugCustomConfig: cortexDebugCustomConfig,
167169
}
168170
}
@@ -179,6 +181,9 @@ func (r *debugInfoResult) String() string {
179181
t.AddRow(tr("Toolchain type"), table.NewCell(r.Toolchain, green))
180182
t.AddRow(tr("Toolchain path"), table.NewCell(r.ToolchainPath, dimGreen))
181183
t.AddRow(tr("Toolchain prefix"), table.NewCell(r.ToolchainPrefix, dimGreen))
184+
if r.SvdFile != "" {
185+
t.AddRow(tr("SVD file path"), table.NewCell(r.SvdFile, dimGreen))
186+
}
182187
switch r.Toolchain {
183188
case "gcc":
184189
// no options available at the moment...

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

+1
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ func testAllDebugInformation(t *testing.T, env *integrationtest.Environment, cli
130130
"third"
131131
]
132132
},
133+
"svd_file": "svd-file",
133134
"cortex-debug_custom_configuration": {
134135
"anotherStringParamer": "hellooo",
135136
"overrideRestartCommands": [

Diff for: internal/integrationtest/debug/testdata/hardware/my/samd/boards.txt

+1
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,4 @@ my.debug.cortex-debug.custom.overrideRestartCommands.1=monitor gdb_sync
4343
my.debug.cortex-debug.custom.overrideRestartCommands.2=thb setup
4444
my.debug.cortex-debug.custom.overrideRestartCommands.3=c
4545
my.debug.cortex-debug.custom.anotherStringParamer=hellooo
46+
my.debug.svd_file=svd-file

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

+27-17
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
@@ -94,6 +94,8 @@ message GetDebugConfigResponse {
9494
// cortex-debug custom JSON configuration, it is provided as is from
9595
// the platform developers.
9696
string cortex_debug_custom_json = 9;
97+
// the SVD file to use
98+
string svd_file = 10;
9799
}
98100

99101
// Configurations specific for the 'gcc' toolchain

0 commit comments

Comments
 (0)