From 28a93511837e1a3c26732fef8687fe5fe48735ec Mon Sep 17 00:00:00 2001 From: Yao Qi Date: Wed, 26 Jun 2013 08:01:57 +0000 Subject: gdb/ 2013-06-26 Pedro Alves Yao Qi * 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) : New field. * NEWS: Mention the change in GDB and GDBserver. gdb/doc: 2013-06-26 Pedro Alves * gdb.texinfo (Traceframe Info Format): Document tvar element and its attributes. gdb/gdbserver: 2013-06-26 Pedro Alves * tracepoint.c (build_traceframe_info_xml): Output trace state variables present in the trace buffer. --- gdb/tracepoint.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'gdb/tracepoint.c') 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 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 } }; -- cgit v1.1