Skip to content

Commit ab08e46

Browse files
Daniel Thompsonjwessel
authored andcommitted
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> Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
1 parent 5454388 commit ab08e46

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎kernel/debug/kdb/kdb_main.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -915,13 +915,12 @@ int kdb_parse(const char *cmdstr)
915915
char *cp;
916916
char *cpp, quoted;
917917
kdbtab_t *tp;
918-
int i, escaped, ignore_errors = 0, check_grep;
918+
int i, escaped, ignore_errors = 0, check_grep = 0;
919919

920920
/*
921921
* First tokenize the command string.
922922
*/
923923
cp = (char *)cmdstr;
924-
kdb_grepping_flag = check_grep = 0;
925924

926925
if (KDB_FLAG(CMD_INTERRUPT)) {
927926
/* 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,
12801279
*/
12811280
kdb_nextline = 1;
12821281
KDB_STATE_CLEAR(SUPPRESS);
1282+
kdb_grepping_flag = 0;
12831283

12841284
cmdbuf = cmd_cur;
12851285
*cmdbuf = '\0';

0 commit comments

Comments
 (0)