| // Copyright 2014 The Go Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| // +build darwin dragonfly freebsd linux netbsd openbsd solaris |
| throw("unexpected signal during runtime execution") |
| if g.sigcode0 == _BUS_ADRERR && g.sigcode1 < 0x1000 || g.paniconfault { |
| print("unexpected fault address ", hex(g.sigcode1), "\n") |
| if (g.sigcode0 == 0 || g.sigcode0 == _SEGV_MAPERR || g.sigcode0 == _SEGV_ACCERR) && g.sigcode1 < 0x1000 || g.paniconfault { |
| print("unexpected fault address ", hex(g.sigcode1), "\n") |
| if g.sig >= uint32(len(sigtable)) { |
| // can't happen: we looked up g.sig in sigtable to decide to call sigpanic |
| throw("unexpected signal value") |
| panic(errorString(sigtable[g.sig].name)) |
| // setsigsegv is used on darwin/arm{,64} to fake a segmentation fault. |
| func setsigsegv(pc uintptr) { |
| g.sigcode0 = _SEGV_MAPERR |
| g.sigcode1 = 0 // TODO: emulate si_addr |