aboutsummaryrefslogtreecommitdiff
path: root/gdb/tracepoint.c
diff options
context:
space:
mode:
authorYao Qi <yao@codesourcery.com>2013-06-26 08:01:57 +0000
committerYao Qi <yao@codesourcery.com>2013-06-26 08:01:57 +0000
commit28a93511837e1a3c26732fef8687fe5fe48735ec (patch)
tree19df91fd3c7a84d28728450c1fe8a4c54c1d6dca /gdb/tracepoint.c
parent18870af79b2034040e6009fc2719759ca6ec75e9 (diff)
downloadgdb-28a93511837e1a3c26732fef8687fe5fe48735ec.zip
gdb-28a93511837e1a3c26732fef8687fe5fe48735ec.tar.gz
gdb-28a93511837e1a3c26732fef8687fe5fe48735ec.tar.bz2
gdb/
2013-06-26 Pedro Alves <pedro@codesourcery.com> Yao Qi <yao@codesourcery.com> * ctf.c (ctf_traceframe_info): Push trace state variables present in the trace data into the traceframe info object. * breakpoint.c (DEF_VEC_I): Remove. * common/filestuff.c (DEF_VEC_I): Likewise. * dwarf2loc.c (DEF_VEC_I): Likewise. * mi/mi-main.c (DEF_VEC_I): Likewise. * common/gdb_vecs.h (DEF_VEC_I): Define vector for int. * features/traceframe-info.dtd: Add tvar element and its attributes. * tracepoint.c (free_traceframe_info): Free vector 'tvars'. (build_traceframe_info): Push trace state variables present in the trace data into the traceframe info object. (traceframe_info_start_tvar): New function. (tvar_attributes): New. (traceframe_info_children): Add "tvar" element. * tracepoint.h (struct traceframe_info) <tvars>: New field. * NEWS: Mention the change in GDB and GDBserver. gdb/doc: 2013-06-26 Pedro Alves <pedro@codesourcery.com> * gdb.texinfo (Traceframe Info Format): Document tvar element and its attributes. gdb/gdbserver: 2013-06-26 Pedro Alves <pedro@codesourcery.com> * tracepoint.c (build_traceframe_info_xml): Output trace state variables present in the trace buffer.
Diffstat (limited to 'gdb/tracepoint.c')
-rw-r--r--gdb/tracepoint.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index 61e9efa..62b1a2c 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -235,6 +235,7 @@ free_traceframe_info (struct traceframe_info *info)
if (info != NULL)
{
VEC_free (mem_range_s, info->memory);
+ VEC_free (int, info->tvars);
xfree (info);
}
@@ -5224,6 +5225,12 @@ build_traceframe_info (char blocktype, void *data)
break;
}
case 'V':
+ {
+ int vnum;
+
+ tfile_read ((gdb_byte *) &vnum, 4);
+ VEC_safe_push (int, info->tvars, vnum);
+ }
case 'R':
case 'S':
{
@@ -5581,6 +5588,21 @@ traceframe_info_start_memory (struct gdb_xml_parser *parser,
r->length = *length_p;
}
+/* Handle the start of a <tvar> element. */
+
+static void
+traceframe_info_start_tvar (struct gdb_xml_parser *parser,
+ const struct gdb_xml_element *element,
+ void *user_data,
+ VEC(gdb_xml_value_s) *attributes)
+{
+ struct traceframe_info *info = user_data;
+ const char *id_attrib = xml_find_attribute (attributes, "id")->value;
+ int id = gdb_xml_parse_ulongest (parser, id_attrib);
+
+ VEC_safe_push (int, info->tvars, id);
+}
+
/* Discard the constructed trace frame info (if an error occurs). */
static void
@@ -5599,10 +5621,18 @@ static const struct gdb_xml_attribute memory_attributes[] = {
{ NULL, GDB_XML_AF_NONE, NULL, NULL }
};
+static const struct gdb_xml_attribute tvar_attributes[] = {
+ { "id", GDB_XML_AF_NONE, NULL, NULL },
+ { NULL, GDB_XML_AF_NONE, NULL, NULL }
+};
+
static const struct gdb_xml_element traceframe_info_children[] = {
{ "memory", memory_attributes, NULL,
GDB_XML_EF_REPEATABLE | GDB_XML_EF_OPTIONAL,
traceframe_info_start_memory, NULL },
+ { "tvar", tvar_attributes, NULL,
+ GDB_XML_EF_REPEATABLE | GDB_XML_EF_OPTIONAL,
+ traceframe_info_start_tvar, NULL },
{ NULL, NULL, NULL, GDB_XML_EF_NONE, NULL, NULL }
};