summaryrefslogtreecommitdiff
path: root/gdb/target.h
diff options
context:
space:
mode:
authorKwok Yeung <kcy@sourceware.org>2011-05-12 12:09:17 +0000
committerKwok Yeung <kcy@sourceware.org>2011-05-12 12:09:17 +0000
commitd248b706a328fbba18c4320880b36df5488b1e91 (patch)
tree4147e6bb3093b75c1a62833173b0213b060505bf /gdb/target.h
parentde1491f042ec18741bc7427aeb69d9c5ffa1cbd7 (diff)
downloadbinutils-gdb-d248b706a328fbba18c4320880b36df5488b1e91.tar.gz
Add support for enabling and disabling tracepoints while a trace
experiment is still running. gdb/ * breakpoint.c (disable_breakpoint): Disable all locations associated with a tracepoint on target if a trace experiment is running. (disable_command): Disable a specific tracepoint location on target if a trace experiment is running. (do_enable_breakpoint): Enable all locations associated with a tracepoint on target if a trace experiment is running. (enable_command) Enable a specific tracepoint location on target if a trace experiment is running. * target.c (update_current_target): Add INHERIT and de_fault clauses for to_supports_enable_disable_tracepoint, to_enable_tracepoint and to_disable_tracepoint. * target.h: Add declaration of struct bp_location. (struct target_ops): Add new functions to_supports_enable_disable_tracepoint, to_enable_tracepoint and to_disable_tracepoint to target operations. (target_supports_enable_disable_tracepoint): New macro. (target_enable_tracepoint): New macro. (target_disable_tracepoint): New macro. * remote.c (struct remote_state): Add new field. (remote_enable_disable_tracepoint_feature): New. (remote_protocol_features): Add new entry. (remote_supports_enable_disable_tracepoint): New. (remote_enable_tracepoint): New. (remote_disable_tracepoint): New. (init_remote_ops): Add remote_enable_tracepoint, remote_disable_tracepoint and remote_supports_enable_disable_tracepoint to remote operations. * tracepoint.c (start_tracing): Allow tracing to start without any tracepoints enabled with just a warning if they can be re-enabled later. * NEWS: Add news item for the new behaviour of the enable and disable GDB commands when applied to tracepoints. Add news items for the new remote packets QTEnable and QTDisable. gdb/doc/ * gdb.texinfo: Document change in the behaviour of the enable and disable GDB commands when applied to tracepoints. Document the EnableDisableTracepoints remote stub feature. Document QTEnable and QTDisable in the list of tracepoint packets. gdb/gdbserver/ * server.c (handle_query): Add EnableDisableTracepoints to the list of supported features. * tracepoint.c (clear_installed_tracepoints): Uninstall disabled tracepoints. (cmd_qtenable_disable): New. (cmd_qtstart): Install tracepoints even if disabled. (handle_tracepoint_general_set): Add call to cmd_qtenable_disable on receiving a QTEnable or QTDisable packet. (gdb_collect): Skip data collection if fast tracepoint is disabled. (ust_marker_to_static_tracepoint): Do not ignore disabled static tracepoints. (gdb_probe): Skip data collection if static tracepoint is disabled.
Diffstat (limited to 'gdb/target.h')
-rw-r--r--gdb/target.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/gdb/target.h b/gdb/target.h
index 52e02761a03..fd58bd95c98 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -28,6 +28,7 @@ struct objfile;
struct ui_file;
struct mem_attrib;
struct target_ops;
+struct bp_location;
struct bp_target_info;
struct regcache;
struct target_section_table;
@@ -644,6 +645,10 @@ struct target_ops
simultaneously? */
int (*to_supports_multi_process) (void);
+ /* Does this target support enabling and disabling tracepoints while a trace
+ experiment is running? */
+ int (*to_supports_enable_disable_tracepoint) (void);
+
/* Determine current architecture of thread PTID.
The target is supposed to determine the architecture of the code where
@@ -674,6 +679,12 @@ struct target_ops
/* Send full details of a trace state variable to the target. */
void (*to_download_trace_state_variable) (struct trace_state_variable *tsv);
+ /* Enable a tracepoint on the target. */
+ void (*to_enable_tracepoint) (struct bp_location *location);
+
+ /* Disable a tracepoint on the target. */
+ void (*to_disable_tracepoint) (struct bp_location *location);
+
/* Inform the target info of memory regions that are readonly
(such as text sections), and so it should return data from
those rather than look in the trace buffer. */
@@ -873,6 +884,12 @@ struct address_space *target_thread_address_space (ptid_t);
#define target_supports_multi_process() \
(*current_target.to_supports_multi_process) ()
+/* Returns true if this target can enable and disable tracepoints
+ while a trace experiment is running. */
+
+#define target_supports_enable_disable_tracepoint() \
+ (*current_target.to_supports_enable_disable_tracepoint) ()
+
/* Invalidate all target dcaches. */
extern void target_dcache_invalidate (void);
@@ -1457,6 +1474,12 @@ extern int target_search_memory (CORE_ADDR start_addr,
#define target_download_trace_state_variable(tsv) \
(*current_target.to_download_trace_state_variable) (tsv)
+#define target_enable_tracepoint(loc) \
+ (*current_target.to_enable_tracepoint) (loc)
+
+#define target_disable_tracepoint(loc) \
+ (*current_target.to_disable_tracepoint) (loc)
+
#define target_trace_start() \
(*current_target.to_trace_start) ()