Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Dominik Czarnota <dominik.b.czarnota@gmail.com>
Cc: gdb-patches@sourceware.org
Subject: Re: Update find command help and search memory docs
Date: Sun, 26 Nov 2017 17:44:00 -0000	[thread overview]
Message-ID: <83a7z96iln.fsf@gnu.org> (raw)
In-Reply-To: <CABEVAa00=iRWkgmr8+f01HDFKMqzeu80C9E2nRWVDvY2LhmseQ@mail.gmail.com>	(message from Dominik Czarnota on Sun, 26 Nov 2017 16:44:30 +0100)

> From: Dominik Czarnota <dominik.b.czarnota@gmail.com>
> Date: Sun, 26 Nov 2017 16:44:30 +0100
> 
> diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
> index 00451d243d..5b9946a9cf 100644
> --- a/gdb/doc/gdb.texinfo
> +++ b/gdb/doc/gdb.texinfo
> @@ -11920,6 +11920,8 @@ giant words (eight bytes)
>  All values are interpreted in the current language.
>  This means, for example, that if the current source language is C/C@t{++}
>  then searching for the string ``hello'' includes the trailing '\0'.
> +The null terminator can be removed from searching by using casts,
> +e.g.: @samp{{char[5]}"hello"}.
> 
>  If the value size is not specified, it is taken from the
>  value's type in the current language.
> @@ -11969,7 +11971,11 @@ you get during debugging:
>  (gdb) find &hello[0], +sizeof(hello), 'h', 'e', 'l', 'l', 'o'
>  0x8049567 <hello.1620>
>  0x804956d <hello.1620+6>
> -2 patterns found
> +2 patterns found.
> +(gdb) find &hello[0], +sizeof(hello), {char[5]}"hello"
> +0x8049567 <hello.1620>
> +0x804956d <hello.1620+6>
> +2 patterns found.
>  (gdb) find /b1 &hello[0], +sizeof(hello), 'h', 0x65, 'l'
>  0x8049567 <hello.1620>
>  1 pattern found

This part is OK.

> diff --git a/gdb/findcmd.c b/gdb/findcmd.c
> index b43fefc06d..ff6088eac1 100644
> --- a/gdb/findcmd.c
> +++ b/gdb/findcmd.c
> @@ -293,7 +293,9 @@ and if not specified the size is taken from the
> type of the expression\n\
>  in the current language.\n\
>  Note that this means for example that in the case of C-like languages\n\
>  a search for an untyped 0x42 will search for \"(int) 0x42\"\n\
> -which is typically four bytes.\n\
> +which is typically four bytes, and a search for a string \"hello\" will\n\
> +include the tralinig '\\0'. The null terminator can be removed from\n\
                             ^^
Two spaces here, please.

Thanks.


  reply	other threads:[~2017-11-26 17:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-26 15:45 Dominik Czarnota
2017-11-26 17:44 ` Eli Zaretskii [this message]
2017-11-26 20:41   ` Dominik Czarnota
2017-11-27  3:26     ` Eli Zaretskii
2017-11-27  3:48       ` Simon Marchi

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=83a7z96iln.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=dominik.b.czarnota@gmail.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