Pass the trap type and code down from db_trap() to db_stop_at_pc() so
authorbde <bde@FreeBSD.org>
Fri, 9 Sep 2016 15:53:42 +0000 (15:53 +0000)
committerbde <bde@FreeBSD.org>
Fri, 9 Sep 2016 15:53:42 +0000 (15:53 +0000)
commit8f0c2a62aaf2eb6b491081c5a93181ecd50ace59
tree9d27fa8db9137f99981d5edd9e5908cc8245d039
parent763f29a74b62f8d2582f6b92ae9301c869e7c249
Pass the trap type and code down from db_trap() to db_stop_at_pc() so
that the latter can easily determine what the trap type actually is
after callers are fixed to encode the type unambigously.

ddb currently barely understands breakpoints, and it treats all
non-breakpoints as single-step traps.  This works OK for stopping
after every instruction when single-stepping, but is broken for
single-stepping with a count > 1 (especially with a large count).
ddb needs to stop on the first non-single-step trap while single-
stepping.  Otherwise, ddb doesn't even stop the first time for
fatal traps and external breakpoints like the one in kdb_enter().
sys/ddb/db_main.c
sys/ddb/db_run.c
sys/ddb/ddb.h