mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-17 16:05:56 +08:00
* breakpoint.c (can_use_hardware_watchpoint): Handle the first
value specially. testsuite/ * gdb.base/watchpoint.exp: Call test_inaccessible_watchpoint before disabling hardware watchpoints. (test_inaccessible_watchpoint): Check that hardware watchpoints are used. Test for watchpoints on a constant address.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
2010-09-04 Daniel Jacobowitz <dan@codesourcery.com>
|
||||||
|
|
||||||
|
* breakpoint.c (can_use_hardware_watchpoint): Handle the first
|
||||||
|
value specially.
|
||||||
|
|
||||||
2010-09-04 Jan Kratochvil <jan.kratochvil@redhat.com>
|
2010-09-04 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
|
||||||
Code cleanup - split print_stop_reason.
|
Code cleanup - split print_stop_reason.
|
||||||
|
@ -8327,10 +8327,12 @@ can_use_hardware_watchpoint (struct value *v)
|
|||||||
{
|
{
|
||||||
if (VALUE_LVAL (v) == lval_memory)
|
if (VALUE_LVAL (v) == lval_memory)
|
||||||
{
|
{
|
||||||
if (value_lazy (v))
|
if (v != head && value_lazy (v))
|
||||||
/* A lazy memory lvalue is one that GDB never needed to fetch;
|
/* A lazy memory lvalue in the chain is one that GDB never
|
||||||
we either just used its address (e.g., `a' in `a.b') or
|
needed to fetch; we either just used its address (e.g.,
|
||||||
we never needed it at all (e.g., `a' in `a,b'). */
|
`a' in `a.b') or we never needed it at all (e.g., `a'
|
||||||
|
in `a,b'). This doesn't apply to HEAD; if that is
|
||||||
|
lazy then it was not readable, but watch it anyway. */
|
||||||
;
|
;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
2010-09-04 Daniel Jacobowitz <dan@codesourcery.com>
|
||||||
|
|
||||||
|
* gdb.base/watchpoint.exp: Call test_inaccessible_watchpoint
|
||||||
|
before disabling hardware watchpoints.
|
||||||
|
(test_inaccessible_watchpoint): Check that hardware watchpoints
|
||||||
|
are used. Test for watchpoints on a constant address.
|
||||||
|
|
||||||
2010-09-03 Jan Kratochvil <jan.kratochvil@redhat.com>
|
2010-09-03 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
|
||||||
* gdb.base/ui-redirect.exp: New file.
|
* gdb.base/ui-redirect.exp: New file.
|
||||||
|
@ -662,7 +662,28 @@ proc test_inaccessible_watchpoint {} {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gdb_test "watch *global_ptr" ".*atchpoint \[0-9\]+: \\*global_ptr"
|
# See whether a watchpoint on a normal variable is a hardware
|
||||||
|
# watchpoint or not. The watchpoints on NULL should be hardware
|
||||||
|
# iff this one is.
|
||||||
|
set watchpoint_msg "Watchpoint"
|
||||||
|
gdb_test_multiple "watch global_ptr" "watch global_ptr" {
|
||||||
|
-re "Watchpoint \[0-9\]+: global_ptr\r\n.*$gdb_prompt $" {
|
||||||
|
pass "watch global_ptr"
|
||||||
|
}
|
||||||
|
-re "Hardware watchpoint \[0-9\]+: global_ptr\r\n.*$gdb_prompt $" {
|
||||||
|
set watchpoint_msg "Hardware watchpoint"
|
||||||
|
pass "watch global_ptr"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
delete_breakpoints
|
||||||
|
|
||||||
|
# Make sure that we can watch a constant address, and correctly
|
||||||
|
# use a HW watchpoint if supported.
|
||||||
|
gdb_test "watch *(int *) 0" \
|
||||||
|
"$watchpoint_msg \[0-9\]+: \\*\\(int \\*\\) 0"
|
||||||
|
delete_breakpoints
|
||||||
|
|
||||||
|
gdb_test "watch *global_ptr" "$watchpoint_msg \[0-9\]+: \\*global_ptr"
|
||||||
gdb_test "set \$global_ptr_breakpoint_number = \$bpnum" ""
|
gdb_test "set \$global_ptr_breakpoint_number = \$bpnum" ""
|
||||||
gdb_test "next" ".*global_ptr = buf.*" "global_ptr next"
|
gdb_test "next" ".*global_ptr = buf.*" "global_ptr next"
|
||||||
gdb_test_multiple "next" "next over ptr init" {
|
gdb_test_multiple "next" "next over ptr init" {
|
||||||
@ -771,6 +792,8 @@ if [initialize] then {
|
|||||||
test_complex_watchpoint
|
test_complex_watchpoint
|
||||||
}
|
}
|
||||||
|
|
||||||
|
test_inaccessible_watchpoint
|
||||||
|
|
||||||
# Verify that a user can force GDB to use "slow" watchpoints.
|
# Verify that a user can force GDB to use "slow" watchpoints.
|
||||||
# (This proves rather little on kernels that don't support
|
# (This proves rather little on kernels that don't support
|
||||||
# fast watchpoints, but still...)
|
# fast watchpoints, but still...)
|
||||||
@ -849,8 +872,6 @@ if [initialize] then {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
test_inaccessible_watchpoint
|
|
||||||
|
|
||||||
# See above.
|
# See above.
|
||||||
if [istarget "mips-idt-*"] then {
|
if [istarget "mips-idt-*"] then {
|
||||||
gdb_exit
|
gdb_exit
|
||||||
|
Reference in New Issue
Block a user