Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F134670686
D15191.id44979.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D15191.id44979.diff
View Options
Index: head/sys/arm/include/cpufunc.h
===================================================================
--- head/sys/arm/include/cpufunc.h
+++ head/sys/arm/include/cpufunc.h
@@ -54,7 +54,7 @@
static __inline void
breakpoint(void)
{
- __asm(".word 0xe7ffffff");
+ __asm("udf 0xffff");
}
struct cpu_functions {
@@ -494,6 +494,19 @@
extern u_int arm_cache_level;
extern u_int arm_cache_loc;
extern u_int arm_cache_type[14];
+
+#else /* !_KERNEL */
+
+static __inline void
+breakpoint(void)
+{
+
+ /*
+ * This matches the instruction used by GDB for software
+ * breakpoints.
+ */
+ __asm("udf 0xfdee");
+}
#endif /* _KERNEL */
#endif /* _MACHINE_CPUFUNC_H_ */
Index: head/sys/arm64/include/cpufunc.h
===================================================================
--- head/sys/arm64/include/cpufunc.h
+++ head/sys/arm64/include/cpufunc.h
@@ -29,18 +29,18 @@
#ifndef _MACHINE_CPUFUNC_H_
#define _MACHINE_CPUFUNC_H_
-#ifdef _KERNEL
-
-#include <machine/armreg.h>
-
-void pan_enable(void);
-
static __inline void
breakpoint(void)
{
__asm("brk #0");
}
+
+#ifdef _KERNEL
+
+#include <machine/armreg.h>
+
+void pan_enable(void);
static __inline register_t
dbg_disable(void)
Index: head/tests/sys/kern/ptrace_test.c
===================================================================
--- head/tests/sys/kern/ptrace_test.c
+++ head/tests/sys/kern/ptrace_test.c
@@ -54,8 +54,9 @@
/*
* Architectures with a user-visible breakpoint().
*/
-#if defined(__amd64__) || defined(__i386__) || defined(__mips__) || \
- defined(__riscv) || defined(__sparc64__)
+#if defined(__aarch64__) || defined(__amd64__) || defined(__arm__) || \
+ defined(__i386__) || defined(__mips__) || defined(__riscv) || \
+ defined(__sparc64__)
#define HAVE_BREAKPOINT
#endif
@@ -63,8 +64,12 @@
* Adjust PC to skip over a breakpoint when stopped for a breakpoint trap.
*/
#ifdef HAVE_BREAKPOINT
-#if defined(__amd64__) || defined(__i386__)
+#if defined(__aarch64__)
+#define SKIP_BREAK(reg) ((reg)->elr += 4)
+#elif defined(__amd64__) || defined(__i386__)
#define SKIP_BREAK(reg)
+#elif defined(__arm__)
+#define SKIP_BREAK(reg) ((reg)->r_pc += 4)
#elif defined(__mips__)
#define SKIP_BREAK(reg) ((reg)->r_regs[PC] += 4)
#elif defined(__riscv)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 4, 11:17 PM (11 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
24787266
Default Alt Text
D15191.id44979.diff (2 KB)
Attached To
Mode
D15191: Export a breakpoint() function to userland.
Attached
Detach File
Event Timeline
Log In to Comment