Thiago Jung Bauermann <bauerman@br.ibm.com>
Implement support for PowerPC BookE ranged watchpoints.
gdb/
* breakpoint.h
(struct breakpoint_ops) <resources_needed>: New method.
Initialize to NULL in all existing breakpoint_ops instances.
(struct breakpoint) <exact>: New field.
(target_exact_watchpoints): Declare external global.
* breakpoint.c (target_exact_watchpoints): New global flag.
(update_watchpoint): Set b->type to bp_hardware_watchpoint and
b->enable_state to bp_enabled before calling
hw_watchpoint_used_count.
(hw_watchpoint_used_count): Iterate over all bp_locations in a
watchpoint. Call breakpoint's breakpoint_ops.resources_needed
if available.
(insert_watchpoint, remove_watchpoint): Use fixed length of 1 byte
if the watchpoint is exact.
(resources_needed_watchpoint): New function.
(watchpoint_breakpoint_ops): Add resources_needed_watchpoint.
(watch_command_1): Set b->exact if the user asked for an exact
watchpoint and one can be set.
(can_use_hardware_watchpoint): Add exact_watchpoints argument.
Pass fixed length of 1 to target_region_ok_for_hw_watchpoint if
the user asks for an exact watchpoint and one can be set. Return
number of needed debug registers to watch the expression.
* gdbtypes.c (is_scalar_type): New function, based on
valprint.c:scalar_type_p.
(is_scalar_type_recursive): New function.
* gdbtypes.h (is_scalar_type_recursive): Declare.
* ppc-linux-nat.c (ppc_linux_region_ok_for_hw_watchpoint): Always
handle regions when ranged watchpoints are available.
(create_watchpoint_request): New function.
(ppc_linux_insert_watchpoint, ppc_linux_remove_watchpoint): Use
create_watchpoint_request.
* rs6000-tdep.c (show_powerpc_exact_watchpoints): New function.
(_initialize_rs6000_tdep): Add `exact-watchpoints' boolean to the
`set powerpc' and `show powerpc' commands.
* target.h (struct target_ops) <to_region_ok_for_hw_watchpoint>:
Mention documentation comment in the target macro.
(target_region_ok_for_hw_watchpoint): Document return value.
gdb/doc/
* gdb.texinfo (PowerPC Embedded): Document ranged watchpoints and
the "set powerpc exact-watchpoints" flag.
Convert hardware watchpoints to use breakpoint_ops.
gdb/
* breakpoint.h (breakpoint_ops) <insert>: Rename to...
<insert_location>: ... this. Return int instead of void.
Accept pointer to struct bp_location instead of pointer to
struct breakpoint. Adapt all implementations.
(breakpoint_ops) <remove>: Rename to...
<remove_location>: ... this. Accept pointer to struct bp_location
instead of pointer to struct breakpoint. Adapt all implementations.
* breakpoint.c (insert_catchpoint): Delete function.
(insert_bp_location): Call the watchpoint or catchpoint's
breakpoint_ops.insert method.
(remove_breakpoint_1): Call the watchpoint or catchpoint's
breakpoint_ops.remove method.
(insert_watchpoint, remove_watchpoint): New functions.
(watchpoint_breakpoint_ops): New structure.
(watch_command_1): Initialize the OPS field.
* inf-child.c (inf_child_insert_fork_catchpoint)
(inf_child_remove_fork_catchpoint, inf_child_insert_vfork_catchpoint)
(inf_child_remove_vfork_catchpoint, inf_child_insert_exec_catchpoint)
(inf_child_remove_exec_catchpoint, inf_child_set_syscall_catchpoint):
Delete functions.
(inf_child_target): Remove initialization of to_insert_fork_catchpoint,
to_remove_fork_catchpoint, to_insert_vfork_catchpoint,
to_remove_vfork_catchpoint, to_insert_exec_catchpoint,
to_remove_exec_catchpoint and to_set_syscall_catchpoint.
* target.c (update_current_target): Change default implementation of
to_insert_fork_catchpoint, to_remove_fork_catchpoint,
to_insert_vfork_catchpoint, to_remove_vfork_catchpoint,
to_insert_exec_catchpoint, to_remove_exec_catchpoint and
to_set_syscall_catchpoint to return_one.
(debug_to_insert_fork_catchpoint, debug_to_insert_vfork_catchpoint)
(debug_to_insert_exec_catchpoint): Report return value.
* target.h (to_insert_fork_catchpoint, to_insert_vfork_catchpoint)
(to_insert_exec_catchpoint): Change declaration to return int instead
of void.
gdb/testsuite/
* gdb.base/foll-exec.exp: Adapt to new error string when the catchpoint
type is not supported.
* gdb.base/foll-fork.exp: Likewise.
* gdb.base/foll-vfork.exp: Likewise.
I find it annoying when using --memory-mapfile that I also need to look
up and manually specify the file size to the following --memory-region
option. So make a length of 0 in the following --memory-region trigger
an auto-sizing of the map to the length of the file being mapped.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
gdb/ChangeLog
* remote-sim.c (gdbsim_store_register): Update API to
sim_store_register to check more error conditions.
include/gdb/ChangeLog
* remote-sim.h (sim_store_register): Update the API
documentation for this function.
sim/erc32/ChangeLog
sim/h8300/ChangeLog
sim/m32c/ChangeLog
sim/mn10300/ChangeLog
sim/ppc/ChangeLog
sim/rx/ChangeLog
sim/v850/ChangeLog
* ???.c (sim_store_register): Update return value to
match new API.
The 2nd arg to SIM_AC_OPTION_HARDWARE is described as "a space separated
list of devices that override the defaults" while the 3rd arg is "a space
separated list of extra target specific devices". But the macro doesn't
seem to treat the 2nd arg this way.
Instead, it will always add the default list of devices, and only add the
extra target specific devices if the 2nd arg is not specified. So rework
the logic slightly to handle the 2nd arg as documented.
This shouldn't affect any targets in the tree as no one passes in a non-
empty value as the 2nd arg.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
These functions either call abort() themselves, or call functions which
are already marked noreturn. Either way, they don't return, so mark them
as such so calling code can assume this. This fixes some uninitialized
warnings due to code paths that end in an abort function.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Looks like we've long been using "AO" instead of "A0" in the enum for the
A0.W. But no one noticed since we aren't using it directly (we assume the
position in the reverse). I've committed this simple fix.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>