aboutsummaryrefslogtreecommitdiff
path: root/gdb/remote.c
diff options
context:
space:
mode:
authorYao Qi <yao@codesourcery.com>2011-11-14 15:18:54 +0000
committerYao Qi <yao@codesourcery.com>2011-11-14 15:18:54 +0000
commit1e4d17643d49f247df304245675551ee71995a37 (patch)
treecfc5abd91467ef7a0270e37de1512e806cf4a1c0 /gdb/remote.c
parent5c73ff4ec2c54aa1788d012003e59bfbd14a896b (diff)
downloadgdb-1e4d17643d49f247df304245675551ee71995a37.zip
gdb-1e4d17643d49f247df304245675551ee71995a37.tar.gz
gdb-1e4d17643d49f247df304245675551ee71995a37.tar.bz2
gdb/
* remote.c (struct remote_state): <install_in_trace> new field. (PACKET_InstallInTrace): New enum value. (remote_install_in_trace_feature): Support InstallInTrace. (remote_supports_install_in_trace): Likewise. (remote_protocol_features): Likewise. (_initialize_remote): Likewise. (remote_can_download_tracepoint): New. * target.h (struct target): New field `to_can_download_tracepoint'. (target_can_download_tracepoint): New macro. * target.c (update_current_target): Update. * breakpoint.h (struct bp_location): Add comment on field `duplicate'. (should_be_inserted): Don't differentiate breakpoint and tracepoint. (remove_breakpoints): Don't remove tracepoints. (tracepoint_locations_match ): New. (breakpoint_locations_match): Call it. (disable_breakpoints_in_unloaded_shlib): Handle tracepoint. (download_tracepoint_locations): New. (update_global_location_list): Call it. * tracepoint.c (find_matching_tracepoint): Delete. (find_matching_tracepoint_location): Renamed from find_matching_tracepoint. Return bp_location rather than tracepoint. (merge_uploaded_tracepoints): Set `inserted' field to 1 if tracepoint is found. gdb/doc/ * gdb.texinfo (Create and Delete Tracepoints): Describe changed behavior of tracepoint. (General Query Packets): New feature InstallInTrace. (Remote Configuration): Document "set remote install-in-trace-packet". gdb/gdbserver/ * server.c (handle_query): Handle InstallInTrace for qSupported. * tracepoint.c (add_tracepoint): Sort list. (install_tracepoint, download_tracepoint): New. (cmd_qtdp): Call them to install and download tracepoints. (sort_tracepoints): Removed. (cmd_qtstart): Update. gdb/testsuite/ * gdb.trace/change-loc-1.c: New. * gdb.trace/change-loc-2.c: New. * gdb.trace/change-loc.c: New. * gdb.trace/change-loc.exp: New. * gdb.trace/change-loc.h: New. * gdb.trace/trace-break.c (marker): Define new symbol. * gdb.trace/trace-break.exp (break_trace_same_addr_5): New. (break_trace_same_addr_6): New.
Diffstat (limited to 'gdb/remote.c')
-rw-r--r--gdb/remote.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/gdb/remote.c b/gdb/remote.c
index 9271875..a6d5e5f 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -323,6 +323,10 @@ struct remote_state
/* True if the stub reports support for static tracepoints. */
int static_tracepoints;
+ /* True if the stub reports support for installing tracepoint while
+ tracing. */
+ int install_in_trace;
+
/* True if the stub can continue running a trace while GDB is
disconnected. */
int disconnected_tracing;
@@ -1261,6 +1265,7 @@ enum {
PACKET_ConditionalTracepoints,
PACKET_FastTracepoints,
PACKET_StaticTracepoints,
+ PACKET_InstallInTrace,
PACKET_bc,
PACKET_bs,
PACKET_TracepointSource,
@@ -3696,6 +3701,16 @@ remote_static_tracepoint_feature (const struct protocol_feature *feature,
}
static void
+remote_install_in_trace_feature (const struct protocol_feature *feature,
+ enum packet_support support,
+ const char *value)
+{
+ struct remote_state *rs = get_remote_state ();
+
+ rs->install_in_trace = (support == PACKET_ENABLE);
+}
+
+static void
remote_disconnected_tracing_feature (const struct protocol_feature *feature,
enum packet_support support,
const char *value)
@@ -3761,6 +3776,8 @@ static struct protocol_feature remote_protocol_features[] = {
PACKET_FastTracepoints },
{ "StaticTracepoints", PACKET_DISABLE, remote_static_tracepoint_feature,
PACKET_StaticTracepoints },
+ {"InstallInTrace", PACKET_DISABLE, remote_install_in_trace_feature,
+ PACKET_InstallInTrace},
{ "DisconnectedTracing", PACKET_DISABLE, remote_disconnected_tracing_feature,
-1 },
{ "ReverseContinue", PACKET_DISABLE, remote_supported_packet,
@@ -9748,6 +9765,14 @@ remote_supports_static_tracepoints (void)
}
static int
+remote_supports_install_in_trace (void)
+{
+ struct remote_state *rs = get_remote_state ();
+
+ return rs->install_in_trace;
+}
+
+static int
remote_supports_enable_disable_tracepoint (void)
{
struct remote_state *rs = get_remote_state ();
@@ -10008,6 +10033,24 @@ remote_download_tracepoint (struct bp_location *loc)
do_cleanups (old_chain);
}
+static int
+remote_can_download_tracepoint (void)
+{
+ struct trace_status *ts = current_trace_status ();
+ int status = remote_get_trace_status (ts);
+
+ if (status == -1 || !ts->running_known || !ts->running)
+ return 0;
+
+ /* If we are in a tracing experiment, but remote stub doesn't support
+ installing tracepoint in trace, we have to return. */
+ if (!remote_supports_install_in_trace ())
+ return 0;
+
+ return 1;
+}
+
+
static void
remote_download_trace_state_variable (struct trace_state_variable *tsv)
{
@@ -10480,6 +10523,7 @@ Specify the serial device it is connected to\n\
remote_ops.to_supports_string_tracing = remote_supports_string_tracing;
remote_ops.to_trace_init = remote_trace_init;
remote_ops.to_download_tracepoint = remote_download_tracepoint;
+ remote_ops.to_can_download_tracepoint = remote_can_download_tracepoint;
remote_ops.to_download_trace_state_variable
= remote_download_trace_state_variable;
remote_ops.to_enable_tracepoint = remote_enable_tracepoint;
@@ -10997,6 +11041,9 @@ Show the maximum size of the address (in bits) in a memory packet."), NULL,
add_packet_config_cmd (&remote_protocol_packets[PACKET_StaticTracepoints],
"StaticTracepoints", "static-tracepoints", 0);
+ add_packet_config_cmd (&remote_protocol_packets[PACKET_InstallInTrace],
+ "InstallInTrace", "install-in-trace", 0);
+
add_packet_config_cmd (&remote_protocol_packets[PACKET_qXfer_statictrace_read],
"qXfer:statictrace:read", "read-sdata-object", 0);