diff options
author | Russ Cox <rsc@golang.org> | 2016-01-06 23:00:08 -0500 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2016-01-08 15:33:48 +0000 |
commit | 331a6055ab8785e77bd1331355d209bd7da2ae26 (patch) | |
tree | 28ee7cc0781fb7460e26ca04b5254d7ff7474dd3 /src/runtime/signal_darwin.go | |
parent | 6da608206c222c280078264f02135ffaa4e1aa26 (diff) | |
download | go-331a6055ab8785e77bd1331355d209bd7da2ae26.tar.gz go-331a6055ab8785e77bd1331355d209bd7da2ae26.zip |
runtime: fix up OS X kernel bug sending user-generated SIGTRAP
OS X unconditionally sets si_code = TRAP_BRKPT when sending SIGTRAP,
even if it was generated by kill -TRAP and not a breakpoint.
Correct the si_code by looking to see if the PC is after a breakpoint.
For #12906.
Change-Id: I998c2499f7f12b338e607282a325b045f1f4f690
Reviewed-on: https://go-review.googlesource.com/18347
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/runtime/signal_darwin.go')
-rw-r--r-- | src/runtime/signal_darwin.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/runtime/signal_darwin.go b/src/runtime/signal_darwin.go index 4a26f3eb08..542169c9f8 100644 --- a/src/runtime/signal_darwin.go +++ b/src/runtime/signal_darwin.go @@ -85,6 +85,8 @@ func sigtrampgo(fn uintptr, infostyle, sig uint32, info *siginfo, ctx unsafe.Poi } setg(g.m.gsignal) + c := &sigctxt{info, ctx} + c.fixsigcode(sig) sighandler(sig, info, ctx, g) setg(g) sigreturn(ctx, infostyle) |