summaryrefslogtreecommitdiff
path: root/sys/ddb/db_break.c
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>1997-07-23 23:34:47 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>1997-07-23 23:34:47 +0000
commit372b574ccd70422b9d3d91755925c9cf3e09f2f3 (patch)
treedb6c8f68a419243bd2ddc112a1632ac573d527bd /sys/ddb/db_break.c
parent7d82bb9771786253fed0e0d05424c14d1cade241 (diff)
Support an DB_VALID_BREAKPOINT option for validation of breakpoints.
This can be very important in SOFTWARE_SSTEP systems as single stepping otherwise frequently hoses the machine when trying to step through paths used ny DDB itself.
Diffstat (limited to 'sys/ddb/db_break.c')
-rw-r--r--sys/ddb/db_break.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/sys/ddb/db_break.c b/sys/ddb/db_break.c
index 1e289552455..2174886600a 100644
--- a/sys/ddb/db_break.c
+++ b/sys/ddb/db_break.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_break.c,v 1.5 1997/07/19 22:31:16 niklas Exp $ */
+/* $OpenBSD: db_break.c,v 1.6 1997/07/23 23:34:46 niklas Exp $ */
/* $NetBSD: db_break.c,v 1.7 1996/03/30 22:30:03 christos Exp $ */
/*
@@ -92,6 +92,13 @@ db_set_breakpoint(map, addr, count)
return;
}
+#ifdef DB_VALID_BREAKPOINT
+ if (!DB_VALID_BREAKPOINT(addr)) {
+ db_printf("Not a valid address for a breakpoint.\n");
+ return;
+ }
+#endif
+
bkpt = db_breakpoint_alloc();
if (bkpt == 0) {
db_printf("Too many breakpoints.\n");
@@ -210,10 +217,17 @@ db_set_temp_breakpoint(addr)
{
db_breakpoint_t bkpt;
+#ifdef DB_VALID_BREAKPOINT
+ if (!DB_VALID_BREAKPOINT(addr)) {
+ db_printf("Not a valid address for a breakpoint.\n");
+ return (0);
+ }
+#endif
+
bkpt = db_breakpoint_alloc();
if (bkpt == 0) {
db_printf("Too many breakpoints.\n");
- return 0;
+ return (0);
}
bkpt->map = NULL;