Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Doug Evans <dje@google.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA] new command to search memory
Date: Fri, 29 Feb 2008 03:58:00 -0000	[thread overview]
Message-ID: <20080229031252.GA2897@caradoc.them.org> (raw)
In-Reply-To: <e394668d0802281844q23f860e7hd4ee9977fdf9b4b3@mail.gmail.com>

On Thu, Feb 28, 2008 at 06:44:00PM -0800, Doug Evans wrote:
> >  The slashed arguments work analagously to x and display, which is
> >  nice.  Should the default count should be one instead of infinity?
> >  I suppose having it default to infinity is nice, since we don't
> >  have to invent a syntax for infinity that way.
> 
> /u or some such for "unlimited" would work I guess.  I can change the
> default if that's preferable.

I think it's fine the way you've got it.

> >  What do you think of "+" instead of "@" to distinguish lengths?  "find
> >  &hello[0] +0x100".
> 
> I picked "@" because it's used, for example, in "p foo[0]@10".  It's
> not identical, but it seemed similar enough.  "+" works too.

I'd prefer +, if that works for you.

> Ya, but for completeness sake it's not just the malloc call, it's the
> whole shebang.  I can understand why in
> 
> (gdb) p strcmp (foo, "bar")
> 
> one wants to download "bar" to the target before calling strcmp, but
> find's needs are different.

Right.  I've got a patch to cover the downloading.  I didn't get it
posted yet but it hasn't dropped off my list for this week either.

> >  qSearch:memory does not need to be advertised for qSupported.  The
> >  rule of thumb is that things which are used to implement a user
> >  command don't need to be, since there's no big penalty if we try them
> >  and are told they are not supported - we'll just try another approach
> >  and next time we'll know.  That means you need to handle
> >  PACKET_DISABLE twice, before and after sending the packet.
> 
> I found a use for the option that goes with qSupported both for
> testing and analysis.  Maybe users would also find use for the choice,
> but it can be tossed.

The option isn't actually linked to qSupported; you can add just the
option, and it will default to auto.

> >  > +If the value size is not specified, it is taken from the
> >  > +value's type.  This is useful when one wants to specify the search
> >  > +pattern as a mixture of types.
> >
> >  IMO this will confuse users for constants, which have type int (or
> >  sometimes long), so could you add a word about that?  Otherwise
> >  someone will type "find &hello[0], @100, 0x65, 0x66" and be confused
> >  by the lack of matches.
> 
> Or one could default to something else, bytes or ints or some such,
> and have a /t option or some such that says to use the type of the
> object.

Either way; I've no preference.  The way you've got it seems fine if
we can clarify the description.

-- 
Daniel Jacobowitz
CodeSourcery


  reply	other threads:[~2008-02-29  3:13 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-14  2:20 Doug Evans
2008-02-14 19:54 ` Eli Zaretskii
2008-02-14 22:52   ` Doug Evans
2008-02-15  8:28     ` Eli Zaretskii
2008-02-16  5:39       ` Doug Evans
2008-02-16 13:33         ` Eli Zaretskii
2008-02-26  2:31 ` Daniel Jacobowitz
2008-02-29  3:13   ` Doug Evans
2008-02-29  3:58     ` Daniel Jacobowitz [this message]
2008-04-17  2:59       ` Doug Evans
2008-04-28 18:37         ` Fwd: " Doug Evans
2008-04-29  0:40           ` Eli Zaretskii
2008-05-09  6:46             ` Doug Evans
2008-05-09 14:35               ` Eli Zaretskii
2008-05-02 15:19         ` Daniel Jacobowitz
2008-05-09  6:35           ` Doug Evans
2008-05-09  7:33             ` Daniel Jacobowitz
2008-05-09 20:16           ` Doug Evans
2008-05-09 20:18             ` Daniel Jacobowitz
2008-04-09 21:06   ` Doug Evans
2008-05-02 15:37     ` Daniel Jacobowitz

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=20080229031252.GA2897@caradoc.them.org \
    --to=drow@false.org \
    --cc=dje@google.com \
    --cc=gdb-patches@sourceware.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox