diff options
author | Daniel Jacobowitz <drow@false.org> | 2007-10-01 00:17:58 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2007-10-01 00:17:58 +0000 |
commit | d983da9c3dfa91e6840fee2a7479d98ee4759f13 (patch) | |
tree | 9a1c14b44f1a2de2d2c087b00d987deb2fe8274d /gdb/breakpoint.h | |
parent | d830e0e0c9d4b1827385c473cb545e07a72c9b81 (diff) | |
download | gdb-d983da9c3dfa91e6840fee2a7479d98ee4759f13.zip gdb-d983da9c3dfa91e6840fee2a7479d98ee4759f13.tar.gz gdb-d983da9c3dfa91e6840fee2a7479d98ee4759f13.tar.bz2 |
2007-09-16 Daniel Jacobowitz <dan@codesourcery.com>
Jeff Johnston <jjohnstn@redhat.com>
* breakpoint.c (watchpoints_triggered): New.
(bpstat_stop_status): Remove STOPPED_BY_WATCHPOINT argument.
Check watchpoint_triggered instead. Combine handling for software
and hardware watchpoints. Do not use target_stopped_data_address
here. Always check a watchpoint if its scope breakpoint triggers.
Do not stop for thread or overlay events. Improve check for
triggered watchpoints without a value change.
(watch_command_1): Insert the scope breakpoint first. Link the
scope breakpoint to the watchpoint.
* breakpoint.h (enum watchpoint_triggered): New.
(struct breakpoint): Add watchpoint_triggered.
(bpstat_stop_status): Update prototype.
(watchpoints_triggered): Declare.
* infrun.c (enum infwait_status): Add infwait_step_watch_state.
(stepped_after_stopped_by_watchpoint): Delete.
(handle_inferior_event): Make stepped_after_stopped_by_watchpoint
local. Handle infwait_step_watch_state. Update calls to
bpstat_stop_status. Use watchpoints_triggered to check
watchpoints.
* remote.c (stepped_after_stopped_by_watchpoint): Remove extern.
(remote_stopped_data_address): Do not check it.
* gdb.texinfo (Setting Watchpoints): Adjust warning text about
multi-threaded watchpoints.
* gdbint.texinfo (Watchpoints): Describe how watchpoints are
checked. Describe sticky notification. Expand description
of steppable and continuable watchpoints.
(Watchpoints and Threads): New subsection.
* gdb.threads/watchthreads.c (thread_function): Sleep between
iterations.
* gdb.threads/watchthreads.exp: Allow two watchpoints to trigger
at once for S/390. Generate matching fails and passes.
Diffstat (limited to 'gdb/breakpoint.h')
-rw-r--r-- | gdb/breakpoint.h | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h index 6dfb27c..1e68a2a 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -318,6 +318,19 @@ struct breakpoint_ops void (*print_mention) (struct breakpoint *); }; +enum watchpoint_triggered +{ + /* This watchpoint definitely did not trigger. */ + watch_triggered_no = 0, + + /* Some hardware watchpoint triggered, and it might have been this + one, but we do not know which it was. */ + watch_triggered_unknown, + + /* This hardware watchpoint definitely did trigger. */ + watch_triggered_yes +}; + /* Note that the ->silent field is not currently used by any commands (though the code is in there if it was to be, and set_raw_breakpoint does set it to 0). I implemented it because I thought it would be @@ -395,6 +408,10 @@ struct breakpoint should be evaluated on the outermost frame. */ struct frame_id watchpoint_frame; + /* For hardware watchpoints, the triggered status according to the + hardware. */ + enum watchpoint_triggered watchpoint_triggered; + /* Thread number for thread-specific breakpoint, or -1 if don't care */ int thread; @@ -459,8 +476,7 @@ extern void bpstat_clear (bpstat *); is part of the bpstat is copied as well. */ extern bpstat bpstat_copy (bpstat); -extern bpstat bpstat_stop_status (CORE_ADDR pc, ptid_t ptid, - int stopped_by_watchpoint); +extern bpstat bpstat_stop_status (CORE_ADDR pc, ptid_t ptid); /* This bpstat_what stuff tells wait_for_inferior what to do with a breakpoint (a challenging task). */ @@ -853,4 +869,8 @@ extern void remove_single_step_breakpoints (void); extern void *deprecated_insert_raw_breakpoint (CORE_ADDR); extern int deprecated_remove_raw_breakpoint (void *); +/* Check if any hardware watchpoints have triggered, according to the + target. */ +int watchpoints_triggered (struct target_waitstatus *); + #endif /* !defined (BREAKPOINT_H) */ |