mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-03 10:37:46 +00:00
main: halt GDB on start
Most programmers support the "reset halt" command, which resets the target but keeps it halted at the first instruction. This is a much more natural way of working with GDB, and allows setting breakpoints before the program is started. This commit switches to `reset halt` by default and also stops running the program directly when debugging natively on the host.
This commit is contained in:
committed by
Ron Evans
parent
a4642ddf59
commit
373fa6d69b
@@ -530,9 +530,8 @@ func FlashGDB(pkgName, target, port string, ocdOutput bool, config *BuildConfig)
|
||||
switch gdbInterface {
|
||||
case "native":
|
||||
// Run GDB directly.
|
||||
gdbCommands = append(gdbCommands, "run")
|
||||
case "openocd":
|
||||
gdbCommands = append(gdbCommands, "target remote :3333", "monitor halt", "load", "monitor reset", "c")
|
||||
gdbCommands = append(gdbCommands, "target remote :3333", "monitor halt", "load", "monitor reset halt")
|
||||
|
||||
// We need a separate debugging daemon for on-chip debugging.
|
||||
args, err := spec.OpenOCDConfiguration()
|
||||
|
||||
Reference in New Issue
Block a user