aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2023-02-18 20:13:28 +0100
committerRon Evans <[email protected]>2023-02-19 01:35:10 +0100
commitcacb452aa6c8f4690ca41cce8ec19e6a5db350f4 (patch)
tree8bf06c9c6e7c7d0b55238f2550132b0347d1133d
parent9296332151a9513ff5ce7846d6f57259e7de15b6 (diff)
downloadtinygo-cacb452aa6c8f4690ca41cce8ec19e6a5db350f4.tar.gz
tinygo-cacb452aa6c8f4690ca41cce8ec19e6a5db350f4.zip
main: support qemu-user debugging
Running binaries in QEMU (when debugging on Linux for example) did not work correctly as qemu-user expects the `-g` flag to be first on the command line before the program name. Putting it after will make it a command line parameter for the emulated program, which is not what we want. I don't think this ever worked correctly.
-rw-r--r--main.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/main.go b/main.go
index 44eacb2cf..3bfea182a 100644
--- a/main.go
+++ b/main.go
@@ -644,7 +644,7 @@ func Debug(debugger, pkgName string, ocdOutput bool, options *compileopts.Option
case "qemu-user":
port = ":1234"
// Run in an emulator.
- args := append(emulator[1:], "-g", "1234")
+ args := append([]string{"-g", "1234"}, emulator[1:]...)
daemon = executeCommand(config.Options, emulator[0], args...)
daemon.Stdout = os.Stdout
daemon.Stderr = os.Stderr