Make breakpoint_address_bits look at the location kind
authorPedro Alves <pedro@palves.net>
Thu, 12 May 2022 18:43:53 +0000 (19:43 +0100)
committerPedro Alves <pedro@palves.net>
Fri, 20 May 2022 19:41:01 +0000 (20:41 +0100)
commit6e14e4412b670d093d74b90e5d4adcfaedb76d3f
tree6dbe99cd35f96fb8a22d1e1a5f6ebe722f17ab9a
parent249dfeafc96db9d36ea8c22f0ae3c3eb5b76b5ba
Make breakpoint_address_bits look at the location kind

Software watchpoints allocate a special dummy location using
software_watchpoint_add_no_memory_location, and then
breakpoint_address_bits checks whether the location is that special
location to decide whether the location has a meaninful address to
print.

Introduce a new bp_loc_software_watchpoint location kind, and make
breakpoint_address_bits use bl_address_is_meaningful instead, which
returns false for bp_loc_other, which is in accordance with we
document for bp_location::address:

  /* (... snip ...)  Valid for all types except
     bp_loc_other.  */
  CORE_ADDR address = 0;

Rename software_watchpoint_add_no_memory_location to
add_dummy_location, and simplify it.  This will be used by catchpoints
too in a following patch.

Note that neither "info breakpoints" nor "maint info breakpoints"
actually prints the addresses of watchpoints, but I think it would be
useful to do so in "maint info breakpoints".  This approach let's us
implement that in the future.

Change-Id: I50e398f66ef618c31ffa662da755eaba6295aed7
gdb/breakpoint.c
gdb/breakpoint.h