Use multiple locations for hardware watchpoints.

This eliminates the need to traverse value chain, doing
	various checks, in three different places.

        * breakpoint.h (struct bp_location): New fields
        lengths and watchpoint_type.
        (struct breakpoint): Remove the val_chain field.
        * breakpoint.c (is_hardware_watchpoint): New.
        (free_valchain): Remove.
        (update_watchpoint): New.
        (insert_bp_location): For hardware watchpoint, just
        directly insert it.
        (insert_breakpoints): Call update_watchpoint_locations
        on all watchpoints.  If we have failed to insert
        any location of a hardware watchpoint, remove all inserted
        locations.
        (remove_breakpoint): For hardware watchpoints, directly
        remove location.
        (watchpoints_triggered): Iterate over locations.
        (bpstat_stop_status): Use only first location of
        a resource watchpoint.
        (delete_breakpoint): Don't call free_valchain.
        (print_one_breakpoint): Don't print all
        locations for watchpoints.
        (breakpoint_re_set_one): Use update_watchpoint for
        watchpoints.
This commit is contained in:
Vladimir Prus
2008-01-29 17:52:47 +00:00
parent 0b3de036ef
commit a5606eee5e
7 changed files with 483 additions and 257 deletions

View File

@ -273,6 +273,12 @@ struct bp_location
bp_loc_other. */
CORE_ADDR address;
/* For hardware watchpoints, the size of data ad ADDRESS being watches. */
int length;
/* Type of hardware watchpoint. */
enum target_hw_bp_type watchpoint_type;
/* For any breakpoint type with an address, this is the BFD section
associated with the address. Used primarily for overlay debugging. */
asection *section;
@ -388,9 +394,6 @@ struct breakpoint
/* Value of the watchpoint the last time we checked it. */
struct value *val;
/* Holds the value chain for a hardware watchpoint expression. */
struct value *val_chain;
/* Holds the address of the related watchpoint_scope breakpoint
when using watchpoints on local variables (might the concept
of a related breakpoint be useful elsewhere, if not just call