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.
Этот коммит содержится в:
Ayke van Laethem 2019-10-29 11:44:30 +01:00 коммит произвёл Ron Evans
родитель a4642ddf59
коммит 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()