Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm/include PR/52867: Martin Husemann: arm sofware ...
details: https://anonhg.NetBSD.org/src/rev/5084b01627c4
branches: trunk
changeset: 358396:5084b01627c4
user: christos <christos%NetBSD.org@localhost>
date: Wed Dec 27 19:35:05 2017 +0000
description:
PR/52867: Martin Husemann: arm sofware breakpoint asm is slightly off
ARM uses an undefined instruction to emulate a software breakpoint.
However, the ptrace.h instruction on the one hand, and gdb/the kernel
disagree on the exact value.
This causes PTRACE_BREAKPOINT_ASM to generate a SIGILL instead of a SIGTRAP.
diffstat:
sys/arch/arm/include/ptrace.h | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diffs (24 lines):
diff -r 48ee32cb51b5 -r 5084b01627c4 sys/arch/arm/include/ptrace.h
--- a/sys/arch/arm/include/ptrace.h Wed Dec 27 19:20:41 2017 +0000
+++ b/sys/arch/arm/include/ptrace.h Wed Dec 27 19:35:05 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ptrace.h,v 1.11 2017/04/12 18:17:59 kamil Exp $ */
+/* $NetBSD: ptrace.h,v 1.12 2017/12/27 19:35:05 christos Exp $ */
/*
* Copyright (c) 1995 Frank Lancaster
@@ -64,7 +64,12 @@
#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, 0xfe })
-#define PTRACE_BREAKPOINT_INSN 0xe7fffffe
+#ifdef __ARMEB__
+#define PTRACE_BREAKPOINT ((const uint8_t[]) { 0xfe, 0xde, 0xff, 0xe7 })
+#define PTRACE_BREAKPOINT_INSN 0xfedeffe7
+#else
+#define PTRACE_BREAKPOINT ((const uint8_t[]) { 0xe7, 0xff, 0xde, 0xfe })
+#define PTRACE_BREAKPOINT_INSN 0xe7ffdefe
+#endif
#define PTRACE_BREAKPOINT_ASM __asm __volatile (".word " ___STRING(PTRACE_BREAKPOINT_INSN) )
#define PTRACE_BREAKPOINT_SIZE 4
Home |
Main Index |
Thread Index |
Old Index