Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Add interpreter resolution in debug test
  • Loading branch information
rsora committed Mar 19, 2020
commit 8ee69b47eb0dc49d9b58533da5c24a5ee5e81742
13 changes: 6 additions & 7 deletions commands/debug/debug_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,10 @@ func TestGetCommandLine(t *testing.T) {
Instance: &rpc.Instance{Id: 1},
Fqbn: "arduino-test:samd:arduino_zero_edbg",
SketchPath: sketchPath.String(),
Port: "none",
}

goldCommand := fmt.Sprintf("%s/arduino-test/tools/arm-none-eabi-gcc/7-2017q4/bin//arm-none-eabi-gdb%s", dataDir, toolExtension) +
" -ex target extended-remote |" +
" --interpreter=console -ex target extended-remote |" +
fmt.Sprintf(" %s/arduino-test/tools/openocd/0.10.0-arduino7/bin/openocd%s", dataDir, toolExtension) +
fmt.Sprintf(" -s \"%s/arduino-test/tools/openocd/0.10.0-arduino7/share/openocd/scripts/\"", dataDir) +
fmt.Sprintf(" --file \"%s/arduino-test/samd/variants/arduino_zero/openocd_scripts/arduino_zero.cfg\"", customHardware) +
Expand All @@ -67,14 +66,14 @@ func TestGetCommandLine(t *testing.T) {
// Other samd boards such as mkr1000 can be debugged using an external tool such as Atmel ICE connected to
// the board debug port
req2 := &dbg.DebugConfigReq{
Instance: &rpc.Instance{Id: 1},
Fqbn: "arduino-test:samd:mkr1000",
SketchPath: sketchPath.String(),
Port: "none",
Instance: &rpc.Instance{Id: 1},
Fqbn: "arduino-test:samd:mkr1000",
SketchPath: sketchPath.String(),
Interpreter: "mi1",
}

goldCommand2 := fmt.Sprintf("%s/arduino-test/tools/arm-none-eabi-gcc/7-2017q4/bin//arm-none-eabi-gdb%s", dataDir, toolExtension) +
" -ex target extended-remote |" +
" --interpreter=mi1 -ex target extended-remote |" +
fmt.Sprintf(" %s/arduino-test/tools/openocd/0.10.0-arduino7/bin/openocd%s", dataDir, toolExtension) +
fmt.Sprintf(" -s \"%s/arduino-test/tools/openocd/0.10.0-arduino7/share/openocd/scripts/\"", dataDir) +
fmt.Sprintf(" --file \"%s/arduino-test/samd/variants/mkr1000/openocd_scripts/arduino_zero.cfg\"", customHardware) +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,4 +228,4 @@ tools.gdb.path={runtime.tools.arm-none-eabi-gcc-7-2017q4.path}/bin/
tools.gdb.cmd=arm-none-eabi-gdb
tools.gdb.cmd.windows=arm-none-eabi-gdb.exe

tools.gdb.debug.pattern="{path}/{cmd}" -ex 'target extended-remote | {tools.openocd.path}/{tools.openocd.cmd} -s "{tools.openocd.path}/share/openocd/scripts/" --file "{runtime.platform.path}/variants/{build.variant}/{build.openocdscript}" -c "gdb_port pipe" -c "telnet_port 0" -c init -c halt' {build.path}/{build.project_name}.elf
tools.gdb.debug.pattern="{path}/{cmd}" --interpreter={interpreter} -ex 'target extended-remote | {tools.openocd.path}/{tools.openocd.cmd} -s "{tools.openocd.path}/share/openocd/scripts/" --file "{runtime.platform.path}/variants/{build.variant}/{build.openocdscript}" -c "gdb_port pipe" -c "telnet_port 0" -c init -c halt' {build.path}/{build.project_name}.elf