From: Sven Schnelle <svens@stackframe.org>
To: Simon Marchi <simark@simark.ca>
Cc: Tom Tromey <tom@tromey.com>,
gdb-patches@sourceware.org, Helge Deller <deller@gmx.de>,
John David Anglin <dave.anglin@bell.net>,
binutils@sourceware.org
Subject: Re: [PATCH RESEND] gdb/hppa: guess g packet size
Date: Tue, 04 Nov 2025 07:31:06 +0100 [thread overview]
Message-ID: <87ldkmpavp.fsf@stackframe.org> (raw)
In-Reply-To: <03732666-279b-4b21-a23f-165dd04fc99d@simark.ca> (Simon Marchi's message of "Mon, 3 Nov 2025 17:59:47 -0500")
Simon Marchi <simark@simark.ca> writes:
> On 2025-11-03 16:39, Sven Schnelle wrote:
>> Tom Tromey <tom@tromey.com> writes:
>>
>>>>>>>> "Sven" == Sven Schnelle <svens@stackframe.org> writes:
>>>
>>> Sven> With qemu supporting 64 bit now, add some code to determine the
>>> Sven> register size of a hppa remote target.
>>>
>>> Thanks for the patch.
>>>
>>> Sven> +struct target_desc *hppa_tdesc32;
>>> Sven> +struct target_desc *hppa_tdesc64;
>>>
>>> These should be 'static'. They can also just be objects, not pointers,
>>> I think.
>>
>>> Sven> + hppa_tdesc32 = allocate_target_description ().release ();
>>> Sven> + set_tdesc_property (hppa_tdesc32, PROPERTY_GP32, "");
>>> Sven> +
>>> Sven> + hppa_tdesc64 = allocate_target_description ().release ();
>>> Sven> + set_tdesc_property (hppa_tdesc64, PROPERTY_GP64, "");
>>>
>>> The reason I suggested using objects and not pointers is that, although
>>> we do have a number of calls to .release() in gdb, we somewhat try to
>>> avoid them.
>>
>> I might of course be wrong because i don't know the code well, but
>> struct target_desc is declared in target-description.c and in the
>> tdep file it's only used as opaque type. So it can't be used as object
>> because the size isn't known. Is this correct, or am i misreading the
>> code?
>
> It seems you're right. My suggestion would perhaps be to make the
> global (well, static) objects of type `target_desc_up`, you won't need
> the release then.
Thanks. I just sent a v2.
prev parent reply other threads:[~2025-11-04 6:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-01 8:05 Sven Schnelle
2025-11-01 13:48 ` Helge Deller
2025-11-03 21:22 ` Tom Tromey
2025-11-03 21:39 ` Sven Schnelle
2025-11-03 22:59 ` Simon Marchi
2025-11-04 6:31 ` Sven Schnelle [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=87ldkmpavp.fsf@stackframe.org \
--to=svens@stackframe.org \
--cc=binutils@sourceware.org \
--cc=dave.anglin@bell.net \
--cc=deller@gmx.de \
--cc=gdb-patches@sourceware.org \
--cc=simark@simark.ca \
--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