summaryrefslogtreecommitdiff
path: root/libgo/mksysinfo.sh
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2017-06-21 21:42:41 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2017-06-21 21:42:41 +0000
commit8d4b68a7c4091c99c8d591e93efae5748a7ced13 (patch)
tree51c565ff797d0d2f7799adc97742845805f0a8a1 /libgo/mksysinfo.sh
parent4ded86690e9fd3c71e1ff47beea31079ad8a7b4f (diff)
libgo, syscall: fix ptrace implementation on MIPS
On MIPS, the correct structure for PtraceRegs is 'struct pt_regs' which is declared in linux/ptrace.h. Previously no PtraceRegs structure was created on MIPS because 'struct user_regs_struct' doesn't exist there. Fallback to using pt_regs when the PtraceRegs structure is generated in mksysinfo.sh, then adjust syscall_linux_mipsx.go to read the program counter from the correct field. In addition, implement PtraceGetRegs and PtraceSetRegs on all 3 ABI variants. syscall_linux_mips64x.go can now be removed since the ptrace code on all 3 ABIs is identical. Reviewed-on: https://go-review.googlesource.com/46150 From-SVN: r249472
Diffstat (limited to 'libgo/mksysinfo.sh')
-rwxr-xr-xlibgo/mksysinfo.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/libgo/mksysinfo.sh b/libgo/mksysinfo.sh
index 1220b3ac617..8fd8eadefc6 100755
--- a/libgo/mksysinfo.sh
+++ b/libgo/mksysinfo.sh
@@ -317,9 +317,13 @@ if test "$regs" = ""; then
upcase_fields "__user_psw_struct" "PtracePsw" >> ${OUT} || true
upcase_fields "__user_fpregs_struct" "PtraceFpregs" >> ${OUT} || true
upcase_fields "__user_per_struct" "PtracePer" >> ${OUT} || true
+ else
+ # mips*
+ regs=`grep '^type _pt_regs struct' gen-sysinfo.go || true`
fi
fi
if test "$regs" != ""; then
+ regs=`echo $regs | sed -e 's/type _pt_regs struct//'`
regs=`echo $regs |
sed -e 's/type __*user_regs_struct struct //' -e 's/[{}]//g'`
regs=`echo $regs | sed -e s'/^ *//'`