diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1997-07-23 23:31:12 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1997-07-23 23:31:12 +0000 |
commit | a9b3a5a27b12287e80b59fd2ad43778db2b39de3 (patch) | |
tree | c32691c1c68030fcda23bcc99842fdca573535ec /sys/arch | |
parent | 6795034d67a953224bcd5c420617fc79a5b32c6c (diff) |
Pretty + validation routine for breakpoints
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/alpha/alpha/db_interface.c | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/sys/arch/alpha/alpha/db_interface.c b/sys/arch/alpha/alpha/db_interface.c index 3c1148936df..d180b68207e 100644 --- a/sys/arch/alpha/alpha/db_interface.c +++ b/sys/arch/alpha/alpha/db_interface.c @@ -1,4 +1,4 @@ -/* $OpenBSD: db_interface.c,v 1.7 1997/07/19 20:54:28 niklas Exp $ */ +/* $OpenBSD: db_interface.c,v 1.8 1997/07/23 23:31:11 niklas Exp $ */ /* * Copyright (c) 1997 Niklas Hallqvist. All rights reserverd. @@ -154,7 +154,7 @@ kdbprinttrap(type, code) } /* - * kdb_trap - field a TRACE or BPT trap + * kdb_trap - field a BPT trap */ int kdb_trap(type, code, regs) @@ -180,10 +180,6 @@ kdb_trap(type, code, regs) /* XXX Should switch to kdb`s own stack here. */ ddb_regs = *regs; -#if 0 - db_printf("db_regs at %p\n", regs); - ddb_regs.tf_regs[FRAME_SP] = (u_long)regs + FRAME_SIZE*8; -#endif s = splhigh(); db_active++; @@ -268,3 +264,21 @@ next_instr_address(pc, branch) return (pc + sizeof(int)); return (branch_taken(*(u_int *)pc, pc, getreg_val, DDB_REGS)); } + +/* + * Validate an address for use as a breakpoint. We cannot let some + * addresses have breakpoints as the ddb code itself uses that codepath. + * Recursion and kernel stack space exhaustion will follow. + */ +int +db_valid_breakpoint(addr) + db_addr_t addr; +{ + char *name; + db_expr_t offset; + + db_find_sym_and_offset(addr, &name, &offset); + if (name && strcmp(name, "alpha_pal_swpipl") == 0) + return (0); + return (1); +} |