1
0
Fork 0
alistair23-linux/kernel/debug/kdb
Daniel Thompson de47278648 kdb: Fix pager search for multi-line strings
[ Upstream commit d081a6e353 ]

Currently using forward search doesn't handle multi-line strings correctly.
The search routine replaces line breaks with \0 during the search and, for
regular searches ("help | grep Common\n"), there is code after the line
has been discarded or printed to replace the break character.

However during a pager search ("help\n" followed by "/Common\n") when the
string is matched we will immediately return to normal output and the code
that should restore the \n becomes unreachable. Fix this by restoring the
replaced character when we disable the search mode and update the comment
accordingly.

Fixes: fb6daa7520 ("kdb: Provide forward search at more prompt")
Link: https://lore.kernel.org/r/20200909141708.338273-1-daniel.thompson@linaro.org
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-10-29 09:57:51 +01:00
..
.gitignore kdb: core for kgdb back end (1 of 2) 2010-05-20 21:04:20 -05:00
Makefile kdb: Get rid of broken attempt to print CCVERSION in kdb summary 2019-05-12 09:50:43 +01:00
kdb_bp.c kdb: bl: don't use tab character in output 2018-01-25 08:41:22 -06:00
kdb_bt.c kdb: Don't back trace on a cpu that didn't round up 2018-12-30 08:31:23 +00:00
kdb_cmds kdb: cleanup unused variables missed in the original kdb merge 2011-08-01 13:23:58 -05:00
kdb_debugger.c kdb: Don't back trace on a cpu that didn't round up 2018-12-30 08:31:23 +00:00
kdb_io.c kdb: Fix pager search for multi-line strings 2020-10-29 09:57:51 +01:00
kdb_keyboard.c kdb: kdb_keyboard: mark expected switch fall-throughs 2018-11-13 20:38:50 +00:00
kdb_main.c kdb: Replace strncmp with str_has_prefix 2019-09-03 11:19:31 +01:00
kdb_private.h kdb: Use strscpy with destination buffer size 2018-11-13 20:27:53 +00:00
kdb_support.c kdb: kdb_support: replace strcpy() by strscpy() 2019-05-02 13:42:01 +01:00