Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch Introduce PTRACE_REG_FP() a helper macro to retriev...
details: https://anonhg.NetBSD.org/src/rev/7881a367dbed
branches: trunk
changeset: 999786:7881a367dbed
user: kamil <kamil%NetBSD.org@localhost>
date: Tue Jun 18 21:18:11 2019 +0000
description:
Introduce PTRACE_REG_FP() a helper macro to retrieve the frame pointer
The macro is dummy for ia64 (the FP register is unknown and can change
freely) and sparc/sparc64 (not stored in struct reg).
diffstat:
sys/arch/aarch64/include/ptrace.h | 3 ++-
sys/arch/alpha/include/ptrace.h | 3 ++-
sys/arch/amd64/include/ptrace.h | 3 ++-
sys/arch/arm/include/ptrace.h | 3 ++-
sys/arch/hppa/include/ptrace.h | 3 ++-
sys/arch/i386/include/ptrace.h | 3 ++-
sys/arch/ia64/include/ptrace.h | 3 ++-
sys/arch/m68k/include/ptrace.h | 3 ++-
sys/arch/mips/include/ptrace.h | 3 ++-
sys/arch/or1k/include/ptrace.h | 5 +++--
sys/arch/powerpc/include/ptrace.h | 3 ++-
sys/arch/riscv/include/ptrace.h | 3 ++-
sys/arch/sh3/include/ptrace.h | 3 ++-
sys/arch/sparc/include/ptrace.h | 3 ++-
sys/arch/vax/include/ptrace.h | 3 ++-
15 files changed, 31 insertions(+), 16 deletions(-)
diffs (257 lines):
diff -r 513752fbd1b4 -r 7881a367dbed sys/arch/aarch64/include/ptrace.h
--- a/sys/arch/aarch64/include/ptrace.h Tue Jun 18 21:14:26 2019 +0000
+++ b/sys/arch/aarch64/include/ptrace.h Tue Jun 18 21:18:11 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ptrace.h,v 1.8 2018/12/13 10:44:25 ryo Exp $ */
+/* $NetBSD: ptrace.h,v 1.9 2019/06/18 21:18:11 kamil Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -57,6 +57,7 @@
#include <machine/reg.h>
#define PTRACE_REG_PC(r) (r)->r_pc
+#define PTRACE_REG_FP(r) (r)->r_reg[29]
#define PTRACE_REG_SET_PC(r, v) (r)->r_pc = (v)
#define PTRACE_REG_SP(r) (r)->r_sp
#define PTRACE_REG_INTRV(r) (r)->r_reg[0]
diff -r 513752fbd1b4 -r 7881a367dbed sys/arch/alpha/include/ptrace.h
--- a/sys/arch/alpha/include/ptrace.h Tue Jun 18 21:14:26 2019 +0000
+++ b/sys/arch/alpha/include/ptrace.h Tue Jun 18 21:18:11 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ptrace.h,v 1.9 2017/04/12 18:17:59 kamil Exp $ */
+/* $NetBSD: ptrace.h,v 1.10 2019/06/18 21:18:11 kamil Exp $ */
/*
* Copyright (c) 1994 Christopher G. Demetriou
@@ -48,6 +48,7 @@
#include <machine/reg.h>
#define PTRACE_REG_PC(r) (r)->r_regs[R_ZERO]
+#define PTRACE_REG_FP(r) (r)->r_regs[R_S6]
#define PTRACE_REG_SET_PC(r, v) (r)->r_regs[R_ZERO] = (v)
#define PTRACE_REG_SP(r) (r)->r_regs[R_SP]
#define PTRACE_REG_INTRV(r) (r)->r_regs[R_V0]
diff -r 513752fbd1b4 -r 7881a367dbed sys/arch/amd64/include/ptrace.h
--- a/sys/arch/amd64/include/ptrace.h Tue Jun 18 21:14:26 2019 +0000
+++ b/sys/arch/amd64/include/ptrace.h Tue Jun 18 21:18:11 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ptrace.h,v 1.14 2019/06/04 16:29:53 mgorny Exp $ */
+/* $NetBSD: ptrace.h,v 1.15 2019/06/18 21:18:11 kamil Exp $ */
/*
* Copyright (c) 1993 Christopher G. Demetriou
@@ -59,6 +59,7 @@
#include <machine/reg.h>
#define PTRACE_REG_PC(r) (r)->regs[_REG_RIP]
+#define PTRACE_REG_FP(r) (r)->regs[_REG_RBP]
#define PTRACE_REG_SET_PC(r, v) (r)->regs[_REG_RIP] = (v)
#define PTRACE_REG_SP(r) (r)->regs[_REG_RSP]
#define PTRACE_REG_INTRV(r) (r)->regs[_REG_RAX]
diff -r 513752fbd1b4 -r 7881a367dbed sys/arch/arm/include/ptrace.h
--- a/sys/arch/arm/include/ptrace.h Tue Jun 18 21:14:26 2019 +0000
+++ b/sys/arch/arm/include/ptrace.h Tue Jun 18 21:18:11 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ptrace.h,v 1.14 2019/06/18 15:21:19 skrll Exp $ */
+/* $NetBSD: ptrace.h,v 1.15 2019/06/18 21:18:12 kamil Exp $ */
/*
* Copyright (c) 1995 Frank Lancaster
@@ -60,6 +60,7 @@
#include <machine/reg.h>
#define PTRACE_REG_PC(_r) (_r)->r_pc
+#define PTRACE_REG_FP(_r) (_r)->r[11]
#define PTRACE_REG_SET_PC(_r, _v) (_r)->r_pc = (_v)
#define PTRACE_REG_SP(_r) (_r)->r_sp
#define PTRACE_REG_INTRV(_r) (_r)->r[0]
diff -r 513752fbd1b4 -r 7881a367dbed sys/arch/hppa/include/ptrace.h
--- a/sys/arch/hppa/include/ptrace.h Tue Jun 18 21:14:26 2019 +0000
+++ b/sys/arch/hppa/include/ptrace.h Tue Jun 18 21:18:11 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ptrace.h,v 1.8 2017/04/12 18:17:59 kamil Exp $ */
+/* $NetBSD: ptrace.h,v 1.9 2019/06/18 21:18:12 kamil Exp $ */
/* $OpenBSD: ptrace.h,v 1.2 1998/12/01 03:05:44 mickey Exp $ */
@@ -50,6 +50,7 @@
#include <machine/reg.h>
#define PTRACE_REG_PC(r) (r)->r_pcoqh
+#define PTRACE_REG_FP(r) (r)->r_regs[3]
#define PTRACE_REG_SET_PC(r, v) do { \
(r)->r_pcoqh = (v); \
(r)->r_pcoqt = (v) + 4; \
diff -r 513752fbd1b4 -r 7881a367dbed sys/arch/i386/include/ptrace.h
--- a/sys/arch/i386/include/ptrace.h Tue Jun 18 21:14:26 2019 +0000
+++ b/sys/arch/i386/include/ptrace.h Tue Jun 18 21:18:11 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ptrace.h,v 1.21 2019/06/17 14:31:51 kamil Exp $ */
+/* $NetBSD: ptrace.h,v 1.22 2019/06/18 21:18:12 kamil Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
@@ -107,6 +107,7 @@
#include <machine/reg.h>
#define PTRACE_REG_PC(r) (r)->r_eip
+#define PTRACE_REG_FP(r) (r)->r_ebp
#define PTRACE_REG_SET_PC(r, v) (r)->r_eip = (v)
#define PTRACE_REG_SP(r) (r)->r_esp
#define PTRACE_REG_INTRV(r) (r)->r_eax
diff -r 513752fbd1b4 -r 7881a367dbed sys/arch/ia64/include/ptrace.h
--- a/sys/arch/ia64/include/ptrace.h Tue Jun 18 21:14:26 2019 +0000
+++ b/sys/arch/ia64/include/ptrace.h Tue Jun 18 21:18:11 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ptrace.h,v 1.4 2017/04/08 00:25:49 kamil Exp $ */
+/* $NetBSD: ptrace.h,v 1.5 2019/06/18 21:18:12 kamil Exp $ */
/*
* Copyright (c) 1994 Christopher G. Demetriou
@@ -52,6 +52,7 @@
#include <machine/reg.h>
#define PTRACE_REG_PC(r) (r)->r_special.iip
+#define PTRACE_REG_FP(r) 0 /* Not supported in target */
#define PTRACE_REG_SET_PC(r, v) (r)->r_special.iip = (v)
#define PTRACE_REG_SP(r) (r)->r_special.sp
#ifdef notyet
diff -r 513752fbd1b4 -r 7881a367dbed sys/arch/m68k/include/ptrace.h
--- a/sys/arch/m68k/include/ptrace.h Tue Jun 18 21:14:26 2019 +0000
+++ b/sys/arch/m68k/include/ptrace.h Tue Jun 18 21:18:11 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ptrace.h,v 1.12 2017/04/12 18:18:00 kamil Exp $ */
+/* $NetBSD: ptrace.h,v 1.13 2019/06/18 21:18:12 kamil Exp $ */
/*
* Copyright (c) 1993 Christopher G. Demetriou
@@ -54,6 +54,7 @@
#include <machine/reg.h>
#define PTRACE_REG_PC(r) (r)->r_pc
+#define PTRACE_REG_FP(r) (r)->r_regs[14]
#define PTRACE_REG_SET_PC(r, v) (r)->r_pc = (v)
#define PTRACE_REG_SP(r) (r)->r_regs[15]
#define PTRACE_REG_INTRV(r) (r)->r_regs[0]
diff -r 513752fbd1b4 -r 7881a367dbed sys/arch/mips/include/ptrace.h
--- a/sys/arch/mips/include/ptrace.h Tue Jun 18 21:14:26 2019 +0000
+++ b/sys/arch/mips/include/ptrace.h Tue Jun 18 21:18:11 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ptrace.h,v 1.16 2017/04/12 18:18:00 kamil Exp $ */
+/* $NetBSD: ptrace.h,v 1.17 2019/06/18 21:18:12 kamil Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -62,6 +62,7 @@
#include <machine/reg.h>
#define PTRACE_REG_PC(r) (r)->r_regs[35]
+#define PTRACE_REG_FP(r) (r)->r_regs[30]
#define PTRACE_REG_SET_PC(r, v) (r)->r_regs[35] = (v)
#define PTRACE_REG_SP(r) (r)->r_regs[29]
#define PTRACE_REG_INTRV(r) (r)->r_regs[2]
diff -r 513752fbd1b4 -r 7881a367dbed sys/arch/or1k/include/ptrace.h
--- a/sys/arch/or1k/include/ptrace.h Tue Jun 18 21:14:26 2019 +0000
+++ b/sys/arch/or1k/include/ptrace.h Tue Jun 18 21:18:11 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ptrace.h,v 1.2 2015/09/15 15:49:03 christos Exp $ */
+/* $NetBSD: ptrace.h,v 1.3 2019/06/18 21:18:12 kamil Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -44,7 +44,8 @@
"PT_SETREGS"
#include <machine/reg.h>
-#define PTRACE_REG_PC(r) (r)->r_reg[31] // XXX:!?!
+#define PTRACE_REG_PC(r) (r)->r_reg[31]
+#define PTRACE_REG_FP(r) (r)->r_reg[1]
#define PTRACE_REG_SET_PC(r, v) (r)->r_reg[31] = (v)
#define PTRACE_REG_SP(r) (r)->r_reg[11]
#define PTRACE_REG_INTRV(r) (r)->r_reg[0]
diff -r 513752fbd1b4 -r 7881a367dbed sys/arch/powerpc/include/ptrace.h
--- a/sys/arch/powerpc/include/ptrace.h Tue Jun 18 21:14:26 2019 +0000
+++ b/sys/arch/powerpc/include/ptrace.h Tue Jun 18 21:18:11 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ptrace.h,v 1.13 2017/04/08 00:25:49 kamil Exp $ */
+/* $NetBSD: ptrace.h,v 1.14 2019/06/18 21:18:12 kamil Exp $ */
#ifndef _POWERPC_PTRACE_H
#define _POWERPC_PTRACE_H
@@ -22,6 +22,7 @@
#include <machine/reg.h>
#define PTRACE_REG_PC(r) (r)->pc
+#define PTRACE_REG_FP(r) (r)->fixreg[31]
#define PTRACE_REG_SET_PC(r, v) (r)->pc = (v)
#define PTRACE_REG_SP(r) (r)->fixreg[1]
#define PTRACE_REG_INTRV(r) (r)->fixreg[3]
diff -r 513752fbd1b4 -r 7881a367dbed sys/arch/riscv/include/ptrace.h
--- a/sys/arch/riscv/include/ptrace.h Tue Jun 18 21:14:26 2019 +0000
+++ b/sys/arch/riscv/include/ptrace.h Tue Jun 18 21:18:11 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ptrace.h,v 1.2 2015/09/15 15:49:03 christos Exp $ */
+/* $NetBSD: ptrace.h,v 1.3 2019/06/18 21:18:12 kamil Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -49,6 +49,7 @@
#include <machine/reg.h>
#define PTRACE_REG_PC(r) (r)->r_pc
+#define PTRACE_REG_FP(r) (r)->r_reg[7]
#define PTRACE_REG_SET_PC(r, v) (r)->r_pc = (v)
#define PTRACE_REG_SP(r) (r)->r_reg[1]
#define PTRACE_REG_INTRV(r) (r)->r_reg[9]
diff -r 513752fbd1b4 -r 7881a367dbed sys/arch/sh3/include/ptrace.h
--- a/sys/arch/sh3/include/ptrace.h Tue Jun 18 21:14:26 2019 +0000
+++ b/sys/arch/sh3/include/ptrace.h Tue Jun 18 21:18:11 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ptrace.h,v 1.14 2017/04/12 18:18:00 kamil Exp $ */
+/* $NetBSD: ptrace.h,v 1.15 2019/06/18 21:18:13 kamil Exp $ */
/*
* Copyright (c) 1993 Christopher G. Demetriou
@@ -67,6 +67,7 @@
#include <machine/reg.h>
#define PTRACE_REG_PC(r) r->r_spc
+#define PTRACE_REG_FP(r) r->r_r14
#define PTRACE_REG_SET_PC(r, v) r->r_spc = (v)
#define PTRACE_REG_SP(r) r->r_r15
#define PTRACE_REG_INTV(r) r->r_r0
diff -r 513752fbd1b4 -r 7881a367dbed sys/arch/sparc/include/ptrace.h
--- a/sys/arch/sparc/include/ptrace.h Tue Jun 18 21:14:26 2019 +0000
+++ b/sys/arch/sparc/include/ptrace.h Tue Jun 18 21:18:11 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ptrace.h,v 1.13 2019/04/17 15:42:02 martin Exp $ */
+/* $NetBSD: ptrace.h,v 1.14 2019/06/18 21:18:13 kamil Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -56,6 +56,7 @@
#include <machine/reg.h>
#define PTRACE_REG_PC(r) ((register_t)(r)->r_pc)
+#define PTRACE_REG_FP(r) 0 /* not stored in struct reg */
#define PTRACE_REG_SET_PC(r, v) do { \
(r)->r_pc = (v); \
(r)->r_npc = (v) + 4; \
diff -r 513752fbd1b4 -r 7881a367dbed sys/arch/vax/include/ptrace.h
--- a/sys/arch/vax/include/ptrace.h Tue Jun 18 21:14:26 2019 +0000
+++ b/sys/arch/vax/include/ptrace.h Tue Jun 18 21:18:11 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ptrace.h,v 1.10 2017/05/22 17:12:11 ragge Exp $ */
+/* $NetBSD: ptrace.h,v 1.11 2019/06/18 21:18:13 kamil Exp $ */
/*
* Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@@ -44,6 +44,7 @@
#include <machine/reg.h>
#define PTRACE_REG_PC(r) (r)->pc
+#define PTRACE_REG_FP(r) (r)->fp
#define PTRACE_REG_SET_PC(r, v) (r)->pc = (v)
#define PTRACE_REG_SP(r) (r)->sp
#define PTRACE_REG_INTRV(r) (r)->r0
Home |
Main Index |
Thread Index |
Old Index