From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16787 invoked by alias); 4 Aug 2010 22:57:38 -0000 Received: (qmail 16777 invoked by uid 22791); 4 Aug 2010 22:57:37 -0000 X-SWARE-Spam-Status: No, hits=-6.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 04 Aug 2010 22:57:32 +0000 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o74MvUxQ030525 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 4 Aug 2010 18:57:31 -0400 Received: from host1.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o74MvS4n006635 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 4 Aug 2010 18:57:30 -0400 Received: from host1.dyn.jankratochvil.net (localhost [127.0.0.1]) by host1.dyn.jankratochvil.net (8.14.4/8.14.4) with ESMTP id o74MvSWT004260; Thu, 5 Aug 2010 00:57:28 +0200 Received: (from jkratoch@localhost) by host1.dyn.jankratochvil.net (8.14.4/8.14.4/Submit) id o74MvS6G004259; Thu, 5 Aug 2010 00:57:28 +0200 Date: Wed, 04 Aug 2010 22:57:00 -0000 From: Jan Kratochvil To: Dragos Tatulea Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] Bug 10645: small additions to existing testcase Message-ID: <20100804225728.GA2835@host1.dyn.jankratochvil.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-12-10) 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: 2010-08/txt/msg00024.txt.bz2 On Tue, 03 Aug 2010 10:11:09 +0200, Dragos Tatulea wrote: > --- > gdb/testsuite/gdb.base/watchpoint-hw-unreadable.c | 45 +++++++ > .../gdb.base/watchpoint-hw-unreadable.exp | 127 ++++++++++++++++++++ > 2 files changed, 172 insertions(+), 0 deletions(-) > create mode 100644 gdb/testsuite/gdb.base/watchpoint-hw-unreadable.c > create mode 100644 gdb/testsuite/gdb.base/watchpoint-hw-unreadable.exp > A GNU ChangeLog entry is missing. > diff --git a/gdb/testsuite/gdb.base/watchpoint-hw-unreadable.c b/gdb/testsuite/gdb.base/watchpoint-hw-unreadable.c > new file mode 100644 > index 0000000..887c293 > --- /dev/null > +++ b/gdb/testsuite/gdb.base/watchpoint-hw-unreadable.c > @@ -0,0 +1,45 @@ > +/* This testcase is part of GDB, the GNU debugger. > + > + Copyright 2009 Free Software Foundation, Inc. ^^^^ The date should include also 2010. [...] > diff --git a/gdb/testsuite/gdb.base/watchpoint-hw-unreadable.exp b/gdb/testsuite/gdb.base/watchpoint-hw-unreadable.exp > new file mode 100644 > index 0000000..034972f > --- /dev/null > +++ b/gdb/testsuite/gdb.base/watchpoint-hw-unreadable.exp > @@ -0,0 +1,127 @@ > +# Copyright 2009 Free Software Foundation, Inc. ^^^^ The date should include also 2010. [...] > +# Tests watchpoints. > +# Input: Array of list containing the folowing elements: > +# 1: W_NAME - watched var name > +# 2: W_ID - watched var id > +# 3: OLD_VAL - expected old val > +# 4: NEW_VAL - expected new val > +proc gdb_watch_test {arg_array} { > + upvar $arg_array arg_arr > + global test > + global gdb_prompt > + > + set expect_output "\r\ninfrun: stopped by watchpoint\r\n.*" > + foreach {k v} [array get arg_arr] { > + set w_name [lindex $v 0] > + set w_id [lindex $v 1] > + set old_val [lindex $v 2] > + set new_val [lindex $v 3] > + > + set expect_output "$expect_output\r\nHardware watchpoint $w_id: \\$w_name\[\r\n\]+Old value = $old_val\r\nNew value = $new_val" > + } > + > + gdb_test_multiple "continue" $test { > + -re "$expect_output.*$gdb_prompt $" { > + #puts "PASS" > + pass $test > + } > + default { > + #puts "FAIL" > + fail $test > + return 0 > + } I do not see why you could not use simple gdb_test here instead of gdb_test_multiple. [...] > + || [target_info exists gdb,no_hardware_watchpoints]} then { > + verbose "Skipping watchpoint-hw test." ^^^^^^^^^^^^^ This testfile is named differently. [...] > +gdb_test "set debug infrun 1" ^^^^^^^^ -> gdb_test_no_output nowadays. Not an issue for this patch: gdb_test could sanity check it must be given some expect string. > +gdb_test "show debug infrun" "Inferior debugging is 1\\." > + > +gdb_test "watch *p" "ardware watchpoint 2: \\\*p" > +gdb_test "watch **pp" "ardware watchpoint 3: \\\*\\\*pp" > +set test "catch *p" All the testcases generate: PASS: gdb.base/watchpoint-hw-unreadable.exp: catch *p PASS: gdb.base/watchpoint-hw-unreadable.exp: catch *p PASS: gdb.base/watchpoint-hw-unreadable.exp: catch *p The testcase names should be unique. > +set c(0) [list *p 2 9 10] > +set c(1) [list **pp 3 9 10] > +gdb_watch_test c > +unset c Just such a qustion, maybe to simplify all the upvar, unset, set lines etc. using just some? gdb_watch_test {{*p 2 9 10} {**pp 3 9 10}} Thanks, Jan