tinygo/testdata
Ayke van Laethem ae381e74a5 main: print source location when a panic happens in -monitor
The previous commit started printing the instruction address for runtime
panics. This commit starts using this address to print the source
location.

Here is an example where this feature is very useful. There is a heap
allocation in the Bluetooth package, but we don't know where exactly.
Printing the instruction address of the panic is already useful, but
what is even more useful is looking up this address in the DWARF debug
information that's part of the binary:

    $ tinygo flash -target=circuitplay-bluefruit -monitor ./examples/heartrate
    Connected to /dev/ttyACM0. Press Ctrl-C to exit.
    tick 00:00.810
    tick 00:01.587
    tick 00:02.387
    tick 00:03.244
    panic: runtime error at 0x00027c4d: alloc in interrupt
    [tinygo: panic at /home/ayke/src/tinygo/bluetooth/adapter_sd.go:74:4]

To be clear, this path isn't stored on the microcontroller. It's stored
as part of the build, and `-monitor` just looks up the path from the
panic message.

Possible enhancements:

  - Print such an address for regular panics as well. I'm not sure
    that's so useful, as it's usually a lot easier to look up panics
    just by their message.
  - Use runtimePanicAt (instead of runtimePanic) in other locations, if
    that proves to be beneficial.
  - Print the TinyGo-generated output in some other color, to
    distinguish it from the regular console output.
  - Print more details when panicking (registers, stack values), and
    print an actual backtrace.
2023-04-26 18:40:35 +02:00
..
cgo
embed
generics
alias.go
alias.txt
atomic.go compiler: really define runtime/volatile.* functions 2022-06-24 11:10:24 +02:00
atomic.txt compiler: really define runtime/volatile.* functions 2022-06-24 11:10:24 +02:00
binop.go
binop.txt
calls.go
calls.txt
channel.go feat: fix typos 2023-03-24 09:22:38 -07:00
channel.txt feat: fix typos 2023-03-24 09:22:38 -07:00
corpus.yaml
env.go
env.txt
filesystem.go
filesystem.txt
float.go
float.txt compiler: test float to int conversions and fix upper-bound calculation 2021-01-19 14:02:32 +01:00
gc.go
gc.txt
generics.go
generics.txt
goroutines.go internal/task: remove coroutines 2022-01-19 14:42:02 -05:00
goroutines.txt
init.go
init.txt
init_multi.go
init_multi.txt
interface.go compiler: correctly generate code for local named types 2023-03-21 22:22:03 +01:00
interface.txt
json.go
json.txt
ldflags.go main: implement -ldflags="-X ..." 2021-04-09 18:33:48 +02:00
ldflags.txt
map.go
map.txt
math.go runtime: add support for math package 2019-02-05 19:37:21 +01:00
math.txt
print.go
print.txt
rand.go
rand.txt
recover.go
recover.txt
reflect.go
reflect.txt compiler,reflect: fix pkgpath for struct fields 2023-03-15 21:53:57 +01:00
slice.go compiler: support all kinds of recursive types 2023-03-18 17:53:47 +01:00
slice.txt compiler: support all kinds of recursive types 2023-03-18 17:53:47 +01:00
sort.go
sort.txt implement reflect.Swapper 2020-10-23 21:37:35 +02:00
stdlib.go
stdlib.txt
string.go compiler: fix named string to []byte slice conversion 2020-07-29 12:13:37 +02:00
string.txt compiler,runtime: implement []rune to string conversion 2019-08-11 15:45:35 +02:00
structs.go compiler: support recursive types 2019-10-13 23:07:47 +02:00
structs.txt compiler: support recursive types 2019-10-13 23:07:47 +02:00
testing.go
testing.txt On baremetal platforms, use simpler test matcher. Fixes #2666. 2022-03-15 05:59:00 +01:00
timers.go
timers.txt testdata: clearly correct values for timing test with a little more time to spare on CI machines 2022-11-03 15:26:20 +01:00
trivialpanic.go
zeroalloc.go testdata: fix formatting 2020-05-12 01:17:27 +02:00
zeroalloc.txt add code to handle programs which use heap allocations but never hit the GC 2019-11-17 15:14:51 +01:00