+2015-09-15 Yao Qi <yao.qi@linaro.org>
+
+ * linux-low.c (linux_supports_conditional_breakpoints): Rename
+ it to ...
+ (linux_supports_hardware_single_step): ... New function.
+ (linux_target_ops): Update.
+ * lynx-low.c (lynx_target_ops): Set field
+ supports_hardware_single_step to target_can_do_hardware_single_step.
+ * nto-low.c (nto_target_ops): Likewise.
+ * spu-low.c (spu_target_ops): Likewise.
+ * win32-low.c (win32_target_ops): Likewise.
+ * target.c (target_can_do_hardware_single_step): New function.
+ * target.h (struct target_ops) <supports_conditional_breakpoints>:
+ Remove. <supports_hardware_single_step>: New field.
+ (target_supports_conditional_breakpoints): Remove.
+ (target_supports_hardware_single_step): New macro.
+ (target_can_do_hardware_single_step): Declare.
+ * server.c (handle_query): Use target_supports_hardware_single_step
+ instead of target_supports_conditional_breakpoints.
+
2015-09-15 Yao Qi <yao.qi@linaro.org>
* linux-aarch64-low.c (aarch64_linux_siginfo_fixup): New
return USE_SIGTRAP_SIGINFO;
}
-/* Implement the supports_conditional_breakpoints target_ops
- method. */
+/* Implement the supports_hardware_single_step target_ops method. */
static int
-linux_supports_conditional_breakpoints (void)
+linux_supports_hardware_single_step (void)
{
- /* GDBserver needs to step over the breakpoint if the condition is
- false. GDBserver software single step is too simple, so disable
- conditional breakpoints if the target doesn't have hardware single
- step. */
return can_hardware_single_step ();
}
linux_supports_stopped_by_sw_breakpoint,
linux_stopped_by_hw_breakpoint,
linux_supports_stopped_by_hw_breakpoint,
- linux_supports_conditional_breakpoints,
+ linux_supports_hardware_single_step,
linux_stopped_by_watchpoint,
linux_stopped_data_address,
#if defined(__UCLIBC__) && defined(HAS_NOMMU) \
NULL, /* supports_stopped_by_sw_breakpoint */
NULL, /* stopped_by_hw_breakpoint */
NULL, /* supports_stopped_by_hw_breakpoint */
- /* Although lynx has hardware single step, still disable this
- feature for lynx, because it is implemented in linux-low.c instead
- of in generic code. */
- NULL, /* supports_conditional_breakpoints */
+ target_can_do_hardware_single_step,
NULL, /* stopped_by_watchpoint */
NULL, /* stopped_data_address */
NULL, /* read_offsets */
NULL, /* supports_stopped_by_sw_breakpoint */
NULL, /* stopped_by_hw_breakpoint */
NULL, /* supports_stopped_by_hw_breakpoint */
- /* Although nto has hardware single step, still disable this
- feature for not, because it is implemented in linux-low.c instead
- of in generic code. */
- NULL, /* supports_conditional_breakpoints */
+ target_can_do_hardware_single_step,
nto_stopped_by_watchpoint,
nto_stopped_data_address,
NULL, /* nto_read_offsets */
strcat (own_buf, ";tracenz+");
}
- /* Support target-side breakpoint conditions and commands. */
- if (target_supports_conditional_breakpoints ())
- strcat (own_buf, ";ConditionalBreakpoints+");
+ if (target_supports_hardware_single_step ())
+ {
+ /* Support target-side breakpoint conditions and commands.
+ GDBserver needs to step over the breakpoint if the condition
+ is false. GDBserver software single step is too simple, so
+ disable conditional breakpoints if the target doesn't have
+ hardware single step. */
+ strcat (own_buf, ";ConditionalBreakpoints+");
+ }
strcat (own_buf, ";BreakpointCommands+");
if (target_supports_agent ())
NULL, /* supports_stopped_by_sw_breakpoint */
NULL, /* stopped_by_hw_breakpoint */
NULL, /* supports_stopped_by_hw_breakpoint */
- NULL, /* supports_conditional_breakpoints */
+ NULL, /* supports_hardware_single_step */
NULL,
NULL,
NULL,
return (*the_target->kill) (pid);
}
+
+/* Target can do hardware single step. */
+
+int
+target_can_do_hardware_single_step (void)
+{
+ return 1;
+}
HW breakpoint triggering. */
int (*supports_stopped_by_hw_breakpoint) (void);
- /* Returns true if the target can evaluate conditions of
- breakpoints. */
- int (*supports_conditional_breakpoints) (void);
+ /* Returns true if the target can do hardware single step. */
+ int (*supports_hardware_single_step) (void);
/* Returns 1 if target was stopped due to a watchpoint hit, 0 otherwise. */
(the_target->supports_stopped_by_hw_breakpoint ? \
(*the_target->supports_stopped_by_hw_breakpoint) () : 0)
-#define target_supports_conditional_breakpoints() \
- (the_target->supports_conditional_breakpoints ? \
- (*the_target->supports_conditional_breakpoints) () : 0)
+#define target_supports_hardware_single_step() \
+ (the_target->supports_hardware_single_step ? \
+ (*the_target->supports_hardware_single_step) () : 0)
#define target_stopped_by_hw_breakpoint() \
(the_target->stopped_by_hw_breakpoint ? \
const char *target_pid_to_str (ptid_t);
+int target_can_do_hardware_single_step (void);
+
#endif /* TARGET_H */
NULL, /* supports_stopped_by_sw_breakpoint */
NULL, /* stopped_by_hw_breakpoint */
NULL, /* supports_stopped_by_hw_breakpoint */
- /* Although win32-i386 has hardware single step, still disable this
- feature for win32, because it is implemented in linux-low.c instead
- of in generic code. */
- NULL, /* supports_conditional_breakpoints */
+ target_can_do_hardware_single_step,
win32_stopped_by_watchpoint,
win32_stopped_data_address,
NULL, /* read_offsets */