Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(201)

Unified Diff: gdb/testsuite/gdb.base/watchpoints.exp

Issue 124383005: GDB 7.6.50 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@upstream
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gdb/testsuite/gdb.base/watchpoints.c ('k') | gdb/testsuite/gdb.base/wchar.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gdb/testsuite/gdb.base/watchpoints.exp
diff --git a/gdb/testsuite/gdb.base/watchpoints.exp b/gdb/testsuite/gdb.base/watchpoints.exp
index 57500b0519440b1a9724ce1f6157e4ea3fa65bb4..4e21d14c7a59bbb1803215e95c1e73c94ffba3f3 100644
--- a/gdb/testsuite/gdb.base/watchpoints.exp
+++ b/gdb/testsuite/gdb.base/watchpoints.exp
@@ -1,4 +1,4 @@
-# Copyright 2009-2012 Free Software Foundation, Inc.
+# Copyright 2009-2013 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -16,9 +16,7 @@
# This file was written by Pierre Muller. (muller@ics.u-strasbg.fr)
-set testfile "watchpoints"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
set wp_set 1
@@ -26,17 +24,33 @@ if [get_compiler_info] {
return -1
}
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
- untested watchpoint.exp
- return -1
+if {[prepare_for_testing $testfile.exp $testfile $srcfile debug]} {
+ untested $testfile.exp
+ return -1
}
-# Start with a fresh gdb.
+with_test_prefix "before inferior start" {
+ # Ensure that if we turn off hardware watchpoints and set a watch point
+ # before starting the inferior the watchpoint created will not be a
+ # hardware watchpoint.
+ gdb_test_no_output "set can-use-hw-watchpoints 0" ""
+ gdb_test "watch ival1" "Watchpoint \[0-9\]+: ival1" \
+ "create watchpoint"
+
+ # The next tests are written to match the current state of gdb: access
+ # and read watchpoints require hardware watchpoint support, with this
+ # turned off these can't be created.
+ gdb_test "awatch ival1" \
+ "Can't set read/access watchpoint when hardware watchpoints are disabled." \
+ "create access watchpoint"
+ gdb_test "rwatch ival1" \
+ "Can't set read/access watchpoint when hardware watchpoints are disabled." \
+ "create read watchpoint"
+}
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load $binfile
+ # This will turn hardware watchpoints back on and delete the watchpoint
+ # we just created.
+ clean_restart ${binfile}
# Disable hardware watchpoints if necessary.
if [target_info exists gdb,no_hardware_watchpoints] {
« no previous file with comments | « gdb/testsuite/gdb.base/watchpoints.c ('k') | gdb/testsuite/gdb.base/wchar.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698