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:
trasz 2017-11-30 12:22:15 +00:00
parent 923fadf4e8
commit 410d6f52ca

View File

@ -134,6 +134,17 @@ db_set_cmd(db_expr_t dummy1, bool dummy2, db_expr_t dummy3, char *dummy4)
int t; int t;
t = db_read_token(); 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) { if (t != tDOLLAR) {
db_error("Unknown variable\n"); db_error("Unknown variable\n");
return; return;