* gdb.base/watchpoint.c (func2): Initialize local_a. Add

marker comment at the beginning (after intialization).
	* gdb.base/watchpoint.exp (test_complex_watchpoint): Set func2
	breakpoint on marker comment instead of function begin.
	(test_wide_location_1): Do not expect HW watchpoints on 32-bit
	PowerPC.
	(test_wide_location_2): Do not expect HW watchpoints on 32-bit
	or 64-bit PowerPC.
	(do_tests): Consistently set can-use-hw-watchpoints to 0 if
	gdb,no_hardware_watchpoints flag is set.
	(initialize): Remove now redundant can-use-hw-watchpoints change.
This commit is contained in:
Ulrich Weigand 2012-08-02 15:55:45 +00:00
parent 7c3270aec1
commit bdddb4dec8
3 changed files with 26 additions and 14 deletions

View File

@ -1,3 +1,17 @@
2012-08-02 Ulrich Weigand <uweigand@de.ibm.com>
* gdb.base/watchpoint.c (func2): Initialize local_a. Add
marker comment at the beginning (after intialization).
* gdb.base/watchpoint.exp (test_complex_watchpoint): Set func2
breakpoint on marker comment instead of function begin.
(test_wide_location_1): Do not expect HW watchpoints on 32-bit
PowerPC.
(test_wide_location_2): Do not expect HW watchpoints on 32-bit
or 64-bit PowerPC.
(do_tests): Consistently set can-use-hw-watchpoints to 0 if
gdb,no_hardware_watchpoints flag is set.
(initialize): Remove now redundant can-use-hw-watchpoints change.
2012-08-02 Yao Qi <yao@codesourcery.com>
Pedro Alves <palves@redhat.com>

View File

@ -90,9 +90,10 @@ void recurser (x) int x;
void
func2 ()
{
int local_a;
int local_a = 0;
static int static_b;
/* func2 breakpoint here */
ival5++;
local_a = ival5;
static_b = local_a;

View File

@ -54,11 +54,6 @@ proc initialize {} {
global decimal
global srcfile
# Disable hardware watchpoints if necessary.
if [target_info exists gdb,no_hardware_watchpoints] {
gdb_test_no_output "set can-use-hw-watchpoints 0" ""
}
if [gdb_test "break marker1" "Breakpoint 1 at $hex: file .*$srcfile, line $decimal.*" "set breakpoint at marker1" ] {
return 0;
}
@ -455,8 +450,8 @@ proc test_complex_watchpoint {} {
gdb_test "break marker6" ".*Breakpoint.*"
gdb_test "cont" "Continuing.*Breakpoint.*marker6 \\(\\).*" \
"continue to marker6"
gdb_test "break func2" ".*Breakpoint.*"
gdb_test "cont" "Continuing.*func2.*"
gdb_breakpoint [gdb_get_line_number "func2 breakpoint here"]
gdb_continue_to_breakpoint "func2 breakpoint here"
# Test a watch of a single stack-based variable, whose scope
# is the function we're now in. This should auto-delete when
@ -466,7 +461,7 @@ proc test_complex_watchpoint {} {
gdb_test "cont" "\[Ww\]atchpoint.*local_a.*" "trigger local watch"
gdb_test "cont" "Continuing.*\[Ww\]atchpoint .* deleted because the program has left the block in.*which its expression is valid.*" "self-delete local watch"
gdb_test "cont" "Continuing.*func2.*"
gdb_continue_to_breakpoint "func2 breakpoint here"
# We should be in "func2" again now. Test a watch of an
# expression which includes both a stack-based local and
# something whose scope is larger than this invocation
@ -486,7 +481,7 @@ proc test_complex_watchpoint {} {
# across any invocations of "func2", it should not auto-
# delete.
#
gdb_test "cont" "Continuing.*func2.*"
gdb_continue_to_breakpoint "func2 breakpoint here"
gdb_test "watch static_b" ".*\[Ww\]atchpoint \[0-9\]*: static_b" \
"set static local watch"
gdb_test "cont" "Continuing.*\[Ww\]atchpoint .*: static_b.*" \
@ -611,7 +606,8 @@ proc test_wide_location_1 {} {
# Platforms where the target can't watch such a large region
# should clear hw_expected below.
if { $no_hw || [target_info exists gdb,no_hardware_watchpoints]
|| [istarget arm*-*-*] } {
|| [istarget arm*-*-*]
|| ([istarget powerpc*-*-*] && ![is_lp64_target])} {
set hw_expected 0
} else {
set hw_expected 1
@ -657,7 +653,8 @@ proc test_wide_location_2 {} {
# Platforms where the target can't watch such a large region
# should clear hw_expected below.
if { $no_hw || [target_info exists gdb,no_hardware_watchpoints]
|| [istarget arm*-*-*] } {
|| [istarget arm*-*-*]
|| [istarget powerpc*-*-*]} {
set hw_expected 0
} else {
set hw_expected 1
@ -869,7 +866,7 @@ proc do_tests {} {
clean_restart $testfile
if {$no_hw} {
if {$no_hw || [target_info exists gdb,no_hardware_watchpoints]} {
gdb_test_no_output "set can-use-hw-watchpoints 0" ""
}
@ -888,7 +885,7 @@ proc do_tests {} {
# `initialize' anymore.
clean_restart $testfile
if {$no_hw} {
if {$no_hw || [target_info exists gdb,no_hardware_watchpoints]} {
gdb_test_no_output "set can-use-hw-watchpoints 0" ""
}