mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-12-11 21:03:45 +08:00
re PR go/81393 (Bootstrap failure on s390x-linux while building libgo against recent glibc)
PR go/81393 syscall: don't use GETREGS/SETREGS on s390 They were removed in recent glibc. This is a backport of https://golang.org/cl/48231 to earlier branches. Define required type and constants in syscall package directly, don't try to pull them from the system header files. From-SVN: r250402
This commit is contained in:
parent
e1a9ef3f5c
commit
c72684a4e7
@ -12,10 +12,29 @@ func (r *PtraceRegs) PC() uint64 { return uint64(r.Psw.Addr) }
|
||||
|
||||
func (r *PtraceRegs) SetPC(pc uint64) { r.Psw.Addr = uint32(pc) }
|
||||
|
||||
func PtraceGetRegs(pid int, regsout *PtraceRegs) (err error) {
|
||||
return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
|
||||
const syscall_PTRACE_PEEKUSR_AREA = 0x5000
|
||||
const syscall_PTRACE_POKEUSR_AREA = 0x5001
|
||||
|
||||
type syscall_ptrace_area struct {
|
||||
len uint32
|
||||
kernel_addr uint32
|
||||
process_addr uint32
|
||||
}
|
||||
|
||||
func PtraceGetRegs(pid int, regs *PtraceRegs) (err error) {
|
||||
parea := syscall_ptrace_area{
|
||||
12,
|
||||
0,
|
||||
uint32(uintptr(unsafe.Pointer(regs))),
|
||||
}
|
||||
return ptrace(syscall_PTRACE_PEEKUSR_AREA, pid, uintptr(unsafe.Pointer(&parea)), 0)
|
||||
}
|
||||
|
||||
func PtraceSetRegs(pid int, regs *PtraceRegs) (err error) {
|
||||
return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
|
||||
parea := syscall_ptrace_area{
|
||||
12,
|
||||
0,
|
||||
uint32(uintptr(unsafe.Pointer(regs))),
|
||||
}
|
||||
return ptrace(syscall_PTRACE_POKEUSR_AREA, pid, uintptr(unsafe.Pointer(&parea)), 0)
|
||||
}
|
||||
|
@ -12,10 +12,29 @@ func (r *PtraceRegs) PC() uint64 { return r.Psw.Addr }
|
||||
|
||||
func (r *PtraceRegs) SetPC(pc uint64) { r.Psw.Addr = pc }
|
||||
|
||||
func PtraceGetRegs(pid int, regsout *PtraceRegs) (err error) {
|
||||
return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
|
||||
const syscall_PTRACE_PEEKUSR_AREA = 0x5000
|
||||
const syscall_PTRACE_POKEUSR_AREA = 0x5001
|
||||
|
||||
type syscall_ptrace_area struct {
|
||||
len uint32
|
||||
kernel_addr uint64
|
||||
process_addr uint64
|
||||
}
|
||||
|
||||
func PtraceGetRegs(pid int, regs *PtraceRegs) (err error) {
|
||||
parea := syscall_ptrace_area{
|
||||
24,
|
||||
0,
|
||||
uint64(uintptr(unsafe.Pointer(regs))),
|
||||
}
|
||||
return ptrace(syscall_PTRACE_PEEKUSR_AREA, pid, uintptr(unsafe.Pointer(&parea)), 0)
|
||||
}
|
||||
|
||||
func PtraceSetRegs(pid int, regs *PtraceRegs) (err error) {
|
||||
return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
|
||||
parea := syscall_ptrace_area{
|
||||
24,
|
||||
0,
|
||||
uint64(uintptr(unsafe.Pointer(regs))),
|
||||
}
|
||||
return ptrace(syscall_PTRACE_POKEUSR_AREA, pid, uintptr(unsafe.Pointer(&parea)), 0)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user