aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/defs_windows_amd64.go
diff options
context:
space:
mode:
authorJordan Rhee <jordanrh@microsoft.com>2018-11-21 14:04:29 -0800
committerAustin Clements <austin@google.com>2018-11-26 19:24:54 +0000
commit9ab2ffe8e92f9660cbde1a18921ae864c64f280b (patch)
tree9a2ea5369f179ed20deb01c77689abe12da692d4 /src/runtime/defs_windows_amd64.go
parent9fe9853ae5641eda4cfa58015bd0bcedb99c12cb (diff)
downloadgo-9ab2ffe8e92f9660cbde1a18921ae864c64f280b.tar.gz
go-9ab2ffe8e92f9660cbde1a18921ae864c64f280b.zip
runtime: windows/arm fix tracebacks printed from sigpanic
The exception handler modifies the stack and continuation context so it looks like the faulting code calls sigpanic() directly. The call was not set up correctly on ARM, because it did not handle the link register correctly. This change handles the link register correctly for ARM. Updates #28854 Change-Id: I7ccf838adfc05cd968a5edd7d19ebba6a2478360 Reviewed-on: https://go-review.googlesource.com/c/150957 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/runtime/defs_windows_amd64.go')
-rw-r--r--src/runtime/defs_windows_amd64.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/runtime/defs_windows_amd64.go b/src/runtime/defs_windows_amd64.go
index 37508c09be..42a446d3cd 100644
--- a/src/runtime/defs_windows_amd64.go
+++ b/src/runtime/defs_windows_amd64.go
@@ -120,10 +120,11 @@ func (c *context) ip() uintptr { return uintptr(c.rip) }
func (c *context) sp() uintptr { return uintptr(c.rsp) }
// Amd64 does not have link register, so this returns 0.
-func (c *context) lr() uintptr { return 0 }
+func (c *context) lr() uintptr { return 0 }
+func (c *context) set_lr(x uintptr) {}
-func (c *context) setip(x uintptr) { c.rip = uint64(x) }
-func (c *context) setsp(x uintptr) { c.rsp = uint64(x) }
+func (c *context) set_ip(x uintptr) { c.rip = uint64(x) }
+func (c *context) set_sp(x uintptr) { c.rsp = uint64(x) }
func dumpregs(r *context) {
print("rax ", hex(r.rax), "\n")