main: support gdb debugging with AVR

Be able to run `tinygo gdb -target=arduino examples/serial` and debug a
program with the power of a real debugger.

Note that this only works on LLVM 11 because older versions have a bug
in the AVR backend that cause it to produce invalid debug information:
https://reviews.llvm.org/D74213.
This commit is contained in:
Ayke van Laethem
2020-04-14 23:10:31 +02:00
parent f7f2082979
commit 43d7f48de4
2 changed files with 16 additions and 2 deletions
+5 -1
View File
@@ -6,11 +6,15 @@
"gc": "conservative",
"linker": "avr-gcc",
"scheduler": "none",
"cflags": [
"-gdwarf-4"
],
"ldflags": [
"-T", "targets/avr.ld",
"-Wl,--gc-sections"
],
"extra-files": [
"src/runtime/scheduler_avr.S"
]
],
"gdb": "avr-gdb"
}