public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH 1/4] gdb: allocate subfile with new
Date: Tue, 12 Apr 2022 10:51:42 -0600	[thread overview]
Message-ID: <874k2y5joh.fsf@tromey.com> (raw)
In-Reply-To: <20220412014223.2684060-1-simon.marchi@polymtl.ca> (Simon Marchi via Gdb-patches's message of "Mon, 11 Apr 2022 21:42:20 -0400")

>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:

Simon> Allocate struct subfile with new, initialize its fields instead of
Simon> memset-ing it to 0.  Use a unique_ptr for the window after a subfile has
Simon> been allocated but before it is linked in the buildsym_compunit's list
Simon> of subfile (and therefore owned by the buildsym_compunit.

Looks good to me.

Simon> I can't test the change in xcoffread.c, it's best-effort.  I couldn't
Simon> find where subfiles are freed in that file, I assume they were
Simon> intentionally (or not) leaked.

xcoffread uses buildsym-legacy and creates a scoped_free_pendings, which
I believe does the freeing.

Tom

  parent reply	other threads:[~2022-04-12 16:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-12  1:42 Simon Marchi
2022-04-12  1:42 ` [PATCH 2/4] gdb: change subfile::name and buildsym_compunit::m_comp_dir to strings Simon Marchi
2022-04-12 16:54   ` Tom Tromey
2022-04-12 17:30     ` Simon Marchi
2022-04-12 17:38       ` Tom Tromey
2022-04-12  1:42 ` [PATCH 3/4] gdb: use std::vector for temporary linetable_entry array in arrange_linetable Simon Marchi
2022-04-12 16:58   ` Tom Tromey
2022-04-12  1:42 ` [PATCH 4/4] gdb: change subfile::line_vector to an std::vector Simon Marchi
2022-04-12 17:34   ` Tom Tromey
2022-04-12 18:20     ` Simon Marchi
2022-04-12 16:51 ` Tom Tromey [this message]
2022-04-12 17:28   ` [PATCH 1/4] gdb: allocate subfile with new 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=874k2y5joh.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    /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).