mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-18 21:27:56 +00:00
Let GDB monitor use HLT for breakpoints, fix #83
The patch fixes a corner-case problem with using the two-byte 'INT 0' instruction for breakpoints. The fix changes the breakpoint instruction to the single-byte 'HLT'. 'HLT' is a privileged instruction and triggers an exception when executed in user mode. Patch by Christian Prochaska.
This commit is contained in:
parent
441d672440
commit
cc85dc8afb
@ -584,18 +584,23 @@ diff --git a/gdb/gdbserver/linux-x86-low.c b/gdb/gdbserver/linux-x86-low.c
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -414,8 +443,8 @@
|
||||
@@ -414,7 +443,15 @@
|
||||
}
|
||||
}
|
||||
|
||||
-static const unsigned char x86_breakpoint[] = { 0xCC };
|
||||
-#define x86_breakpoint_len 1
|
||||
+static const unsigned char x86_breakpoint[] = { /*0xCC*/0xCD, 0x00 };
|
||||
+#define x86_breakpoint_len 2
|
||||
+#ifdef __GENODE__
|
||||
+/* The 'INT3' instruction is used by some kernel debuggers and thus cannot
|
||||
+ * serve as breakpoint instruction for the GDB monitor. Instead, the 'HLT'
|
||||
+ * instruction gets used. It's a privileged instruction which triggers an
|
||||
+ * exception when executed in user mode */
|
||||
+static const unsigned char x86_breakpoint[] = { 0xF4 };
|
||||
+#else
|
||||
static const unsigned char x86_breakpoint[] = { 0xCC };
|
||||
+#endif
|
||||
#define x86_breakpoint_len 1
|
||||
|
||||
static int
|
||||
x86_breakpoint_at (CORE_ADDR pc)
|
||||
@@ -2576,7 +2605,7 @@
|
||||
@@ -2576,7 +2613,7 @@
|
||||
x86_siginfo_fixup,
|
||||
x86_linux_new_process,
|
||||
x86_linux_new_thread,
|
||||
|
Loading…
Reference in New Issue
Block a user