summaryrefslogtreecommitdiffstats
path: root/sys/ddb
diff options
context:
space:
mode:
authormdf <mdf@FreeBSD.org>2011-02-18 22:25:11 +0000
committermdf <mdf@FreeBSD.org>2011-02-18 22:25:11 +0000
commitbaf9dec697b13c0c3c2739e4d76b03367f062228 (patch)
tree46e277fb34fa25a6bc0562a2934616b700f3f6f8 /sys/ddb
parent699ef3129bdda98a0a0164e4d221a0273dfc24d8 (diff)
downloadFreeBSD-src-baf9dec697b13c0c3c2739e4d76b03367f062228.zip
FreeBSD-src-baf9dec697b13c0c3c2739e4d76b03367f062228.tar.gz
Modify kdb_trap() so that it re-calls the dbbe_trap function as long as
the debugger back-end has changed. This means that switching from ddb to gdb no longer requires a "step" which can be dangerous on an already-crashed kernel. Also add a capability to get from the gdb back-end back to ddb, by typing ^C in the console window. While here, simplify kdb_sysctl_available() by using sbuf_new_for_sysctl(), and use strlcpy() instead of strncpy() since the strlcpy semantic is desired. MFC after: 1 month
Diffstat (limited to 'sys/ddb')
-rw-r--r--sys/ddb/db_command.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/ddb/db_command.c b/sys/ddb/db_command.c
index 7fab5c2..ba9c094 100644
--- a/sys/ddb/db_command.c
+++ b/sys/ddb/db_command.c
@@ -723,10 +723,16 @@ static void
db_gdb(db_expr_t dummy1, boolean_t dummy2, db_expr_t dummy3, char *dummy4)
{
- if (kdb_dbbe_select("gdb") != 0)
+ if (kdb_dbbe_select("gdb") != 0) {
db_printf("The remote GDB backend could not be selected.\n");
- else
- db_printf("Step to enter the remote GDB backend.\n");
+ return;
+ }
+ /*
+ * Mark that we are done in the debugger. kdb_trap()
+ * should re-enter with the new backend.
+ */
+ db_cmd_loop_done = 1;
+ db_printf("(ctrl-c will return control to ddb)\n");
}
static void
OpenPOWER on IntegriCloud