Skip to content

Commit 0b17535

Browse files
committed
debugger: fixed test
1 parent d17d201 commit 0b17535

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

commands/debug/debug.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"io"
2222
"os"
2323
"path/filepath"
24+
"runtime"
2425
"time"
2526

2627
"github.com/arduino/arduino-cli/arduino/cores/packagemanager"
@@ -121,7 +122,11 @@ func getCommandLine(req *dbg.DebugConfigReq, pm *packagemanager.PackageManager)
121122
var gdbPath *paths.Path
122123
switch debugInfo.GetToolchain() {
123124
case "gcc":
124-
gdbPath = paths.New(debugInfo.ToolchainPath).Join(debugInfo.ToolchainPrefix + "gdb")
125+
gdbexecutable := debugInfo.ToolchainPrefix + "gdb"
126+
if runtime.GOOS == "windows" {
127+
gdbexecutable += ".exe"
128+
}
129+
gdbPath = paths.New(debugInfo.ToolchainPath).Join(gdbexecutable)
125130
default:
126131
return nil, errors.Errorf("unsupported toolchain '%s'", debugInfo.GetToolchain())
127132
}

commands/debug/testdata/custom_hardware/arduino-test/samd/platform.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ debug.toolchain.path={runtime.tools.arm-none-eabi-gcc-7-2017q4.path}/bin/
124124
debug.toolchain.prefix=arm-none-eabi-
125125
debug.server=openocd
126126
debug.server.openocd.path={runtime.tools.openocd-0.10.0-arduino7.path}/bin/openocd
127+
debug.server.openocd.path.windows={runtime.tools.openocd-0.10.0-arduino7.path}/bin/openocd.exe
127128
debug.server.openocd.scripts_dir={runtime.tools.openocd-0.10.0-arduino7.path}/share/openocd/scripts/
128129
debug.server.openocd.script={runtime.platform.path}/variants/{build.variant}/{build.openocdscript}
129130

0 commit comments

Comments
 (0)