Skip to content
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
12 changes: 11 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,12 +348,14 @@ func FlashGDB(pkgName string, ocdOutput bool, options *compileopts.Options) erro
switch gdbInterface {
case "msd", "command", "":
if len(config.Target.Emulator) != 0 {
// Assume QEMU as an emulator.
if config.Target.Emulator[0] == "mgba" {
gdbInterface = "mgba"
} else if config.Target.Emulator[0] == "simavr" {
gdbInterface = "simavr"
} else if strings.HasPrefix(config.Target.Emulator[0], "qemu-system-") {
gdbInterface = "qemu"
} else {
// Assume QEMU as an emulator.
gdbInterface = "qemu-user"
}
} else if openocdInterface != "" && config.Target.OpenOCDTarget != "" {
Expand Down Expand Up @@ -429,6 +431,14 @@ func FlashGDB(pkgName string, ocdOutput bool, options *compileopts.Options) erro
daemon = exec.Command(config.Target.Emulator[0], args...)
daemon.Stdout = os.Stdout
daemon.Stderr = os.Stderr
case "simavr":
gdbCommands = append(gdbCommands, "target remote :1234")

// Run in an emulator.
args := append(config.Target.Emulator[1:], "-g", result.Binary)
daemon = exec.Command(config.Target.Emulator[0], args...)
daemon.Stdout = os.Stdout
daemon.Stderr = os.Stderr
case "msd":
return errors.New("gdb is not supported for drag-and-drop programmable devices")
default:
Expand Down
3 changes: 2 additions & 1 deletion targets/avr.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
"extra-files": [
"src/internal/task/task_stack_avr.S",
"src/runtime/gc_avr.S"
]
],
"gdb": "avr-gdb"
}