Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Maciej W. Rozycki" <macro@mips.com>
To: Daniel Jacobowitz <drow@false.org>
Cc: gdb-patches@sourceware.org, "Maciej W. Rozycki" <macro@linux-mips.org>
Subject: Re: mi*-watch.exp: Test both hardware and software watchpoints
Date: Fri, 14 Sep 2007 16:25:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.61.0709141653350.23291@perivale.mips.com> (raw)
In-Reply-To: <20070914154030.GA32519@caradoc.them.org>

On Fri, 14 Sep 2007, Daniel Jacobowitz wrote:

> How about a double space after "$type: " in the output?  I bet there
> is:
> 
>     if {[info exists pf_prefix]} {
>         set message [concat $pf_prefix " " $message]
>     }
> 
> (from dejagnu/framework.exp).

 Looks like yours is the right direction -- it is "concat" that is 
responsible for making sure there is exactly one space between its 
arguments.  Thus I have now rewritten this bit as:

lappend pf_prefix "$type:"

-- truly in the TCL spirit. ;-)  Here's the final version.  Thanks for 
your inquisitiveness.

2007-09-14  Maciej W. Rozycki  <macro@mips.com>

	[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.

  Maciej

14678.diff
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 17:07:18.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
+    lappend 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 17:06:49.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
+    lappend 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


      reply	other threads:[~2007-09-14 16:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-11 15:42 Maciej W. Rozycki
2007-09-11 16:19 ` Daniel Jacobowitz
2007-09-14 14:13   ` Maciej W. Rozycki
2007-09-14 14:24     ` Daniel Jacobowitz
2007-09-14 15:28       ` Maciej W. Rozycki
2007-09-14 15:40         ` Daniel Jacobowitz
2007-09-14 16:25           ` Maciej W. Rozycki [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.61.0709141653350.23291@perivale.mips.com \
    --to=macro@mips.com \
    --cc=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    --cc=macro@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox