All of lore.kernel.org
 help / color / mirror / Atom feed
From: Doug Anderson <dianders@chromium.org>
To: Daniel Thompson <daniel.thompson@linaro.org>
Cc: Jason Wessel <jason.wessel@windriver.com>,
	kgdb-bugreport@lists.sourceforge.net,
	LKML <linux-kernel@vger.kernel.org>,
	Patch Tracking <patches@linaro.org>
Subject: Re: [PATCH] kdb: Fix pager search for multi-line strings
Date: Mon, 14 Sep 2020 16:13:56 -0700	[thread overview]
Message-ID: <CAD=FV=WqDpBj5YeQ6G+QeBbxwNDsn7HMAZJA297ATc26FTA_=A@mail.gmail.com> (raw)
In-Reply-To: <20200909141708.338273-1-daniel.thompson@linaro.org>

Hi,

On Wed, Sep 9, 2020 at 7:18 AM Daniel Thompson
<daniel.thompson@linaro.org> wrote:
>
> 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
> acordingly.
>
> Fixes: fb6daa7520f9d ("kdb: Provide forward search at more prompt")
> Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
> ---
>
> Notes:
>     In the long term the kdb pager code would probably benefit from a
>     bigger rewrite since the way it handles newlines is still quirky
>     and confusing. However this fix is easy to backport so I decided
>     not to hold it back whilst we wait for code that is not yet
>     written.
>
>  kernel/debug/kdb/kdb_io.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)

Wow, more kdb functionality that I never knew anything about!  Seems
like a reasonable fix to me even if I agree that the code could use a
bigger cleanup.

Reviewed-by: Douglas Anderson <dianders@chromium.org>

      reply	other threads:[~2020-09-14 23:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-09 14:17 [PATCH] kdb: Fix pager search for multi-line strings Daniel Thompson
2020-09-14 23:13 ` Doug Anderson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAD=FV=WqDpBj5YeQ6G+QeBbxwNDsn7HMAZJA297ATc26FTA_=A@mail.gmail.com' \
    --to=dianders@chromium.org \
    --cc=daniel.thompson@linaro.org \
    --cc=jason.wessel@windriver.com \
    --cc=kgdb-bugreport@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.