aboutsummaryrefslogtreecommitdiff
path: root/sys/ddb
diff options
context:
space:
mode:
authorBruce Evans <bde@FreeBSD.org>2016-09-17 11:43:51 +0000
committerBruce Evans <bde@FreeBSD.org>2016-09-17 11:43:51 +0000
commite1e554a382c4d213323b27f1609d4a19c5ba7472 (patch)
tree53cdf25677e2e3b058d5125b61cc173004662eca /sys/ddb
parentede2869c4c315a067320d6e56aea46f2973df928 (diff)
Notes
Diffstat (limited to 'sys/ddb')
-rw-r--r--sys/ddb/db_run.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/sys/ddb/db_run.c b/sys/ddb/db_run.c
index 8cfcfc7fdfcd..4ffba48583b8 100644
--- a/sys/ddb/db_run.c
+++ b/sys/ddb/db_run.c
@@ -136,21 +136,29 @@ db_stop_at_pc(int type, int code, bool *is_breakpoint, bool *is_watchpoint)
*is_breakpoint = false; /* might be a breakpoint, but not ours */
/*
+ * If not stepping, then silently ignore single-step traps
+ * (except for clearing the single-step-flag above).
+ *
* If stepping, then abort if the trap type is unexpected.
* Breakpoints owned by us are expected and were handled above.
* Single-steps are expected and are handled below. All others
* are unexpected.
*
- * If the MD layer doesn't tell us when it is stepping, use the
- * bad historical default that all unexepected traps.
+ * Only do either of these if the MD layer claims to classify
+ * single-step traps unambiguously (by defining IS_SSTEP_TRAP).
+ * Otherwise, fall through to the bad historical behaviour
+ * given by turning unexpected traps into expected traps: if not
+ * stepping, then expect only breakpoints and stop, and if
+ * stepping, then expect only single-steps and step.
*/
-#ifndef IS_SSTEP_TRAP
-#define IS_SSTEP_TRAP(type, code) true
-#endif
+#ifdef IS_SSTEP_TRAP
+ if (db_run_mode == STEP_CONTINUE && IS_SSTEP_TRAP(type, code))
+ return (false);
if (db_run_mode != STEP_CONTINUE && !IS_SSTEP_TRAP(type, code)) {
printf("Stepping aborted\n");
return (true);
}
+#endif
if (db_run_mode == STEP_INVISIBLE) {
db_run_mode = STEP_CONTINUE;