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, 02 May 2008 15:37:00 -0000 [thread overview]
Message-ID: <20080502153303.GN29202@caradoc.them.org> (raw)
In-Reply-To: <e394668d0804091337r68a71824qdbf54237119fe5d0@mail.gmail.com>
On Wed, Apr 09, 2008 at 01:37:26PM -0700, Doug Evans wrote:
> If I want to search for 'h', 'e', 'l', 'l', 'o' I won't be able to
> use "hello" because that will now include the trailing nul. Often one
> will want the trailing nul, but it does make searching for substrings
> kinda hard. [For completeness' sake, one could change the definition
> of what "hello" means in this context, and if one wants the trailing
> nul, one has to explicitly specify it, e.g. "hello\0". It's
> C-specific though, and the find command is presumably not supposed to
> know the user is thinking in C - that's the whole point. I don't have
> an opinion either way.]
>
> Any suggestions or preferences for whether and how to make searching
> for substrings not excessively clumsy?
I think that "hello" should be five characters, for this purpose.
There's some support for that in C; it's a valid initializer for
either char[5] or char[6] (C99 6.7.8#15).
Would it help if "hello" reached this point as a TYPE_CODE_STRING
but {'a', 'b', '\0'} was TYPE_CODE_ARRAY, so that we could reliably
detect strings? I don't think it's a big deal since people will
normally leave off the braces for the array here anyway.
--
Daniel Jacobowitz
CodeSourcery
prev parent reply other threads:[~2008-05-02 15:33 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
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 [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=20080502153303.GN29202@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