Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a compatibility trick in debug -I for toolchain.prefix key #2428

Merged
merged 2 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion commands/debug/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func getCommandLine(req *rpc.GetDebugConfigRequest, pme *packagemanager.Explorer
var gdbPath *paths.Path
switch debugInfo.GetToolchain() {
case "gcc":
gdbexecutable := debugInfo.GetToolchainPrefix() + "gdb"
gdbexecutable := debugInfo.GetToolchainPrefix() + "-gdb"
if runtime.GOOS == "windows" {
gdbexecutable += ".exe"
}
Expand Down
9 changes: 8 additions & 1 deletion commands/debug/debug_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,13 @@ func getDebugProperties(req *rpc.GetDebugConfigRequest, pme *packagemanager.Expl
}
}

// HOTFIX: for samd (and maybe some other platforms). We should keep this for a reasonable
// amount of time to allow seamless platforms update.
toolchainPrefix := debugProperties.Get("toolchain.prefix")
if toolchainPrefix == "arm-none-eabi-" {
toolchainPrefix = "arm-none-eabi"
}

customConfigs := map[string]string{}
if cortexDebugProps := debugProperties.SubTree("cortex-debug.custom"); cortexDebugProps.Size() > 0 {
customConfigs["cortex-debug"] = convertToJsonMap(cortexDebugProps)
Expand All @@ -181,7 +188,7 @@ func getDebugProperties(req *rpc.GetDebugConfigRequest, pme *packagemanager.Expl
SvdFile: debugProperties.Get("svd_file"),
Toolchain: toolchain,
ToolchainPath: debugProperties.Get("toolchain.path"),
ToolchainPrefix: debugProperties.Get("toolchain.prefix"),
ToolchainPrefix: toolchainPrefix,
ToolchainConfiguration: &toolchainConfiguration,
CustomConfigs: customConfigs,
Programmer: req.GetProgrammer(),
Expand Down
4 changes: 2 additions & 2 deletions docs/UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ The string field `server_configuration.script` is now an array and has been rena
"executable": "/tmp/arduino/sketches/002050EAA7EFB9A4FC451CDFBC0FA2D3/Blink.ino.elf",
"toolchain": "gcc",
"toolchain_path": "/home/user/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/",
"toolchain_prefix": "arm-none-eabi-",
"toolchain_prefix": "arm-none-eabi",
"server": "openocd",
"server_path": "/home/user/.arduino15/packages/arduino/tools/openocd/0.10.0-arduino7/bin/openocd",
"server_configuration": {
Expand Down Expand Up @@ -2514,7 +2514,7 @@ Now:
debug.executable={build.path}/{build.project_name}.elf
debug.toolchain=gcc
debug.toolchain.path={runtime.tools.arm-none-eabi-gcc-7-2017q4.path}/bin/
debug.toolchain.prefix=arm-none-eabi-
debug.toolchain.prefix=arm-none-eabi
debug.server=openocd
debug.server.openocd.path={runtime.tools.openocd-0.10.0-arduino7.path}/bin/
debug.server.openocd.scripts_dir={runtime.tools.openocd-0.10.0-arduino7.path}/share/openocd/scripts/
Expand Down
2 changes: 1 addition & 1 deletion rpc/cc/arduino/cli/commands/v1/debug.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion rpc/cc/arduino/cli/commands/v1/debug.proto
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ message GetDebugConfigResponse {
string toolchain = 2;
// The toolchain directory
string toolchain_path = 3;
// The toolchain architecture prefix (for example "arm-none-eabi-")
// The toolchain architecture prefix (for example "arm-none-eabi")
string toolchain_prefix = 4;
// The GDB server type used to connect to the programmer/board (for example
// "openocd")
Expand Down
Loading