Source file
src/runtime/signal_openbsd_386.go
1
2
3
4
5 package runtime
6
7 import "unsafe"
8
9 type sigctxt struct {
10 info *siginfo
11 ctxt unsafe.Pointer
12 }
13
14
15
16 func (c *sigctxt) regs() *sigcontext {
17 return (*sigcontext)(c.ctxt)
18 }
19
20 func (c *sigctxt) eax() uint32 { return c.regs().sc_eax }
21 func (c *sigctxt) ebx() uint32 { return c.regs().sc_ebx }
22 func (c *sigctxt) ecx() uint32 { return c.regs().sc_ecx }
23 func (c *sigctxt) edx() uint32 { return c.regs().sc_edx }
24 func (c *sigctxt) edi() uint32 { return c.regs().sc_edi }
25 func (c *sigctxt) esi() uint32 { return c.regs().sc_esi }
26 func (c *sigctxt) ebp() uint32 { return c.regs().sc_ebp }
27 func (c *sigctxt) esp() uint32 { return c.regs().sc_esp }
28
29
30
31 func (c *sigctxt) eip() uint32 { return c.regs().sc_eip }
32
33 func (c *sigctxt) eflags() uint32 { return c.regs().sc_eflags }
34 func (c *sigctxt) cs() uint32 { return c.regs().sc_cs }
35 func (c *sigctxt) fs() uint32 { return c.regs().sc_fs }
36 func (c *sigctxt) gs() uint32 { return c.regs().sc_gs }
37 func (c *sigctxt) sigcode() uint32 { return uint32(c.info.si_code) }
38 func (c *sigctxt) sigaddr() uint32 {
39 return *(*uint32)(add(unsafe.Pointer(c.info), 12))
40 }
41
42 func (c *sigctxt) set_eip(x uint32) { c.regs().sc_eip = x }
43 func (c *sigctxt) set_esp(x uint32) { c.regs().sc_esp = x }
44 func (c *sigctxt) set_sigcode(x uint32) { c.info.si_code = int32(x) }
45 func (c *sigctxt) set_sigaddr(x uint32) {
46 *(*uint32)(add(unsafe.Pointer(c.info), 12)) = x
47 }
48
View as plain text