From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 681 invoked by alias); 24 Dec 2009 04:41:52 -0000 Received: (qmail 672 invoked by uid 22791); 24 Dec 2009 04:41:50 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 24 Dec 2009 04:41:47 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 60B5E2BAB72; Wed, 23 Dec 2009 23:41:45 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id GYdwTXlCRRyr; Wed, 23 Dec 2009 23:41:45 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id C9D0E2BAB16; Wed, 23 Dec 2009 23:41:44 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id A9F1AF5937; Thu, 24 Dec 2009 05:41:25 +0100 (CET) Date: Thu, 24 Dec 2009 04:41:00 -0000 From: Joel Brobecker To: Thiago Jung Bauermann Cc: gdb-patches@sourceware.org, Luis Machado Subject: Re: [RFA] Fix verification of changed values for big values. Message-ID: <20091224044125.GW2788@adacore.com> References: <200912232142.37008.bauerman@br.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200912232142.37008.bauerman@br.ibm.com> User-Agent: Mutt/1.5.20 (2009-06-14) 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 X-SW-Source: 2009-12/txt/msg00379.txt.bz2 > But I don't know if approvals expire or not, so... I guess it depends whether the code that you're updating has changed much or not. If not, I'd say that the approval does not expire. > gdb/ > * valarith.c (value_equal_contents): New function. > * value.h (value_equal_contents): Declare. > * breakpoint.c (watchpoint_check): Use value_equal_contents > instead of value_equal. OK, with just one little request. > > gdb/testsuite/ > * gdb.base/watchpoint.exp (test_watchpoint_in_big_blob): New function. > (top level): Call test_watchpoint_in_big_blob. > * gdb.base/watchpoint.c (buf): Change size to value too big for hardware > watchpoints. > (func3): Write to buf. Just one comment, but pre-approved. > -/* Check watchpoint condition. */ > > static int > watchpoint_check (void *p) Can you add a short description of what the function does? We would like all functions to be documented... In particular, since P is declared as a void *, it's probably going to be useful to explain what the real type is supposed to be. > +/* Compare values based on their raw contents. Useful for arrays since ^ Missing space > + send_gdb "cont\n" > + gdb_expect { > + -re "Continuing.*\[Ww\]atchpoint.*buf.*Old value = .*$gdb_prompt $" { > + pass "watchpoint on buf hit" > + } I am wondering if this could be written more simply, by using gdb_test? gdb_test "cont" "Continuing.*\[Ww\]atchpoint.*buf.*Old value = .*" [...] ? Otherwise, we try to avoid the use of send_gdb/gdb_expect, as it forces you to handle by hand all possible failure conditions. You can use gdb_test_multiple instead. For instance: | gdb_test_multiple "next" "next after watch x" { | -re ".*atchpoint \[0-9\]+: x\r\n\r\nOld value = 0\r\nNew value = 1\r\n.*$gdb_prompt $" { | pass "next after watch x" | } | -re "\[0-9\]+\[\t \]+y = 1;\r\n$gdb_prompt $" { | kfail "gdb/38" "next after watch x" | } (notice how you know longer need to handle eof, timeout, but also internal errors, etc) -- Joel