From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22183 invoked by alias); 26 Nov 2017 17:44:15 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 22170 invoked by uid 89); 26 Nov 2017 17:44:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.1 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KB_WAM_FROM_NAME_SINGLEWORD,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (208.118.235.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 26 Nov 2017 17:44:13 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eJ0yM-0001L7-SG for gdb-patches@sourceware.org; Sun, 26 Nov 2017 12:44:10 -0500 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:45541) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eJ0yM-0001Kz-Od; Sun, 26 Nov 2017 12:44:06 -0500 Received: from [176.228.60.248] (port=1064 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eJ0yL-0003TF-J8; Sun, 26 Nov 2017 12:44:06 -0500 Date: Sun, 26 Nov 2017 17:44:00 -0000 Message-Id: <83a7z96iln.fsf@gnu.org> From: Eli Zaretskii To: Dominik Czarnota CC: gdb-patches@sourceware.org In-reply-to: (message from Dominik Czarnota on Sun, 26 Nov 2017 16:44:30 +0100) Subject: Re: Update find command help and search memory docs Reply-to: Eli Zaretskii References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-IsSubscribed: yes X-SW-Source: 2017-11/txt/msg00671.txt.bz2 > From: Dominik Czarnota > 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 > 0x804956d > -2 patterns found > +2 patterns found. > +(gdb) find &hello[0], +sizeof(hello), {char[5]}"hello" > +0x8049567 > +0x804956d > +2 patterns found. > (gdb) find /b1 &hello[0], +sizeof(hello), 'h', 0x65, 'l' > 0x8049567 > 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.