[C++] breakpoint.c: "no memory" software watchpoints and enum casts
Fixes:
src/gdb/breakpoint.c: In function ‘void update_watchpoint(watchpoint*, int)’:
src/gdb/breakpoint.c:2147:31: error: invalid conversion from ‘int’ to ‘target_hw_bp_type’ [-fpermissive]
base->loc->watchpoint_type = -1;
^
Seems better to rely on "address == -1 && length == -1" than on a enum
value that's not really part of the set of supposedly valid enum
values. Also, factor that out to separate functions for better
localization of the concept.
gdb/ChangeLog:
2015-11-19 Pedro Alves <palves@redhat.com>
* breakpoint.c (software_watchpoint_add_no_memory_location)
(is_no_memory_software_watchpoint): New functions.
(update_watchpoint): Use
software_watchpoint_add_memoryless_location.
(breakpoint_address_bits): Use is_no_memory_software_watchpoint.