+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>
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;
}
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
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
# 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.*" \
# 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
# 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
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" ""
}
# `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" ""
}