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 cgo: support anonymous enums included in multiple Go files 2022-11-02 21:21:40 +01:00
embed interp: fix reading from external global 2022-09-15 19:07:04 +02:00
generics Set internal linkage and keeping default visibility for anonymous functions 2022-08-01 10:53:48 +02:00
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 runtime: allow comparing interfaces in reflectValueEqual() 2021-11-24 14:17:47 +01:00
binop.txt runtime: allow comparing interfaces in reflectValueEqual() 2021-11-24 14:17:47 +01:00
calls.go testdata: add test for else/defer bug 2023-04-11 18:54:05 -07:00
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 os: stub out support for some more features 2021-11-26 08:05:35 +01:00
env.txt wasm: add support for the crypto/rand package 2021-08-05 19:01:14 +02:00
filesystem.go all: move from os.IsFoo to errors.Is(err, ErrFoo) 2022-08-07 10:32:23 +02:00
filesystem.txt
float.go
float.txt
gc.go runtime: implement KeepAlive using inline assembly 2023-02-18 10:50:26 +01:00
gc.txt
generics.go compiler: fix incorrect DWARF type in some generic parameters 2022-08-22 10:31:30 +02:00
generics.txt Set internal linkage and keeping default visibility for anonymous functions 2022-08-01 10:53:48 +02:00
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
init_multi.txt
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
ldflags.txt
map.go runtime: properly turn pointer into empty interface when hashing 2023-02-25 06:42:30 -08:00
map.txt runtime: properly turn pointer into empty interface when hashing 2023-02-25 06:42:30 -08:00
math.go
math.txt
print.go Add support for printing slices via print/println 2022-07-13 14:44:23 +02:00
print.txt Add support for printing slices via print/println 2022-07-13 14:44:23 +02:00
rand.go wasm: add support for the crypto/rand package 2021-08-05 19:01:14 +02:00
rand.txt wasm: add support for the crypto/rand package 2021-08-05 19:01:14 +02:00
recover.go compiler: implement recover() built-in function 2022-06-16 07:59:21 +02:00
recover.txt compiler: implement recover() built-in function 2022-06-16 07:59:21 +02:00
reflect.go compiler,reflect: fix pkgpath for struct fields 2023-03-15 21:53:57 +01:00
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
stdlib.go builder: add support for Go 1.20 2023-01-17 08:38:54 +01:00
stdlib.txt
string.go
string.txt
structs.go
structs.txt
testing.go all: drop support for Go 1.16 and Go 1.17 2022-08-30 12:38:06 +02:00
testing.txt On baremetal platforms, use simpler test matcher. Fixes #2666. 2022-03-15 05:59:00 +01:00
timers.go 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
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 main: print source location when a panic happens in -monitor 2023-04-26 18:40:35 +02:00
zeroalloc.go
zeroalloc.txt