[PATCH RESEND] gdb/hppa: guess g packet size
Sven Schnelle
svens@stackframe.org
Mon Nov 3 21:39:22 GMT 2025
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?
Thanks
Sven
More information about the Binutils
mailing list