Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH 3/3] gdb: make macro_stringify return a gdb::unique_xmalloc_ptr<char>
Date: Tue, 30 Jun 2020 14:55:22 -0600	[thread overview]
Message-ID: <87r1tw8e9x.fsf@tromey.com> (raw)
In-Reply-To: <20200628165628.96730-4-simon.marchi@polymtl.ca> (Simon Marchi via Gdb-patches's message of "Sun, 28 Jun 2020 12:56:28 -0400")

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

Simon> The change to macro_stringify is straightforward.  This allows removing
Simon> the manual memory management in fixup_definition.

Simon> @@ -882,25 +882,19 @@ macro_undef (struct macro_source_file *source, int line,
Simon>  static struct macro_definition *
Simon>  fixup_definition (const char *filename, int line, struct macro_definition *def)
Simon>  {
Simon> -  static char *saved_expansion;
[...]
Simon> +  gdb::unique_xmalloc_ptr<char> saved_expansion;
 
This loses the "static", but that's necessary because this function
returns "def", which has a pointer to the contents.

Tom


  reply	other threads:[~2020-06-30 20:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-28 16:56 [PATCH 0/3] Small cleanups in macro code Simon Marchi
2020-06-28 16:56 ` [PATCH 1/3] gdb: remove callback in macro expand functions Simon Marchi
2020-06-30 20:47   ` Tom Tromey
2020-06-30 22:14     ` Matt Rice
2020-06-30 22:26       ` Simon Marchi
2020-06-28 16:56 ` [PATCH 2/3] gdb: make macro_expand_next return a gdb::unique_xmalloc_ptr<char> Simon Marchi
2020-06-30 20:53   ` Tom Tromey
2020-06-30 22:26     ` Simon Marchi
2020-06-28 16:56 ` [PATCH 3/3] gdb: make macro_stringify " Simon Marchi
2020-06-30 20:55   ` Tom Tromey [this message]
2020-07-01  0:26     ` Simon Marchi
2020-07-01 15:36       ` Tom Tromey
2020-07-04  2:28         ` 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=87r1tw8e9x.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