From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2358 invoked by alias); 27 Oct 2009 10:07:36 -0000 Received: (qmail 2350 invoked by uid 22791); 27 Oct 2009 10:07:35 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-bw0-f221.google.com (HELO mail-bw0-f221.google.com) (209.85.218.221) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 27 Oct 2009 10:07:31 +0000 Received: by bwz21 with SMTP id 21so2916684bwz.4 for ; Tue, 27 Oct 2009 03:07:28 -0700 (PDT) Received: by 10.103.80.25 with SMTP id h25mr427944mul.15.1256638047866; Tue, 27 Oct 2009 03:07:27 -0700 (PDT) Received: from ?192.168.10.10? ([93.174.86.85]) by mx.google.com with ESMTPS id s11sm3458005mue.41.2009.10.27.03.07.27 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 27 Oct 2009 03:07:27 -0700 (PDT) Message-ID: <4AE6C656.5070007@googlemail.com> Date: Tue, 27 Oct 2009 14:32:00 -0000 From: James Pandavan User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: gdb@sourceware.org Subject: find command with gdb v7.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2009-10/txt/msg00386.txt.bz2 Hi, I wanted to try out the new find command wivh gdb v7.0. I used the example given in this page (http://sourceware.org/gdb/current/onlinedocs/gdb_11.html#SEC91). I just added one line (line no 5) to the example given. It looks like the search doesn't start at given location. In the attached output, you can see that the find command says it couldn't find the first word or part of it, but is able to find the second word. Is it a bug, or am I doing something wrong? (gdb) find greet,+100,"greetings" Pattern not found. (gdb) find greet,+100,"ings" Pattern not found. Thanks, James Pandavan ---------------------------------------------------------------------------------------------------------- GNU gdb (GDB) 7.0-ubuntu Copyright (C) 2009 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". For bug reporting instructions, please see: ... Reading symbols from /tmp/gdb/gdb_7.0-0ubuntu1_amd64/data/usr/bin/a.out...done. (gdb) break main Breakpoint 1 at 0x4005f4: file test.cpp, line 5. (gdb) list 3,12 3 int main() 4 { 5 char * greet="greetings gentleman"; 6 static char hello[] = "hello-hello"; 7 static struct { char c; short s; int i; } 8 __attribute__ ((packed)) mixed 9 = { 'c', 0x1234, 0x87654321 }; 10 printf ("%s\n", hello); 11 return(0); 12 } (gdb) run Breakpoint 1, main () at test.cpp:5 5 char * greet="greetings gentleman"; (gdb) n 10 printf ("%s\n", hello); (gdb) p greet $1 = 0x4006fc "greetings gentleman" (gdb) find greet,+100,"greetings" Pattern not found. (gdb) find greet,+100,"ings" Pattern not found. (gdb) find greet,+100,"gentleman" 0x400706 1 pattern found. (gdb)