mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-13 07:23:39 +00:00
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.
This commit is contained in:
committed by
Ron Evans
parent
815784bd96
commit
194396d715
@@ -23,6 +23,12 @@ const (
|
||||
clock_MONOTONIC_RAW = 4
|
||||
)
|
||||
|
||||
const (
|
||||
sig_SIGBUS = linux_SIGBUS
|
||||
sig_SIGILL = linux_SIGILL
|
||||
sig_SIGSEGV = linux_SIGSEGV
|
||||
)
|
||||
|
||||
// For the definition of the various header structs, see:
|
||||
// https://refspecs.linuxfoundation.org/elf/elf.pdf
|
||||
// Also useful:
|
||||
|
||||
Reference in New Issue
Block a user