public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@ericsson.com>
To: "Metzger, Markus T" <markus.t.metzger@intel.com>,
	Simon Marchi	<simon.marchi@polymtl.ca>,
	"gdb-patches@sourceware.org"	<gdb-patches@sourceware.org>
Subject: Re: [PATCH] Replace VEC(gdb_xml_value_s) with std::vector
Date: Thu, 07 Dec 2017 18:50:00 -0000	[thread overview]
Message-ID: <9142baa8-d50b-1b14-3809-20adbb0b5488@ericsson.com> (raw)
In-Reply-To: <A78C989F6D9628469189715575E55B23696207B8@IRSMSX104.ger.corp.intel.com>

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

  reply	other threads:[~2017-12-07 18:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-02 16:50 Simon Marchi
2017-12-07 14:49 ` Metzger, Markus T
2017-12-07 18:50   ` Simon Marchi [this message]
2017-12-08  8:04     ` Metzger, Markus T
2017-12-08  8:19       ` Simon Marchi
2017-12-08  8:26         ` Metzger, Markus T
2018-01-07 15:46 ` Simon Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9142baa8-d50b-1b14-3809-20adbb0b5488@ericsson.com \
    --to=simon.marchi@ericsson.com \
    --cc=gdb-patches@sourceware.org \
    --cc=markus.t.metzger@intel.com \
    --cc=simon.marchi@polymtl.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).