linux/kernel/debug
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
..
kdb kdb: Fix pager search for multi-line strings 2020-10-29 09:57:51 +01:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
debug_core.c kgdb: Avoid suspicious RCU usage warning 2020-07-09 09:37:51 +02:00
debug_core.h kgdb: Don't round up a CPU that failed rounding up before 2018-12-30 08:29:13 +00:00
gdbstub.c gdbstub: Replace strcpy() by strscpy() 2019-05-02 13:40:27 +01:00