Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch For processors that have memory breakpoints, add ma...
details: https://anonhg.NetBSD.org/src/rev/cccb97278872
branches: trunk
changeset: 340712:cccb97278872
user: christos <christos%NetBSD.org@localhost>
date: Fri Sep 25 16:05:17 2015 +0000
description:
For processors that have memory breakpoints, add macros for them to help
libproc
diffstat:
sys/arch/aarch64/include/ptrace.h | 5 ++++-
sys/arch/alpha/include/ptrace.h | 6 +++++-
sys/arch/amd64/include/ptrace.h | 6 +++++-
sys/arch/arm/include/ptrace.h | 5 ++++-
sys/arch/hppa/include/ptrace.h | 5 ++++-
sys/arch/i386/include/ptrace.h | 6 +++++-
sys/arch/m68k/include/ptrace.h | 5 ++++-
sys/arch/mips/include/ptrace.h | 6 +++++-
sys/arch/sh3/include/ptrace.h | 5 ++++-
sys/arch/sparc/include/ptrace.h | 5 ++++-
sys/arch/vax/include/ptrace.h | 5 ++++-
11 files changed, 48 insertions(+), 11 deletions(-)
diffs (200 lines):
diff -r d94b56e3ae8d -r cccb97278872 sys/arch/aarch64/include/ptrace.h
--- a/sys/arch/aarch64/include/ptrace.h Fri Sep 25 11:39:08 2015 +0000
+++ b/sys/arch/aarch64/include/ptrace.h Fri Sep 25 16:05:17 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ptrace.h,v 1.3 2015/09/15 15:49:02 christos Exp $ */
+/* $NetBSD: ptrace.h,v 1.4 2015/09/25 16:05:17 christos Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -56,6 +56,9 @@
#define PTRACE_REG_SP(r) (r)->r_sp
#define PTRACE_REG_INTRV(r) (r)->r_reg[0]
+#define PTRACE_BREAKPOINT ((const uint8_t[]) { 0xd4, 0x20, 0x01, 0xa0 })
+#define PTRACE_BREAKPOINT_SIZE 4
+
#elif defined(__arm__)
#include <arm/ptrace.h>
diff -r d94b56e3ae8d -r cccb97278872 sys/arch/alpha/include/ptrace.h
--- a/sys/arch/alpha/include/ptrace.h Fri Sep 25 11:39:08 2015 +0000
+++ b/sys/arch/alpha/include/ptrace.h Fri Sep 25 16:05:17 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ptrace.h,v 1.7 2015/09/15 15:49:02 christos Exp $ */
+/* $NetBSD: ptrace.h,v 1.8 2015/09/25 16:05:17 christos Exp $ */
/*
* Copyright (c) 1994 Christopher G. Demetriou
@@ -46,7 +46,11 @@
"PT_SETFPREGS",
#include <machine/reg.h>
+
#define PTRACE_REG_PC(r) (r)->r_regs[R_ZERO]
#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]
+
+#define PTRACE_BREAKPOINT ((const uint8_t[]) { 0x80, 0x00, 0x00, 0x00 })
+#define PTRACE_BREAKPOINT_SIZE 4
diff -r d94b56e3ae8d -r cccb97278872 sys/arch/amd64/include/ptrace.h
--- a/sys/arch/amd64/include/ptrace.h Fri Sep 25 11:39:08 2015 +0000
+++ b/sys/arch/amd64/include/ptrace.h Fri Sep 25 16:05:17 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ptrace.h,v 1.5 2015/09/17 14:39:35 christos Exp $ */
+/* $NetBSD: ptrace.h,v 1.6 2015/09/25 16:05:17 christos Exp $ */
/*
* Copyright (c) 1993 Christopher G. Demetriou
@@ -55,6 +55,10 @@
#define PTRACE_REG_SP(r) (r)->regs[_REG_RSP]
#define PTRACE_REG_INTRV(r) (r)->regs[_REG_RAX]
+#define PTRACE_BREAKPOINT ((const uint8_t[]) { 0xcc })
+#define PTRACE_BREAKPOINT_SIZE 1
+#define PTRACE_BREAKPOINT_ADJ 1
+
#ifdef _KERNEL_OPT
#include "opt_compat_netbsd32.h"
diff -r d94b56e3ae8d -r cccb97278872 sys/arch/arm/include/ptrace.h
--- a/sys/arch/arm/include/ptrace.h Fri Sep 25 11:39:08 2015 +0000
+++ b/sys/arch/arm/include/ptrace.h Fri Sep 25 16:05:17 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ptrace.h,v 1.7 2015/09/15 15:49:02 christos Exp $ */
+/* $NetBSD: ptrace.h,v 1.8 2015/09/25 16:05:17 christos Exp $ */
/*
* Copyright (c) 1995 Frank Lancaster
@@ -57,3 +57,6 @@
#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]
+
+#define PTRACE_BREAKPOINT ((const uint8_t[]) { 0xe7, 0xff, 0xff, 0xff })
+#define PTRACE_BREAKPOINT_SIZE 4
diff -r d94b56e3ae8d -r cccb97278872 sys/arch/hppa/include/ptrace.h
--- a/sys/arch/hppa/include/ptrace.h Fri Sep 25 11:39:08 2015 +0000
+++ b/sys/arch/hppa/include/ptrace.h Fri Sep 25 16:05:17 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ptrace.h,v 1.4 2015/09/15 15:49:02 christos Exp $ */
+/* $NetBSD: ptrace.h,v 1.5 2015/09/25 16:05:17 christos Exp $ */
/* $OpenBSD: ptrace.h,v 1.2 1998/12/01 03:05:44 mickey Exp $ */
@@ -52,3 +52,6 @@
} while (/*CONSTCOND*/0)
#define PTRACE_REG_SP(r) (r)->r_out[30]
#define PTRACE_REG_INTRV(r) (r)->r_out[28]
+
+#define PTRACE_BREAKPOINT ((const uint8_t[]) { 0x00, 0x01, 0x00, 0x04 })
+#define PTRACE_BREAKPOINT_SIZE 4
diff -r d94b56e3ae8d -r cccb97278872 sys/arch/i386/include/ptrace.h
--- a/sys/arch/i386/include/ptrace.h Fri Sep 25 11:39:08 2015 +0000
+++ b/sys/arch/i386/include/ptrace.h Fri Sep 25 16:05:17 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ptrace.h,v 1.14 2015/09/15 15:49:02 christos Exp $ */
+/* $NetBSD: ptrace.h,v 1.15 2015/09/25 16:05:17 christos Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
@@ -102,6 +102,10 @@
#define PTRACE_REG_SP(r) (r)->r_esp
#define PTRACE_REG_INTRV(r) (r)->r_eax
+#define PTRACE_BREAKPOINT ((const uint8_t[]) { 0xcc })
+#define PTRACE_BREAKPOINT_SIZE 1
+#define PTRACE_BREAKPOINT_ADJ sizeof(PTRACE_BREAKPOINT)
+
#ifdef _KERNEL
/*
diff -r d94b56e3ae8d -r cccb97278872 sys/arch/m68k/include/ptrace.h
--- a/sys/arch/m68k/include/ptrace.h Fri Sep 25 11:39:08 2015 +0000
+++ b/sys/arch/m68k/include/ptrace.h Fri Sep 25 16:05:17 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ptrace.h,v 1.9 2015/09/15 15:49:02 christos Exp $ */
+/* $NetBSD: ptrace.h,v 1.10 2015/09/25 16:05:17 christos Exp $ */
/*
* Copyright (c) 1993 Christopher G. Demetriou
@@ -54,4 +54,7 @@
#define PTRACE_REG_SP(r) (r)->r_regs[15]
#define PTRACE_REG_INTRV(r) (r)->r_regs[0]
+#define PTRACE_BREAKPOINT ((const uint8_t[]) { 0x4e, 0x4f })
+#define PTRACE_BREAKPOINT_SIZE 2
+
#endif /* !_M68K_PTRACE_H_ */
diff -r d94b56e3ae8d -r cccb97278872 sys/arch/mips/include/ptrace.h
--- a/sys/arch/mips/include/ptrace.h Fri Sep 25 11:39:08 2015 +0000
+++ b/sys/arch/mips/include/ptrace.h Fri Sep 25 16:05:17 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ptrace.h,v 1.13 2015/09/15 15:49:02 christos Exp $ */
+/* $NetBSD: ptrace.h,v 1.14 2015/09/25 16:05:17 christos Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -58,6 +58,10 @@
#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]
+
+#define PTRACE_BREAKPOINT ((const uint8_t[]) { 0x00, 0x00, 0x00, 0x0d })
+#define PTRACE_BREAKPOINT_SIZE 4
+
/*
* Glue for gdb: map NetBSD register names to legacy ptrace register names
*/
diff -r d94b56e3ae8d -r cccb97278872 sys/arch/sh3/include/ptrace.h
--- a/sys/arch/sh3/include/ptrace.h Fri Sep 25 11:39:08 2015 +0000
+++ b/sys/arch/sh3/include/ptrace.h Fri Sep 25 16:05:17 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ptrace.h,v 1.11 2015/09/15 15:49:03 christos Exp $ */
+/* $NetBSD: ptrace.h,v 1.12 2015/09/25 16:05:17 christos Exp $ */
/*
* Copyright (c) 1993 Christopher G. Demetriou
@@ -64,6 +64,9 @@
#define PTRACE_REG_SP(r) r->r_r15
#define PTRACE_REG_INTV(r) r->r_r0
+#define PTRACE_BREAKPOINT ((const uint8_t[]) { 0xc3, 0xc3 })
+#define PTRACE_BREAKPOINT_SIZE 2
+
#ifdef _KERNEL
#ifdef _KERNEL_OPT
#include "opt_compat_netbsd.h"
diff -r d94b56e3ae8d -r cccb97278872 sys/arch/sparc/include/ptrace.h
--- a/sys/arch/sparc/include/ptrace.h Fri Sep 25 11:39:08 2015 +0000
+++ b/sys/arch/sparc/include/ptrace.h Fri Sep 25 16:05:17 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ptrace.h,v 1.8 2015/09/15 15:49:03 christos Exp $ */
+/* $NetBSD: ptrace.h,v 1.9 2015/09/25 16:05:17 christos Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -62,3 +62,6 @@
} while (/*CONSTCOND*/0)
#define PTRACE_REG_SP(r) (r)->r_out[6]
#define PTRACE_REG_INTRV(r) (r)->r_out[0]
+
+#define PTRACE_BREAKPOINT ((const uint8_t[]) { 0x91, 0xd0, 0x20, 0x01 })
+#define PTRACE_BREAKPOINT_SIZE 4
diff -r d94b56e3ae8d -r cccb97278872 sys/arch/vax/include/ptrace.h
--- a/sys/arch/vax/include/ptrace.h Fri Sep 25 11:39:08 2015 +0000
+++ b/sys/arch/vax/include/ptrace.h Fri Sep 25 16:05:17 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ptrace.h,v 1.5 2015/09/15 15:49:03 christos Exp $ */
+/* $NetBSD: ptrace.h,v 1.6 2015/09/25 16:05:18 christos Exp $ */
/*
* Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@@ -48,3 +48,6 @@
#define PTRACE_REG_SET_PC(r, v) (r)->pc = (v)
#define PTRACE_REG_SP(r) (r)->sp
#define PTRACE_REG_INTRV(r) (r)->r0
+
+#define PTRACE_BREAKPOINT ((const uint8_t[]) { 0x03 })
+#define PTRACE_BREAKPOINT_SIZE 1
Home |
Main Index |
Thread Index |
Old Index