aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Thompson <daniel.thompson@linaro.org>2014-09-11 09:58:29 +0100
committerDaniel Thompson <daniel.thompson@linaro.org>2015-02-06 10:33:03 +0000
commit8920c1212290cfb2edf2c74aeeac6720954644f7 (patch)
tree9228b8a93299e05b447e3403ef4b6e78212c36c1
parentebbcda3846c98c927b03379fb62e73c7c94c8e80 (diff)
downloadlinux-8920c1212290cfb2edf2c74aeeac6720954644f7.tar.gz
kdb: Fix a prompt management bug when using | grep
Currently when the "| grep" feature is used to filter the output of a command then the prompt is not displayed for the subsequent command. Likewise any characters typed by the user are also not echoed to the display. This rather disconcerting problem eventually corrects itself when the user presses Enter and the kdb_grepping_flag is cleared as kdb_parse() tries to make sense of whatever they typed. This patch resolves the problem by moving the clearing of this flag from the middle of command processing to the beginning. Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
-rw-r--r--kernel/debug/kdb/kdb_main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c
index 31ca5dab66de..0e31e88e99e7 100644
--- a/kernel/debug/kdb/kdb_main.c
+++ b/kernel/debug/kdb/kdb_main.c
@@ -915,13 +915,12 @@ int kdb_parse(const char *cmdstr)
char *cp;
char *cpp, quoted;
kdbtab_t *tp;
- int i, escaped, ignore_errors = 0, check_grep;
+ int i, escaped, ignore_errors = 0, check_grep = 0;
/*
* First tokenize the command string.
*/
cp = (char *)cmdstr;
- kdb_grepping_flag = check_grep = 0;
if (KDB_FLAG(CMD_INTERRUPT)) {
/* Previous command was interrupted, newline must not
@@ -1280,6 +1279,7 @@ static int kdb_local(kdb_reason_t reason, int error, struct pt_regs *regs,
*/
kdb_nextline = 1;
KDB_STATE_CLEAR(SUPPRESS);
+ kdb_grepping_flag = 0;
cmdbuf = cmd_cur;
*cmdbuf = '\0';