Date: Thu, 30 Nov 2017 12:22:16 +0000 (UTC) From: Edward Tomasz Napierala <trasz@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326393 - head/sys/ddb Message-ID: <201711301222.vAUCMGsG086159@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: trasz Date: Thu Nov 30 12:22:15 2017 New Revision: 326393 URL: https://svnweb.freebsd.org/changeset/base/326393 Log: Make the ddb(4) "set" command list variables when called without parameters. Obtained from: CheriBSD MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/sys/ddb/db_variables.c Modified: head/sys/ddb/db_variables.c ============================================================================== --- head/sys/ddb/db_variables.c Thu Nov 30 11:35:22 2017 (r326392) +++ head/sys/ddb/db_variables.c Thu Nov 30 12:22:15 2017 (r326393) @@ -134,6 +134,17 @@ db_set_cmd(db_expr_t dummy1, bool dummy2, db_expr_t du int t; t = db_read_token(); + if (t == tEOL) { + for (vp = db_vars; vp < db_evars; vp++) { + if (!db_read_variable(vp, &value)) { + db_printf("$%s\n", vp->name); + continue; + } + db_printf("$%-8s = %ld\n", + vp->name, (unsigned long)value); + } + return; + } if (t != tDOLLAR) { db_error("Unknown variable\n"); return;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201711301222.vAUCMGsG086159>