Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Simon Marchi <simon.marchi@polymtl.ca>
Cc: Simon Marchi <simon.marchi@ericsson.com>,
	gdb-patches@sourceware.org, arnez@linux.vnet.ibm.com
Subject: Re: [PATCH] Make dwarf_expr_piece::pieces an std::vector
Date: Thu, 14 Sep 2017 14:14:00 -0000	[thread overview]
Message-ID: <fad05e52-1a77-9b86-d80d-816f3270ab84@redhat.com> (raw)
In-Reply-To: <b0b8e11af47b21fff242168dc0e06297@polymtl.ca>


On 09/14/2017 02:57 PM, Simon Marchi wrote:
> I initially left it as a pointer out of laziness, but I've changed it to
> a reference now.  I am pushing the patch with this and the const rvalue
> reference fixed.
> 
> I tried to add some constructors, but I didn't know how to design it
> nicely to support different types of value locations.  

Ah, yes, now that I look better, I see how the function is calling
private context functions.

> Maybe the best
> would be to add some factory functions that build various kinds of
> pieces, and make the constructor private.  Something like:
> 
> struct dwarf_expr_piece
> {
>   static dwarf_expr_piece make_memory_piece (CORE_ADDR addr, bool
> in_stack_memory)
>   static dwarf_expr_piece make_register_piece (int regno);
> 
> private:
>   dwarf_expr_piece ();
> };
> 
> I'll try that for a follow-up patch.

That might work.  I'm fine with the status quo too, btw.

Thanks,
Pedro Alves


      reply	other threads:[~2017-09-14 14:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-14  8:17 Simon Marchi
2017-09-14  9:21 ` Pedro Alves
2017-09-14  9:26   ` Simon Marchi
2017-09-14 10:24     ` Pedro Alves
2017-09-14 13:58       ` Simon Marchi
2017-09-14 14:14         ` Pedro Alves [this message]

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=fad05e52-1a77-9b86-d80d-816f3270ab84@redhat.com \
    --to=palves@redhat.com \
    --cc=arnez@linux.vnet.ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@ericsson.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