[PATCH RESEND] gdb/hppa: guess g packet size
Sven Schnelle
svens@stackframe.org
Tue Nov 4 06:31:06 GMT 2025
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.
More information about the Binutils
mailing list