From: "Doug Evans" <dje@google.com>
To: "Eli Zaretskii" <eliz@gnu.org>
Cc: gdb-patches@sourceware.org, pkoning@equallogic.com
Subject: Re: RFC: new command to search memory
Date: Wed, 30 Jan 2008 18:10:00 -0000 [thread overview]
Message-ID: <e394668d0801301006k3a98aaa3ie78bf0c140394d60@mail.gmail.com> (raw)
In-Reply-To: <utzkxk9hf.fsf@gnu.org>
On Jan 28, 2008 11:58 AM, Eli Zaretskii <eliz@gnu.org> wrote:
> > +@table @code
> > +
> > +@kindex find
> > +@item find @r{[}/@var{size}@r{]} @r{[}/@var{max_count}@r{]} @var{start_addr}, @@@var{len}, @var{val1} @r{[}, @var{val2}, ...@r{]}
> > +@itemx find @r{[}/@var{size}@r{]} @r{[}/@var{max_count}@r{]} @var{start_addr}, @var{end_addr}, @var{val1} @r{[}, @var{val2}, ...@r{]}
>
> These two lines are two long, and since they are in @code, TeX will
> not wrap them, and they will overflow the page margins in print. So
> please make them shorter somehow. Here's one idea:
>
> @item find @r{[}/@var{options} @var{where} @dots{}
>
> and then describe ``options'' and ``where'' separately.
>
> Also, please use @dots{} instead of literal "...", the former looks
> better in print.
>
> > +@var{size} specifies how to interpret the search pattern and is
> > +'b' for 8-bit values, 'h' for 16-bit values, 'w' for 32-bit values,
>
> Please use @samp{b}, @samp{h} etc.
Righto.
> +Strings may be specified for search values, quote them normally.
>
> Is this language-dependent? If not, then ``normally'' doesn't really
> cut it; please describe specifically how to quote.
The string is not language dependent. I guess it could be, but I'm
not sure there's sufficient value here. Consider the printf command.
One thing that might be useful is to merge the respective string
parsing in each command (assuming they take equivalent strings).
> > +The string value is copied into the search pattern byte by byte,
> > +regardless of the endianness of the target and the size specification.
>
> This begs the question: what about non-printable characters? are they
> supported, and if so, how?
The string parser uses parse_escape so they can be embedded in the
string. One can also do it this way:
find /b mumble, "search string ", 1, 127, 253, " with embedded
non-printable characters"
find mumble, "search string ", (char) 1, (char) 127, (char) 253, "with
embedded non-printable characters"
I can update the docs on what the string may contain.
> > +The address of the last value found is stored in convenience variable
> > +@samp{$numfound}.
> > +A count of the number of matches is stored in @samp{$_}.
>
> Your example has this the other way around (and so does the code,
> IIUC):
Oops, thanks for catching that.
> > +@item qSearch:memory:@var{address};@var{length};@var{search-pattern}
> > +@cindex search memory
>
> You already have "@cindex searching memory" where you describe `find',
> so this almost identical index entry in a totally different place
> would be confusing: the reader will not know which entry is relevant
> for them. I suggest this instead:
>
> @cindex searching memory, in remote debugging
>
> > +@cindex @samp{qSearch:memory} packet
> > +@anchor{qSearch memory}
> > +Search LENGTH bytes at ADDRESS for SEARCH-PATTERN.
> > +ADDRESS and LENGTH are encoded in hex.
> > +SEARCH-PATTERN is a sequence of bytes, hex encoded.
> > +
> > +Reply:
> > +@table @samp
> > +@item 0
> > +The pattern was not found.
> > +@item 1,address
> > +The pattern was found at ADDRESS.
>
> This should use @var{length}, @var{address}, instead of LENGTH,
> ADDRESS, etc.: in lower-case and in @var.
Righto.
next prev parent reply other threads:[~2008-01-30 18:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-15 22:15 Doug Evans
2008-01-28 18:15 ` Doug Evans
2008-01-28 20:26 ` Eli Zaretskii
2008-01-30 18:10 ` Doug Evans [this message]
2008-01-30 18:33 ` Eli Zaretskii
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=e394668d0801301006k3a98aaa3ie78bf0c140394d60@mail.gmail.com \
--to=dje@google.com \
--cc=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=pkoning@equallogic.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox