[PATCH] Replace VEC(gdb_xml_value_s) with std::vector
Simon Marchi
simon.marchi@ericsson.com
Thu Dec 7 18:50:00 GMT 2017
On 2017-12-07 09:49 AM, Metzger, Markus T wrote:
> -----Original Message-----
> From: gdb-patches-owner@sourceware.org [mailto:gdb-patches-owner@sourceware.org] On Behalf Of Simon Marchi
> Sent: 02 December 2017 17:50
> To: gdb-patches@sourceware.org
> Cc: Simon Marchi <simon.marchi@polymtl.ca>
> Subject: [PATCH] Replace VEC(gdb_xml_value_s) with std::vector
>
> Hello Simon,
>
> diff --git a/gdb/btrace.c b/gdb/btrace.c index 8338ebfb0a..547f43d691 100644
> --- a/gdb/btrace.c
> +++ b/gdb/btrace.c
> @@ -2004,10 +2004,11 @@ btrace_free_objfile (struct objfile *objfile) static void check_xml_btrace_version (struct gdb_xml_parser *parser,
> const struct gdb_xml_element *element,
> - void *user_data, VEC (gdb_xml_value_s) *attributes)
> + void *user_data,
> + std::vector<gdb_xml_value> &attributes)
> {
> const char *version
> - = (const char *) xml_find_attribute (attributes, "version")->value;
> + = (const char *) xml_find_attribute (attributes,
> + "version")->value.get ();
>
> This looks a bit odd.
Can you clarify what looks odd?
In your quote, there appears to be two added lines (two +):
> - = (const char *) xml_find_attribute (attributes, "version")->value;
> + = (const char *) xml_find_attribute (attributes,
> + "version")->value.get ();
But in my patch it's all on the same line. I am confused.
> @@ -2040,8 +2042,8 @@ parse_xml_btrace_block (struct gdb_xml_parser *parser,
> gdb_xml_error (parser, _("Btrace format error."));
> }
>
> - begin = (ULONGEST *) xml_find_attribute (attributes, "begin")->value;
> - end = (ULONGEST *) xml_find_attribute (attributes, "end")->value;
> + begin = (ULONGEST *) xml_find_attribute (attributes,
> + "begin")->value.get (); end = (ULONGEST *) xml_find_attribute
> + (attributes, "end")->value.get ();
>
> This too.
Same thing here.
Simon
More information about the Gdb-patches
mailing list