[PATCH 4/4] Support ranged and masked breakpoints

Thiago Jung Bauermann bauerman@br.ibm.com
Thu Dec 24 00:32:00 GMT 2009

Adds support for the following types of breakpoints

  * Simple Hardware Breakpoint: Monitors a single instruction address.

    Available GDB commands: hbreak <address> / hbreak <line number>
    Example: hbreak *0x10000658 / hbreak 20

  * Range Hardware Breakpoint: Monitors an interval of instruction addresses.

    Available GDB commands: hbreak-range <address1>:<address2 | +<unsigned 
int length>> where <address1> <= <address2> / hbreak-range <line number 
start>:<line number end>

      hbreak-range <address1>, <address2>
      hbreak-range <address1>, +<length>
      hbreak-range <line number start>, <line number end>

      hbreak-range 0x10000658,0x10000660
      hbreak-range 0x10000658,+8
      hbreak-range 20,30

Since the Simple and Range variations share the same register set, the 
allowed combinations of Simple Hardware Breakpoints (HW Break) and Range 
Hardware Breakpoints (Range HW Break) are as follows:

  - 4 HW Breaks
  - 1 or 2 HW Breaks / 1 Range HW Break
  - 2 Range HW Breaks

Thiago Jung Bauermann
IBM Linux Technology Center

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

	* breakpoint.c (insert_bp_location): Propagate length of ranged
	breakpoint to its target_info element.
	(breakpoint_here_p): Update check for ranged breakpoints.
	(print_it_typical): Handle printing of ranged breakpoints.
	(bpstat_check_location): Handle the case of a hardware ranged
	(print_one_breakpoint_location): Ditto.
	(breakpoint_1): Ditto.
	(breakpoint_address_match_range): New function.
	(set_raw_breakpoint): Set the breakpoint range to zero.
	(hw_breakpoint_used_count): Call target-specific function that will
	tell how many extra slots a hardware breakpoint needs.
	(mention): Mention ranged breakpoints.
	(hbreak_range_command): New function.
	(_initialize_breakpoint): Register hbreak-range command.
	* ppc-linux-nat.c (ppc_linux_can_use_special_hw_point_p): Handle the
	(ppc_linux_insert_hw_breakpoint): Handle inserting ranged breakpoints.
	(ppc_linux_remove_hw_breakpoint): Handle removing ranged breakpoints.
	(ppc_linux_hw_point_extra_slot_count): Handle the
	* breakpoint.h (hw_point_flag) <HW_POINT_RANGED_BREAK>: New value.
	* ui-out.c (ui_out_field_range_core_addr): New function.
	* ui-out.h (ui_out_field_range_core_addr): Declare.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ppc476-breakpoints.diff
Type: text/x-patch
Size: 17656 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20091224/82ba0077/attachment.bin>

More information about the Gdb-patches mailing list