[COMMITTED PATCH] gdb: LoongArch: Implement the push_dummy_call gdbarch method
Tiezhu Yang
yangtiezhu@loongson.cn
Sat Jul 16 11:58:17 GMT 2022
On 07/16/2022 01:27 AM, Tom Tromey wrote:
>>>>>> Tiezhu Yang <yangtiezhu@loongson.cn> writes:
>
>> +static void
>> +pass_in_gar (struct regcache *regcache, unsigned int gar, const gdb_byte *val)
>
> In gdb, functions generally should have an introductory comment
> explaining their purpose.
>
>> +static __attribute__((aligned(16))) gdb_byte buf[1024] = { 0 };
>> +static gdb_byte *addr = buf;
>
> I don't understand why a global is needed here, or why the attribute is
> needed. But anyway, the attribute isn't really portable, and since this
> is tdep code (not specific to some host where you could maybe get away
> with assuming the compiler), it can't be used.
>
>> +static unsigned int fixed_point_members = 0;
>> +static unsigned int floating_point_members = 0;
>> +static bool first_member_is_fixed_point = false;
>
> Please don't use globals for this kind of thing.
> You can make a new object or you can pass pointers to locals.
>
>> + /* integer or pointer type is passed in GAR.
>> + * If no GAR is available, it€s passed on the stack.
>> + * When passed in registers or on the stack,
>> + * the unsigned integer scalars are zero-extended to GRLEN bits,
>> + * and the signed integer scalars are sign-extended. */
>
> In the gdb style, subsequent comment lines don't have the "*".
>
> thanks,
> Tom
>
Hi Tom,
Thank you very much.
I modify the related code as you suggested, please review the patch.
https://sourceware.org/pipermail/gdb-patches/2022-July/190814.html
Thanks,
Tiezhu
More information about the Gdb-patches
mailing list