This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Replace VEC(gdb_xml_value_s) with std::vector
- From: Simon Marchi <simon dot marchi at ericsson dot com>
- To: "Metzger, Markus T" <markus dot t dot metzger at intel dot com>, Simon Marchi <simon dot marchi at polymtl dot ca>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Thu, 7 Dec 2017 13:50:08 -0500
- Subject: Re: [PATCH] Replace VEC(gdb_xml_value_s) with std::vector
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=simon dot marchi at ericsson dot com;
- References: <20171202164937.13641-1-simon.marchi@polymtl.ca> <A78C989F6D9628469189715575E55B23696207B8@IRSMSX104.ger.corp.intel.com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
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