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 fix bug in IR regarding type aliases 2019-09-20 10:35:49 +02:00
alias.txt fix bug in IR regarding type aliases 2019-09-20 10:35:49 +02:00
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 testdata: add brandondube/pctl to corpus 2023-03-05 10:08:36 -08:00
env.go
env.txt
filesystem.go all: move from os.IsFoo to errors.Is(err, ErrFoo) 2022-08-07 10:32:23 +02:00
filesystem.txt main: clean up tests 2021-04-09 18:33:48 +02:00
float.go
float.txt
gc.go
gc.txt
generics.go
generics.txt
goroutines.go internal/task: remove coroutines 2022-01-19 14:42:02 -05:00
goroutines.txt interp: run goroutine starts and checks at runtime 2021-12-24 09:10:21 +01:00
init.go interp: use object layout information for LLVM types 2021-11-02 22:16:15 +01:00
init.txt interp: don't ignore array indices for untyped objects 2021-07-14 07:55:05 +02:00
init_multi.go testdata: add more test cases in testdata 2018-10-25 20:37:35 +02:00
init_multi.txt testdata: add more test cases in testdata 2018-10-25 20:37:35 +02:00
interface.go compiler: correctly generate code for local named types 2023-03-21 22:22:03 +01:00
interface.txt compiler: fix difference in aliases in interface methods 2022-04-07 12:54:17 +02:00
json.go
json.txt
ldflags.go main: implement -ldflags="-X ..." 2021-04-09 18:33:48 +02:00
ldflags.txt main: implement -ldflags="-X ..." 2021-04-09 18:33:48 +02:00
map.go
map.txt
math.go runtime: add support for math package 2019-02-05 19:37:21 +01:00
math.txt runtime: add support for math package 2019-02-05 19:37:21 +01:00
print.go
print.txt
rand.go
rand.txt
recover.go
recover.txt compiler: implement recover() built-in function 2022-06-16 07:59:21 +02:00
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 builder: add support for Go 1.20 2023-01-17 08:38:54 +01:00
stdlib.txt os: implement virtual filesystem support 2020-05-13 08:08:57 +02:00
string.go
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
timers.go
timers.txt
trivialpanic.go
zeroalloc.go
zeroalloc.txt