From: Simon Marchi <simon.marchi@polymtl.ca>
To: Marco Barisione <mbarisione@undo.io>
Cc: GDB patches mailing list <gdb-patches@sourceware.org>
Subject: Re: [PATCH v2] gdb: make gdbpy_parse_command_name return a unique_xmalloc_ptr
Date: Wed, 12 May 2021 10:18:41 -0400 [thread overview]
Message-ID: <56ed3c1f-60b8-3b6d-a6dd-f612fbd8116f@polymtl.ca> (raw)
In-Reply-To: <CAKDUT2KKifZ3KxyBAdn2XN7qbuon88Oe45cBYrUCvk15bji94g@mail.gmail.com>
On 2021-05-12 10:12 a.m., Marco Barisione wrote:> On Tue, 23 Mar 2021 at 18:38, Simon Marchi via Gdb-patches
> <gdb-patches@sourceware.org> wrote:
>>
>> This avoids some manual memory management.
>>
>> cmdpy_init correctly transfers ownership of the name to the
>> cmd_list_element, as it sets the name_allocated flag. However,
>> cmdpy_init (and add_setshow_generic) doesn't, it looks like the name is
>> just leaked. This is a bit tricky, because it actually creates two
>> commands (one set and one show), it would take a bit of refactoring of
>> the command code to give each their own allocated copy. For now, just
>> keep doing what the current code does but in a more explicit fashion,
>> with an explicit release.
>>
>> gdb/ChangeLog:
>>
>> * python/python-internal.h (gdbpy_parse_command_name): Return
>> gdb::unique_xmalloc_ptr.
>> * python/py-cmd.c (gdbpy_parse_command_name): Likewise.
>> (cmdpy_init): Adjust.
>> * python/py-param.c (parmpy_init): Adjust.
>> (add_setshow_generic): Take gdb::unique_xmalloc_ptr, release it
>> when done.
>
> Any news on this patch (which looks good to me)?
> You wrote this in response to my command renaming work[1]. Sorry for
> only looking at it now.
> It would be helpful to merge it, so I can rebase my command renaming
> patches on this. If it's not ready and needs more work, I'm happy to help.
>
> [1] https://sourceware.org/pipermail/gdb-patches/2021-March/177165.html
>
I had forgotten about it! I see that Tom sent some comments. I'll
check that and merge or send a new version accordingly.
Simon
next prev parent reply other threads:[~2021-05-12 14:18 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-23 17:55 [PATCH] " Simon Marchi
2021-03-23 18:07 ` Andreas Schwab
2021-03-23 18:11 ` Simon Marchi
2021-03-23 18:21 ` Simon Marchi
2021-04-01 17:54 ` Tom Tromey
2021-03-23 18:38 ` [PATCH v2] " Simon Marchi
2021-04-01 17:56 ` Tom Tromey
2021-05-12 17:29 ` Simon Marchi
2021-05-12 14:12 ` Marco Barisione
2021-05-12 14:18 ` Simon Marchi [this message]
2021-05-12 17:51 ` [pushed] " 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=56ed3c1f-60b8-3b6d-a6dd-f612fbd8116f@polymtl.ca \
--to=simon.marchi@polymtl.ca \
--cc=gdb-patches@sourceware.org \
--cc=mbarisione@undo.io \
/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).