From: Simon Marchi <simon.marchi@polymtl.ca>
To: Kevin Buettner <kevinb@redhat.com>, gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@efficios.com>
Subject: Re: [PATCH] gdb/solib-frv: remove manual memory management
Date: Fri, 20 Feb 2026 13:05:25 -0500 [thread overview]
Message-ID: <8bf3d8c0-2ac8-4f67-bbab-571381e950a5@polymtl.ca> (raw)
In-Reply-To: <20260217163253.0a8f635e@f42-zbm-amd>
On 2/17/26 6:32 PM, Kevin Buettner wrote:
> On Tue, 17 Feb 2026 16:16:44 -0500
> simon.marchi@polymtl.ca wrote:
>
>> From: Simon Marchi <simon.marchi@efficios.com>
>>
>> - Make fetch_loadmap return a unique pointer, adjust callers
>> - Make fetch_loadmap use a unique pointer for ext_ldmbuf
>> - Replace some fields of lm_info_frv to be unique pointers
>> - Make main_executable_lm_info a unique pointer
>>
>> I can only build-test this.
>
> I haven't had access to an FR-V machine in a long, long time, so I can't
> properly test it either.
>
> I found a comment that should be updated...
>
>> @@ -102,19 +105,20 @@ struct int_elf32_fdpic_loadmap {
>> struct int_elf32_fdpic_loadseg segs[1 /* nsegs, actually */];
>> };
>>
>> +using int_elf32_fdpic_loadmap_up
>> + = gdb::unique_xmalloc_ptr<int_elf32_fdpic_loadmap>;
>> +
>> /* Given address LDMADDR, fetch and decode the loadmap at that address.
>> Return NULL if there is a problem reading the target memory or if
>> there doesn't appear to be a loadmap at the given address. The
>> allocated space (representing the loadmap) returned by this
>> function may be freed via a single call to xfree(). */
>
> The remark about xfree should be removed and NULL should be replaced
> with nullptr.
Fixed.
>
>> -static struct int_elf32_fdpic_loadmap *
>> +static int_elf32_fdpic_loadmap_up
>> fetch_loadmap (CORE_ADDR ldmaddr)
>
> [Above lines included for context.]
>
> Okay with that comment fixed...
>
> Approved-by: Kevin Buettner <kevinb@redhat.com>
Thanks, pushed.
Simon
prev parent reply other threads:[~2026-02-20 18:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-17 21:16 simon.marchi
2026-02-17 23:32 ` Kevin Buettner
2026-02-18 18:34 ` Tom Tromey
2026-02-19 7:14 ` Kevin Buettner
2026-02-20 18:05 ` Simon Marchi [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=8bf3d8c0-2ac8-4f67-bbab-571381e950a5@polymtl.ca \
--to=simon.marchi@polymtl.ca \
--cc=gdb-patches@sourceware.org \
--cc=kevinb@redhat.com \
--cc=simon.marchi@efficios.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