From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1149 invoked by alias); 21 Feb 2011 09:13:48 -0000 Received: (qmail 1140 invoked by uid 22791); 21 Feb 2011 09:13:46 -0000 X-SWARE-Spam-Status: No, hits=-2.0 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; Mon, 21 Feb 2011 09:13:12 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id AE55A2BABB7; Mon, 21 Feb 2011 04:13:10 -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 B4r93oBcaAW9; Mon, 21 Feb 2011 04:13:10 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 242B62BAB38; Mon, 21 Feb 2011 04:13:10 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 4B1941459B0; Mon, 21 Feb 2011 13:13:04 +0400 (RET) Date: Mon, 21 Feb 2011 09:24:00 -0000 From: Joel Brobecker To: Michael Snyder Cc: "gdb-patches@sourceware.org" , Vladimir Prus , "dan@codesourcery.com" Subject: Re: [RFA] add test for memattr, use get_number_or_range for memattr commands Message-ID: <20110221091304.GB2600@adacore.com> References: <4D605267.8030708@vmware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4D605267.8030708@vmware.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: 2011-02/txt/msg00531.txt.bz2 > 2011-02-19 Michael Snyder > > * memattr.c (mem_enable_command): Use get_number_or_range. > (mem_disable_command): Ditto. > (mem_delete_command): Ditto. You forgot in the ChangeLog the documentation updates (which should be reviewed by Eli). The code changes look fine to me. > 2011-02-19 Michael Snyder > > * gdb.base/memattr.exp: New test. > * gdb.base/memattr.c: Test load for memattr.exp. > Index: testsuite/gdb.base/memattr.c > =================================================================== > RCS file: testsuite/gdb.base/memattr.c > diff -N testsuite/gdb.base/memattr.c > --- /dev/null 1 Jan 1970 00:00:00 -0000 > +++ testsuite/gdb.base/memattr.c 19 Feb 2011 23:25:11 -0000 > @@ -0,0 +1,11 @@ > +#define MEMSIZE 64 This file needs a copyright header (with the copyright year starting with 2011 - see below :-). > Index: testsuite/gdb.base/memattr.exp > =================================================================== > RCS file: testsuite/gdb.base/memattr.exp > diff -N testsuite/gdb.base/memattr.exp > --- /dev/null 1 Jan 1970 00:00:00 -0000 > +++ testsuite/gdb.base/memattr.exp 19 Feb 2011 23:25:11 -0000 > @@ -0,0 +1,419 @@ > +# Copyright 1998, 1999, 2000, 2007, 2008, 2009, 2010, 2011 > +# Free Software Foundation, Inc. This is one of these things were I'm not totally sure. But should we really claim copyright on this file all the way up to 2011? ISTM that we can only claim starting in 2011, since this file was presumably created in 2011. I don't think that the fact that you started from another file and duplicated a small part of it is sufficient to claim that it existed since 1998... > +gdb_test_multiple "info address mem1" "get address of mem1" { > + -re "Symbol \"mem1\" is static storage at address ($hex).*$gdb_prompt $" { > + set mem1start $expect_out(1,string) > + } > +} What happens if this operation fails? I think that the testcase will badly crash as soon as you start using $mem1start, no? Should we fail & return? Or just perform all the address extraction first, and then have a test that verifies the existence of every variable before continuing with the rest of the test? I find the latter suggestion easier to implement, but a little more dangerous. -- Joel