This patch teaches GDB the concept of hardware accelerated watchpoint conditions, and enables the target to say when a condition can be accelerated or not. In the case of BookE processors, the condition will be accelerated when the user types "watch A if A == B", where A and B are either address (e.g. "*0x12345678") or variables. -- []'s Thiago Jung Bauermann IBM Linux Technology Center 2009-12-23 Sergio Durigan Junior Thiago Jung Bauermann * breakpoint.c (update_watchpoint): Disabled watchpoints before checking the used count. Handled the case when the hardware supports the acceleration of the watchpoint's condition evaluation. (insert_bp_location): Calling the correct insertion method according to the type of the hardware watchpoint. (remove_breakpoint_1): Calling the correct deletion method according to the type of the hardware watchpoint. (set_raw_breakpoint_without_location): Setting the flag to zero. (watch_command_1): Handling the creation of hardware-accelerated condition watchpoint. (update_breakpoint_locations): Handling the case of a hardware watchpoint with a condition begin hardware-accelerated. (exp_is_address_p): New function. (exp_is_var_p): Ditto. (cond_is_address_equal_literal_p): Ditto. (cond_is_var_equal_literal_p): Ditto. (get_var_address): Ditto. (default_watch_address_if_var_equal_literal_p): Ditto. (default_watch_var_if_address_equal_literal_p): Ditto. (default_watch_var_if_var_equal_literal_p): Ditto. (default_watch_address_if_address_equal_literal_p): Ditto. * breakpoint.h (struct bp_target_info) : New field. (struct bp_location) , : New fields. (enum hw_point_flag): New. (struct breakpoint) : New field. (default_watch_address_if_address_equal_literal_p): Declare. (default_watch_var_if_var_equal_literal_p): Ditto. (default_watch_address_if_var_equal_literal_p): Ditto. (default_watch_var_if_address_equal_literal_p): Ditto. * ppc-linux-nat.c (ppc_linux_can_use_special_hw_point_p): New function. (ppc_linux_insert_cond_accel_watchpoint): Ditto. (ppc_linux_remove_cond_accel_watchpoint): Ditto. (ppc_linux_get_watchpoint_cond_accel_addr): Ditto. (ppc_linux_can_use_watchpoint_cond_accel_p): Ditto. (_initialize_ppc_linux_nat): Initialize to_can_use_special_hw_point_p, to_get_watchpoint_cond_accel_addr, co_can_use_watchpoint_cond_accel_p to_insert_cond_accel_watchpoint and to_remove_cond_accel_watchpoint. * target.c (update_current_target): Add to_can_use_special_hw_point_p, to_get_watchpoint_cond_accel_addr, co_can_use_watchpoint_cond_accel_p to_insert_cond_accel_watchpoint and to_remove_cond_accel_watchpoint. * target.h: Add opaque declarations for bp_location, breakpoint and hw_point_flag. (struct target_ops , , , , ): New callbacks. (target_region_ok_for_hw_watchpoint): Surround with ifndef. (target_can_use_special_hw_point_p): New define. (target_can_use_watchpoint_cond_accel_p): Ditto. (target_get_watchpoint_cond_accel_addr): Ditto. (target_insert_cond_accel_watchpoint): Ditto. (target_remove_cond_accel_watchpoint): Ditto.