From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22741 invoked by alias); 14 Sep 2007 14:13:18 -0000 Received: (qmail 22730 invoked by uid 22791); 14 Sep 2007 14:13:17 -0000 X-Spam-Check-By: sourceware.org Received: from dmz.mips-uk.com (HELO dmz.mips-uk.com) (194.74.144.194) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 14 Sep 2007 14:13:04 +0000 Received: from internal-mx1 ([192.168.192.240] helo=ukservices1.mips.com) by dmz.mips-uk.com with esmtp (Exim 3.35 #1 (Debian)) id 1IWBuj-0002eu-00; Fri, 14 Sep 2007 15:12:57 +0100 Received: from perivale.mips.com ([192.168.192.200]) by ukservices1.mips.com with esmtp (Exim 3.36 #1 (Debian)) id 1IWBue-0000RY-00; Fri, 14 Sep 2007 15:12:52 +0100 Received: from macro (helo=localhost) by perivale.mips.com with local-esmtp (Exim 4.63) (envelope-from ) id 1IWBud-0001V5-Vb; Fri, 14 Sep 2007 15:12:52 +0100 Date: Fri, 14 Sep 2007 14:13:00 -0000 From: "Maciej W. Rozycki" To: Daniel Jacobowitz cc: gdb-patches@sourceware.org, "Maciej W. Rozycki" Subject: Re: mi*-watch.exp: Test both hardware and software watchpoints In-Reply-To: <20070911161922.GA16571@caradoc.them.org> Message-ID: References: <20070911161922.GA16571@caradoc.them.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MIPS-Technologies-UK-MailScanner: Found to be clean X-MIPS-Technologies-UK-MailScanner-From: macro@mips.com 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: 2007-09/txt/msg00179.txt.bz2 On Tue, 11 Sep 2007, Daniel Jacobowitz wrote: > It isn't generally sufficient, either. It's implemented on PowerPC > but the test still fails. The frame pointer is corrupted one > instruction before the epilogue is detected, and I couldn't come up > with a reasonable way of making it work. Hmm, extending the range of the epilogue? Just an obvious thought -- I have no competence with PowerPC. > In principle, I think so, but give it a day or two to see if anyone > objects. How about xfailing the out of scope test for software > watchpoints? Well, should I take it as a declaration of no intent to fix them? > In practice, there's one problem. You're going to create lots of > tests with duplicated test names. The usual way to fix this is to > pass a prefix around and apply it everywhere. The clever way to > fix this, inspired by Jan's recent change to sepdebug.exp, is to > modify the global pf_prefix. Indeed -- thanks for the hint. > If you do that please leave the default prefix present though; save > the value at the beginning of the test (i.e. after default_gdb_init) > and append to it. Yes, of course -- I had a look at sepdebug.exp and was quite annoyed by the output having the script name swallowed at one point. Here is an updated version. This change has been tested natively for mips-linux-gnu and i386-linux-gnu and remotely for mipsisa32-sde-elf, with mips-sim-sde32/-EB and mips-sim-sde32/-EL. 2007-09-14 Maciej W. Rozycki * gdb.mi/mi-watch.exp (test_watchpoint_all): New function. Move all the tests here and run them twice, once using software watchpoints and once using hardware watchpoints. * gdb.mi/mi2-watch.exp (test_watchpoint_all): Likewise. OK to apply? Maciej 14678.diff Index: binutils-quilt/ChangeLog-14678 =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ binutils-quilt/ChangeLog-14678 2007-09-14 14:35:32.000000000 +0100 @@ -0,0 +1,7 @@ +2006-09-18 Maciej W. Rozycki + + [mti-fix-scope] + * gdb.mi/mi-watch.exp (test_watchpoint_all): New function. + Move all the tests here and run them twice, once using software + watchpoints and once using hardware watchpoints. + * gdb.mi/mi2-watch.exp (test_watchpoint_all): Likewise. Index: binutils-quilt/src/gdb/testsuite/gdb.mi/mi2-watch.exp =================================================================== --- binutils-quilt.orig/src/gdb/testsuite/gdb.mi/mi2-watch.exp 2007-09-14 14:07:28.000000000 +0100 +++ binutils-quilt/src/gdb/testsuite/gdb.mi/mi2-watch.exp 2007-09-14 14:36:48.000000000 +0100 @@ -41,10 +41,6 @@ return -1 } -mi_delete_breakpoints -mi_gdb_reinitialize_dir $srcdir/$subdir -mi_gdb_load ${binfile} - proc test_watchpoint_creation_and_listing {} { global mi_gdb_prompt global srcfile @@ -167,16 +163,48 @@ } } -# Disable hardware watchpoints if necessary. +proc test_watchpoint_all {type} { + global pf_prefix + upvar srcdir srcdir + upvar subdir subdir + upvar binfile binfile + + set old_prefix $pf_prefix + set pf_prefix "$pf_prefix $type: " + + mi_delete_breakpoints + mi_gdb_reinitialize_dir $srcdir/$subdir + mi_gdb_load ${binfile} + + mi_runto callee4 + test_watchpoint_creation_and_listing + #test_rwatch_creation_and_listing + #test_awatch_creation_and_listing + test_watchpoint_triggering + + set pf_prefix $old_prefix +} + +# Run the tests twice, once using software watchpoints... +mi_gdb_test "567-gdb-set can-use-hw-watchpoints 0" \ + "567\\^done" \ + "hw watchpoints toggle (1)" +test_watchpoint_all sw + +mi_gdb_exit + +# ... and unless requested otherwise... if [target_info exists gdb,no_hardware_watchpoints] { - mi_gdb_test "-gdb-set can-use-hw-watchpoints 0" "\\^done" "" + return 0 } -mi_runto callee4 -test_watchpoint_creation_and_listing -#test_rwatch_creation_and_listing -#test_awatch_creation_and_listing -test_watchpoint_triggering +mi_gdb_start + +# ... once using hardware watchpoints (if available). +mi_gdb_test "890-gdb-set can-use-hw-watchpoints 1" \ + "890\\^done" \ + "hw watchpoints toggle (2)" +test_watchpoint_all hw mi_gdb_exit return 0 Index: binutils-quilt/src/gdb/testsuite/gdb.mi/mi-watch.exp =================================================================== --- binutils-quilt.orig/src/gdb/testsuite/gdb.mi/mi-watch.exp 2007-09-14 14:07:28.000000000 +0100 +++ binutils-quilt/src/gdb/testsuite/gdb.mi/mi-watch.exp 2007-09-14 14:32:27.000000000 +0100 @@ -41,10 +41,6 @@ return -1 } -mi_delete_breakpoints -mi_gdb_reinitialize_dir $srcdir/$subdir -mi_gdb_load ${binfile} - proc test_watchpoint_creation_and_listing {} { global mi_gdb_prompt global srcfile @@ -167,16 +163,48 @@ } } -# Disable hardware watchpoints if necessary. +proc test_watchpoint_all {type} { + global pf_prefix + upvar srcdir srcdir + upvar subdir subdir + upvar binfile binfile + + set old_prefix $pf_prefix + set pf_prefix "$pf_prefix $type: " + + mi_delete_breakpoints + mi_gdb_reinitialize_dir $srcdir/$subdir + mi_gdb_load ${binfile} + + mi_runto callee4 + test_watchpoint_creation_and_listing + #test_rwatch_creation_and_listing + #test_awatch_creation_and_listing + test_watchpoint_triggering + + set pf_prefix $old_prefix +} + +# Run the tests twice, once using software watchpoints... +mi_gdb_test "567-gdb-set can-use-hw-watchpoints 0" \ + "567\\^done" \ + "hw watchpoints toggle (1)" +test_watchpoint_all sw + +mi_gdb_exit + +# ... and unless requested otherwise... if [target_info exists gdb,no_hardware_watchpoints] { - mi_gdb_test "-gdb-set can-use-hw-watchpoints 0" "\\^done" "" + return 0 } -mi_runto callee4 -test_watchpoint_creation_and_listing -#test_rwatch_creation_and_listing -#test_awatch_creation_and_listing -test_watchpoint_triggering +mi_gdb_start + +# ... once using hardware watchpoints (if available). +mi_gdb_test "890-gdb-set can-use-hw-watchpoints 1" \ + "890\\^done" \ + "hw watchpoints toggle (2)" +test_watchpoint_all hw mi_gdb_exit return 0