From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31551 invoked by alias); 22 Feb 2011 17:58:26 -0000 Received: (qmail 31541 invoked by uid 22791); 22 Feb 2011 17:58:26 -0000 X-SWARE-Spam-Status: No, hits=-4.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-outbound-2.vmware.com (HELO smtp-outbound-2.vmware.com) (65.115.85.73) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 22 Feb 2011 17:58:18 +0000 Received: from mailhost4.vmware.com (mailhost4.vmware.com [10.16.67.124]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id 54F0443009; Tue, 22 Feb 2011 09:58:15 -0800 (PST) Received: from msnyder-server.eng.vmware.com (promd-2s-dhcp138.eng.vmware.com [10.20.124.138]) by mailhost4.vmware.com (Postfix) with ESMTP id 493ECC9C97; Tue, 22 Feb 2011 09:58:15 -0800 (PST) Message-ID: <4D63F936.2000505@vmware.com> Date: Tue, 22 Feb 2011 17:58:00 -0000 From: Michael Snyder User-Agent: Thunderbird 2.0.0.24 (X11/20101201) MIME-Version: 1.0 To: Joel Brobecker CC: Tom Tromey , "gdb-patches@sourceware.org" , Vladimir Prus , "dan@codesourcery.com" Subject: Re: [RFA] add test for memattr, use get_number_or_range for memattr commands References: <4D605267.8030708@vmware.com> <20110221091304.GB2600@adacore.com> <4D62EE87.6040902@vmware.com> <20110222082747.GQ2600@adacore.com> In-Reply-To: <20110222082747.GQ2600@adacore.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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/msg00604.txt.bz2 Joel Brobecker wrote: >> 2011-02-21 Michael Snyder >> >> * memattr.c (mem_enable_command): Use get_number_or_range. >> (mem_disable_command): Ditto. >> (mem_delete_command): Ditto. >> (_initialize_mem): Tweak usage message to reflect multiple >> arguments. >> >> 2011-02-21 Michael Snyder >> >> * gdb.base/memattr.exp: New test. >> * gdb.base/memattr.c: Test load for memattr.exp. > > Overall, the patch looks OK to me. > >> +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) >> + } >> +} > [...] >> +gdb_test_no_output "mem $mem1start $mem1end wo" "create mem region 1" > > I still think that, if the first quoted test does not pass, the second > will cause the testcase to crash because mem1start is going to be > undefined. This is what you're going to see when that happens: > > ERROR: tcl error sourcing /[...]/memattr.exp > ERROR: can't read "mem1start": no such variable > while executing > "gdb_test_no_output "mem $mem1start $mem1end wo" "create mem region 1"" > > But I'm OK with that, if that's OK with the others. Hmmm, how about if I initialize mem1start etc. to -1? Then the rest of the tests will fail but not crash. Is that better?