1 // syscall_linux_s390x.go -- GNU/Linux s390x specific support
3 // Copyright 2014 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
7 // The PtraceRegs struct generated for go looks like this:
9 // type PtraceRegs struct
15 // Fp_regs _s390_fp_regs;
16 // Per_info _per_struct;
17 // Ieee_instruction_pointer uint64;
20 // The GETREGSET/SETREGSET ptrace commands on S/390 only read/write
21 // the content up to Orig_gpr2. Hence, we use
22 // PEEKUSR_AREA/POKEUSR_AREA like GDB does.
28 func (r
*PtraceRegs
) PC() uint64 { return r
.Psw
.addr
}
30 func (r
*PtraceRegs
) SetPC(pc
uint64) { r
.Psw
.addr
= pc
}
32 func PtraceGetRegs(pid
int, regs
*PtraceRegs
) (err error
) {
33 parea
:= _ptrace_area
{
36 uint64(uintptr(unsafe
.Pointer(regs
))),
38 return ptrace(PTRACE_PEEKUSR_AREA
, pid
, uintptr(unsafe
.Pointer(&parea
)), 0)
41 func PtraceSetRegs(pid
int, regs
*PtraceRegs
) (err error
) {
42 parea
:= _ptrace_area
{
45 uint64(uintptr(unsafe
.Pointer(regs
))),
47 return ptrace(PTRACE_POKEUSR_AREA
, pid
, uintptr(unsafe
.Pointer(&parea
)), 0)