linux/kernel/debug/kdb
Daniel Thompson e8b33f91ce 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-30 10:38:20 +01:00
..
.gitignore
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 2019-02-12 19:47:19 +01:00
kdb_cmds
kdb_debugger.c kdb: Don't back trace on a cpu that didn't round up 2019-02-12 19:47:19 +01:00
kdb_io.c kdb: Fix pager search for multi-line strings 2020-10-30 10:38:20 +01:00
kdb_keyboard.c
kdb_main.c kdb: do a sanity check on the cpu in kdb_per_cpu() 2020-01-27 14:50:48 +01:00
kdb_private.h kdb: Use strscpy with destination buffer size 2018-12-01 09:37:33 +01:00
kdb_support.c kdb: Use strscpy with destination buffer size 2018-12-01 09:37:33 +01:00
Makefile