From 28a2ad47575f74159cd4baf662d6c2849e1af78d Mon Sep 17 00:00:00 2001 From: Yurii Soldak Date: Wed, 19 May 2021 23:06:59 +0200 Subject: [PATCH] gdb: use "extended-remote" instead of "remote", allows connect from another client My gdb complains bare "remote" command is deprecated On top of that "extended-remote" allows "disconnect" command that enables attaching from another debug client, like an IDE See https://sourceware.org/gdb/current/onlinedocs/gdb/Connecting.html --- main.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/main.go b/main.go index c3cca64f..992affa5 100644 --- a/main.go +++ b/main.go @@ -434,7 +434,7 @@ func FlashGDB(pkgName string, ocdOutput bool, options *compileopts.Options) erro case "native": // Run GDB directly. case "openocd": - gdbCommands = append(gdbCommands, "target remote :3333", "monitor halt", "load", "monitor reset halt") + gdbCommands = append(gdbCommands, "target extended-remote :3333", "monitor halt", "load", "monitor reset halt") // We need a separate debugging daemon for on-chip debugging. args, err := config.OpenOCDConfiguration() @@ -453,7 +453,7 @@ func FlashGDB(pkgName string, ocdOutput bool, options *compileopts.Options) erro daemon.Stderr = w } case "jlink": - gdbCommands = append(gdbCommands, "target remote :2331", "load", "monitor reset halt") + gdbCommands = append(gdbCommands, "target extended-remote :2331", "load", "monitor reset halt") // We need a separate debugging daemon for on-chip debugging. daemon = executeCommand(config.Options, "JLinkGDBServer", "-device", config.Target.JLinkDevice) @@ -468,7 +468,7 @@ func FlashGDB(pkgName string, ocdOutput bool, options *compileopts.Options) erro daemon.Stderr = w } case "qemu": - gdbCommands = append(gdbCommands, "target remote :1234") + gdbCommands = append(gdbCommands, "target extended-remote :1234") // Run in an emulator. args := append(config.Target.Emulator[1:], result.Binary, "-s", "-S") @@ -476,7 +476,7 @@ func FlashGDB(pkgName string, ocdOutput bool, options *compileopts.Options) erro daemon.Stdout = os.Stdout daemon.Stderr = os.Stderr case "qemu-user": - gdbCommands = append(gdbCommands, "target remote :1234") + gdbCommands = append(gdbCommands, "target extended-remote :1234") // Run in an emulator. args := append(config.Target.Emulator[1:], "-g", "1234", result.Binary) @@ -484,7 +484,7 @@ func FlashGDB(pkgName string, ocdOutput bool, options *compileopts.Options) erro daemon.Stdout = os.Stdout daemon.Stderr = os.Stderr case "mgba": - gdbCommands = append(gdbCommands, "target remote :2345") + gdbCommands = append(gdbCommands, "target extended-remote :2345") // Run in an emulator. args := append(config.Target.Emulator[1:], result.Binary, "-g") @@ -492,7 +492,7 @@ func FlashGDB(pkgName string, ocdOutput bool, options *compileopts.Options) erro daemon.Stdout = os.Stdout daemon.Stderr = os.Stderr case "simavr": - gdbCommands = append(gdbCommands, "target remote :1234") + gdbCommands = append(gdbCommands, "target extended-remote :1234") // Run in an emulator. args := append(config.Target.Emulator[1:], "-g", result.Binary)