summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeal H. Walfield <neal@gnu.org>2009-02-24 04:06:18 +0100
committerNeal H. Walfield <neal@gnu.org>2009-03-01 21:03:11 +0100
commit130be8503f68a0a0b46cdf09b8fd055bfb50a47c (patch)
treeea7fb5d95c5e8a345416cfafdf2b993c35f94227
parentc375a71efab7350a4febb0186cd95362b4231cf3 (diff)
Disable hardware breakpoints when compled with NDEBUG.
-rw-r--r--viengoos/sysdeps/x86_64/thread-arch.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/viengoos/sysdeps/x86_64/thread-arch.c b/viengoos/sysdeps/x86_64/thread-arch.c
index 168620c..d4c5cda 100644
--- a/viengoos/sysdeps/x86_64/thread-arch.c
+++ b/viengoos/sysdeps/x86_64/thread-arch.c
@@ -6,6 +6,7 @@
#include "debug.h"
#include "activity.h"
+#ifndef NDEBUG
static void
breakpoint (int argc, char *argv[])
{
@@ -101,11 +102,14 @@ static struct debug_command breakpoint_command =
"Set a hardware breakpoint at an address for a thread ([thread] addr).",
(void (*) (int, char *[])) breakpoint,
};
+#endif
void
thread_arch_bootstrap (void)
{
+#ifndef NDEBUG
debug_register (&breakpoint_command);
+#endif
}
void
@@ -186,6 +190,7 @@ thread_resume (void)
[gs] "i" (SEGSEL_GS)
: "rbx");
+#ifndef NDEBUG
if (current_thread->debugging_enabled)
{
struct dr7
@@ -273,6 +278,7 @@ thread_resume (void)
uintptr_t disable = 0;
asm ("mov %0, %%dr7" : : "r" (disable));
}
+#endif
if (current_thread->regs_restore_all)
{