Make the ddb(4) "set" command list variables when called without parameters.

Obtained from:	CheriBSD
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
This commit is contained in:
Edward Tomasz Napierala 2017-11-30 12:22:15 +00:00
parent b58e7aacf6
commit 2276703108

View File

@ -134,6 +134,17 @@ db_set_cmd(db_expr_t dummy1, bool dummy2, db_expr_t dummy3, char *dummy4)
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;