Commit e612f1ce authored by Randy Dunlap's avatar Randy Dunlap Committed by Greg Kroah-Hartman

kdb: make "mdr" command repeat

[ Upstream commit 1e0ce03b ]

The "mdr" command should repeat (continue) when only Enter/Return
is pressed, so make it do so.
Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
Cc: Daniel Thompson <daniel.thompson@linaro.org>
Cc: Jason Wessel <jason.wessel@windriver.com>
Cc: kgdb-bugreport@lists.sourceforge.net
Signed-off-by: default avatarJason Wessel <jason.wessel@windriver.com>
Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 803f7f38
...@@ -1564,6 +1564,7 @@ static int kdb_md(int argc, const char **argv) ...@@ -1564,6 +1564,7 @@ static int kdb_md(int argc, const char **argv)
int symbolic = 0; int symbolic = 0;
int valid = 0; int valid = 0;
int phys = 0; int phys = 0;
int raw = 0;
kdbgetintenv("MDCOUNT", &mdcount); kdbgetintenv("MDCOUNT", &mdcount);
kdbgetintenv("RADIX", &radix); kdbgetintenv("RADIX", &radix);
...@@ -1573,9 +1574,10 @@ static int kdb_md(int argc, const char **argv) ...@@ -1573,9 +1574,10 @@ static int kdb_md(int argc, const char **argv)
repeat = mdcount * 16 / bytesperword; repeat = mdcount * 16 / bytesperword;
if (strcmp(argv[0], "mdr") == 0) { if (strcmp(argv[0], "mdr") == 0) {
if (argc != 2) if (argc == 2 || (argc == 0 && last_addr != 0))
valid = raw = 1;
else
return KDB_ARGCOUNT; return KDB_ARGCOUNT;
valid = 1;
} else if (isdigit(argv[0][2])) { } else if (isdigit(argv[0][2])) {
bytesperword = (int)(argv[0][2] - '0'); bytesperword = (int)(argv[0][2] - '0');
if (bytesperword == 0) { if (bytesperword == 0) {
...@@ -1611,7 +1613,10 @@ static int kdb_md(int argc, const char **argv) ...@@ -1611,7 +1613,10 @@ static int kdb_md(int argc, const char **argv)
radix = last_radix; radix = last_radix;
bytesperword = last_bytesperword; bytesperword = last_bytesperword;
repeat = last_repeat; repeat = last_repeat;
mdcount = ((repeat * bytesperword) + 15) / 16; if (raw)
mdcount = repeat;
else
mdcount = ((repeat * bytesperword) + 15) / 16;
} }
if (argc) { if (argc) {
...@@ -1628,7 +1633,10 @@ static int kdb_md(int argc, const char **argv) ...@@ -1628,7 +1633,10 @@ static int kdb_md(int argc, const char **argv)
diag = kdbgetularg(argv[nextarg], &val); diag = kdbgetularg(argv[nextarg], &val);
if (!diag) { if (!diag) {
mdcount = (int) val; mdcount = (int) val;
repeat = mdcount * 16 / bytesperword; if (raw)
repeat = mdcount;
else
repeat = mdcount * 16 / bytesperword;
} }
} }
if (argc >= nextarg+1) { if (argc >= nextarg+1) {
...@@ -1638,8 +1646,15 @@ static int kdb_md(int argc, const char **argv) ...@@ -1638,8 +1646,15 @@ static int kdb_md(int argc, const char **argv)
} }
} }
if (strcmp(argv[0], "mdr") == 0) if (strcmp(argv[0], "mdr") == 0) {
return kdb_mdr(addr, mdcount); int ret;
last_addr = addr;
ret = kdb_mdr(addr, mdcount);
last_addr += mdcount;
last_repeat = mdcount;
last_bytesperword = bytesperword; // to make REPEAT happy
return ret;
}
switch (radix) { switch (radix) {
case 10: case 10:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment