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;
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to