aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/signal_arm.go
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2018-01-31 17:34:22 -0500
committerAustin Clements <austin@google.com>2018-02-13 21:01:25 +0000
commit615d44c287a9c8a5f1062dd24ba341d806abc944 (patch)
tree23cb45d41b62fcd1c539ae067b33aadb05606031 /src/runtime/signal_arm.go
parentb1679e4d03268a6792e6b8d573ac31080d9d9baf (diff)
downloadgo-615d44c287a9c8a5f1062dd24ba341d806abc944.tar.gz
go-615d44c287a9c8a5f1062dd24ba341d806abc944.zip
runtime: refactor test for pushing sigpanic frame
This logic is duplicated in all of the preparePanic functions. Pull it out into one architecture-independent function. Change-Id: I7ef4e78e3eda0b7be1a480fb5245fc7424fb2b4e Reviewed-on: https://go-review.googlesource.com/91255 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/runtime/signal_arm.go')
-rw-r--r--src/runtime/signal_arm.go14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/runtime/signal_arm.go b/src/runtime/signal_arm.go
index d00b225ef6..bb597c5608 100644
--- a/src/runtime/signal_arm.go
+++ b/src/runtime/signal_arm.go
@@ -53,18 +53,8 @@ func (c *sigctxt) preparePanic(sig uint32, gp *g) {
pc := gp.sigpc
- // If we don't recognize the PC as code
- // but we do recognize the link register as code,
- // then assume this was a call to non-code and treat like
- // pc == 0, to make unwinding show the context.
- if pc != 0 && !findfunc(pc).valid() && findfunc(uintptr(c.lr())).valid() {
- pc = 0
- }
-
- // Don't bother saving PC if it's zero, which is
- // probably a call to a nil func: the old link register
- // is more useful in the stack trace.
- if pc != 0 {
+ if shouldPushSigpanic(gp, pc, uintptr(c.lr())) {
+ // Make it look the like faulting PC called sigpanic.
c.set_lr(uint32(pc))
}