Source file
src/runtime/signal_arm64.go
1
2
3
4
5
6
7 package runtime
8
9 import (
10 "internal/abi"
11 "runtime/internal/sys"
12 "unsafe"
13 )
14
15 func dumpregs(c *sigctxt) {
16 print("r0 ", hex(c.r0()), "\n")
17 print("r1 ", hex(c.r1()), "\n")
18 print("r2 ", hex(c.r2()), "\n")
19 print("r3 ", hex(c.r3()), "\n")
20 print("r4 ", hex(c.r4()), "\n")
21 print("r5 ", hex(c.r5()), "\n")
22 print("r6 ", hex(c.r6()), "\n")
23 print("r7 ", hex(c.r7()), "\n")
24 print("r8 ", hex(c.r8()), "\n")
25 print("r9 ", hex(c.r9()), "\n")
26 print("r10 ", hex(c.r10()), "\n")
27 print("r11 ", hex(c.r11()), "\n")
28 print("r12 ", hex(c.r12()), "\n")
29 print("r13 ", hex(c.r13()), "\n")
30 print("r14 ", hex(c.r14()), "\n")
31 print("r15 ", hex(c.r15()), "\n")
32 print("r16 ", hex(c.r16()), "\n")
33 print("r17 ", hex(c.r17()), "\n")
34 print("r18 ", hex(c.r18()), "\n")
35 print("r19 ", hex(c.r19()), "\n")
36 print("r20 ", hex(c.r20()), "\n")
37 print("r21 ", hex(c.r21()), "\n")
38 print("r22 ", hex(c.r22()), "\n")
39 print("r23 ", hex(c.r23()), "\n")
40 print("r24 ", hex(c.r24()), "\n")
41 print("r25 ", hex(c.r25()), "\n")
42 print("r26 ", hex(c.r26()), "\n")
43 print("r27 ", hex(c.r27()), "\n")
44 print("r28 ", hex(c.r28()), "\n")
45 print("r29 ", hex(c.r29()), "\n")
46 print("lr ", hex(c.lr()), "\n")
47 print("sp ", hex(c.sp()), "\n")
48 print("pc ", hex(c.pc()), "\n")
49 print("fault ", hex(c.fault()), "\n")
50 }
51
52
53
54 func (c *sigctxt) sigpc() uintptr { return uintptr(c.pc()) }
55
56 func (c *sigctxt) setsigpc(x uint64) { c.set_pc(x) }
57 func (c *sigctxt) sigsp() uintptr { return uintptr(c.sp()) }
58 func (c *sigctxt) siglr() uintptr { return uintptr(c.lr()) }
59
60
61 func (c *sigctxt) preparePanic(sig uint32, gp *g) {
62
63
64
65
66
67
68 sp := c.sp() - sys.StackAlign
69 c.set_sp(sp)
70 *(*uint64)(unsafe.Pointer(uintptr(sp))) = c.lr()
71
72 pc := gp.sigpc
73
74 if shouldPushSigpanic(gp, pc, uintptr(c.lr())) {
75
76 c.set_lr(uint64(pc))
77 }
78
79
80 c.set_r28(uint64(uintptr(unsafe.Pointer(gp))))
81 c.set_pc(uint64(abi.FuncPCABIInternal(sigpanic)))
82 }
83
84 func (c *sigctxt) pushCall(targetPC, resumePC uintptr) {
85
86
87
88
89 sp := c.sp() - 16
90 c.set_sp(sp)
91 *(*uint64)(unsafe.Pointer(uintptr(sp))) = c.lr()
92
93
94 c.set_lr(uint64(resumePC))
95 c.set_pc(uint64(targetPC))
96 }
97
View as plain text