Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA] Remove make_cleanup_free_section_addr_info
Date: Fri, 16 Mar 2018 03:29:00 -0000	[thread overview]
Message-ID: <4fe276e4-d179-a515-be12-a9e6899bbca2@polymtl.ca> (raw)
In-Reply-To: <87605wspqx.fsf@tromey.com>

On 2018-03-15 10:44 PM, Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <simon.marchi@polymtl.ca> writes:
> 
> Simon> Did you consider changing the section_addr_info struct to use entirely
> Simon> by an std::vector<other_sections>?  Functions that return a
> Simon> section_addr_info could return a vector directly (by value? is that
> Simon> how we say it?), so we shouldn't need any custom unique pointer.
> Simon> Then, other_sections::name can be made into a string, removing the
> Simon> need to free it by hand.
> 
> I didn't really consider it, but thanks for the idea.  It turned out to
> be more invasive, but it did remove one weirdness from
> syms_from_objfile_1.  Previously that function did:
> 
>       local_addr = alloc_section_addr_info (1);
> 
> ... however, it doesn't actually need 1 entry -- the way this is set up,
> the minimum that can be requested is 1, but the returned
> section_addr_info actually has num_sections set to 0.  Obscure!
> 
> In the new code this is replaced by an empty vector.
> 
> Let me know what you think.  I did re-run this through the buildbot.
> 
> One idea I had is that maybe other_sections should have a constructor.
> That would simplify some of the code.

Hi Tom,

I took a quick look, it LGTM, but indeed having a constructor in other_sections
would make it nicer IMO.

Simon


  reply	other threads:[~2018-03-16  3:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-13 16:55 Tom Tromey
2018-03-14 21:20 ` Simon Marchi
2018-03-16  2:45   ` Tom Tromey
2018-03-16  3:29     ` Simon Marchi [this message]
2018-03-16 19:04       ` Tom Tromey
2018-03-16 20:01         ` 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=4fe276e4-d179-a515-be12-a9e6899bbca2@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.com \
    /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