diff options
author | Ayke van Laethem <[email protected]> | 2024-08-12 18:45:22 +0200 |
---|---|---|
committer | Ron Evans <[email protected]> | 2024-08-15 02:00:28 +0200 |
commit | 194396d71570318eb581245c49778341474d8ef6 (patch) | |
tree | f1a9d09526c22fd1ec7419ec4aa49465f4e812c2 /src/runtime/arch_arm64.go | |
parent | 815784bd9692afe9ac5d58a37a282757de734d9a (diff) | |
download | tinygo-194396d71570318eb581245c49778341474d8ef6.tar.gz tinygo-194396d71570318eb581245c49778341474d8ef6.zip |
unix: print a message when a fatal signal happens
Print a message for SIGBUS, SIGSEGV, and SIGILL when they happen.
These signals are always fatal, but it's very useful to know which of
them happened.
Also, it prints the location in the binary which can then be parsed by
`tinygo run` (see https://github.com/tinygo-org/tinygo/pull/4383).
While this does add some extra binary size, it's for Linux and MacOS
(systems that typically have plenty of RAM/storage) and could be very
useful when debugging some low-level crash such as a runtime bug.
Diffstat (limited to 'src/runtime/arch_arm64.go')
-rw-r--r-- | src/runtime/arch_arm64.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/runtime/arch_arm64.go b/src/runtime/arch_arm64.go index 4e798e36b..6d3c856cf 100644 --- a/src/runtime/arch_arm64.go +++ b/src/runtime/arch_arm64.go @@ -9,7 +9,12 @@ const deferExtraRegs = 0 const callInstSize = 4 // "bl someFunction" is 4 bytes -const linux_MAP_ANONYMOUS = 0x20 +const ( + linux_MAP_ANONYMOUS = 0x20 + linux_SIGBUS = 7 + linux_SIGILL = 4 + linux_SIGSEGV = 11 +) // Align on word boundary. func align(ptr uintptr) uintptr { |