aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/target.h
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2015-03-04 20:41:16 +0000
committerPedro Alves <palves@redhat.com>2015-03-04 20:41:16 +0000
commit1ec68e26c982a256df03d22dce072b88ab117a73 (patch)
tree55fa2034593a4191263d1ad05cd9f8dfb7752bab /gdb/gdbserver/target.h
parentfaf09f0119da40d9b408021ad5665a906e00ee59 (diff)
downloadgdb-1ec68e26c982a256df03d22dce072b88ab117a73.zip
gdb-1ec68e26c982a256df03d22dce072b88ab117a73.tar.gz
gdb-1ec68e26c982a256df03d22dce072b88ab117a73.tar.bz2
gdbserver: Support the "swbreak"/"hwbreak" stop reasons
This patch teaches the core of gdbserver about the new "swbreak" and "hwbreak" stop reasons, and adds the necessary hooks a backend needs to implement to support the feature. gdb/gdbserver/ChangeLog: 2015-03-04 Pedro Alves <palves@redhat.com> * remote-utils.c (prepare_resume_reply): Report swbreak/hbreak. * server.c (swbreak_feature, hwbreak_feature): New globals. (handle_query) <qSupported>: Handle "swbreak+" and "hwbreak+". (captured_main): Clear swbreak_feature and hwbreak_feature. * server.h (swbreak_feature, hwbreak_feature): Declare. * target.h (struct target_ops) <stopped_by_sw_breakpoint, supports_stopped_by_sw_breakpoint, stopped_by_hw_breakpoint, supports_stopped_by_hw_breakpoint>: New fields. (target_supports_stopped_by_sw_breakpoint) (target_stopped_by_sw_breakpoint) (target_supports_stopped_by_hw_breakpoint) (target_stopped_by_hw_breakpoint): Declare.
Diffstat (limited to 'gdb/gdbserver/target.h')
-rw-r--r--gdb/gdbserver/target.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/gdb/gdbserver/target.h b/gdb/gdbserver/target.h
index 05feb36..126c861 100644
--- a/gdb/gdbserver/target.h
+++ b/gdb/gdbserver/target.h
@@ -207,6 +207,21 @@ struct target_ops
int (*remove_point) (enum raw_bkpt_type type, CORE_ADDR addr,
int size, struct raw_breakpoint *bp);
+ /* Returns 1 if the target stopped because it executed a software
+ breakpoint instruction, 0 otherwise. */
+ int (*stopped_by_sw_breakpoint) (void);
+
+ /* Returns true if the target knows whether a trap was caused by a
+ SW breakpoint triggering. */
+ int (*supports_stopped_by_sw_breakpoint) (void);
+
+ /* Returns 1 if the target stopped for a hardware breakpoint. */
+ int (*stopped_by_hw_breakpoint) (void);
+
+ /* Returns true if the target knows whether a trap was caused by a
+ HW breakpoint triggering. */
+ int (*supports_stopped_by_hw_breakpoint) (void);
+
/* Returns 1 if target was stopped due to a watchpoint hit, 0 otherwise. */
int (*stopped_by_watchpoint) (void);
@@ -515,6 +530,22 @@ int kill_inferior (int);
(the_target->supports_range_stepping ? \
(*the_target->supports_range_stepping) () : 0)
+#define target_supports_stopped_by_sw_breakpoint() \
+ (the_target->supports_stopped_by_sw_breakpoint ? \
+ (*the_target->supports_stopped_by_sw_breakpoint) () : 0)
+
+#define target_stopped_by_sw_breakpoint() \
+ (the_target->stopped_by_sw_breakpoint ? \
+ (*the_target->stopped_by_sw_breakpoint) () : 0)
+
+#define target_supports_stopped_by_hw_breakpoint() \
+ (the_target->supports_stopped_by_hw_breakpoint ? \
+ (*the_target->supports_stopped_by_hw_breakpoint) () : 0)
+
+#define target_stopped_by_hw_breakpoint() \
+ (the_target->stopped_by_hw_breakpoint ? \
+ (*the_target->stopped_by_hw_breakpoint) () : 0)
+
/* Start non-stop mode, returns 0 on success, -1 on failure. */
int start_non_stop (int nonstop);