[PATCH 2/4] Hardware accelerated watchpoint conditions

Thiago Jung Bauermann bauerman@br.ibm.com
Mon Jan 4 17:33:00 GMT 2010


On Wed 23 Dec 2009 22:31:01 Thiago Jung Bauermann wrote:
> 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.

This version incorporates all the feedback received so far.
-- 
[]'s
Thiago Jung Bauermann
IBM Linux Technology Center


2009-12-31  Sergio Durigan Junior  <sergiodj@linux.vnet.ibm.com>
	    Thiago Jung Bauermann  <bauerman@br.ibm.com>

	* breakpoint.c (update_watchpoint): Handle the case when the hardware
	supports the acceleration of the watchpoint's condition evaluation.
	(insert_bp_location): Call the correct insertion method according
	to the type of the hardware watchpoint.
	(remove_breakpoint_1): Call the correct deletion method according
	to the type of the hardware watchpoint.
	(set_raw_breakpoint_without_location): Set hw_point_flag to zero.
	(watch_command_1): Mention when a hardware-accelerated
	condition watchpoint will be used.
	(update_breakpoint_locations):  Handle 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) <length>: New field.
	(struct bp_location) <cond_hw_accel>, <cond_hw_addr>: New
	fields.
	(enum hw_point_flag): New.
	(struct breakpoint) <hw_point_flag>: 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, to_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, to_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) <to_can_use_special_hw_point_p>,
	<to_can_use_watchpoint_cond_accel_p>, 
	<to_insert_cond_accel_watchpoint>,
	<to_remove_cond_accel_watchpoint>,
	<to_get_watchpoint_cond_accel_addr>: 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ppc476-condition.diff
Type: text/x-patch
Size: 25846 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20100104/6e96b91b/attachment.bin>


More information about the Gdb-patches mailing list