From 372b574ccd70422b9d3d91755925c9cf3e09f2f3 Mon Sep 17 00:00:00 2001 From: Niklas Hallqvist Date: Wed, 23 Jul 1997 23:34:47 +0000 Subject: 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. --- sys/ddb/db_break.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'sys/ddb/db_break.c') 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; -- cgit v1.2.3