[PATCH 2/4] arc: Recognize registers available on Linux targets

Tom Tromey tom@tromey.com
Fri Apr 24 13:50:14 GMT 2020


>>>>> ">" == Shahab Vahedi via Gdb-patches <gdb-patches@sourceware.org> writes:

>> +      const char *const r58_names[] = {
>> +	core_regs[58],

This should probably say ARC_R58_REGNUM?

>> +	core_regs[59],

ARC_R59_REGNUM ?

>>    /* Allocate the ARC-private target-dependent information structure, and the
>>       GDB target-independent information structure.  */
>>    struct gdbarch_tdep *tdep = XCNEW (struct gdbarch_tdep);
>> 	tdep-> jb_pc = -1; /* No longjmp support by default.  */
>> +
>> +  if (!arc_tdesc_init (info, &tdesc, &tdesc_data, tdep))
>> +    {
>> +      XDELETE (tdep);
>> +      return NULL;
>> +    }

gdb doesn't use XDELETE, but rather "xfree".
You might as well "return nullptr;" while you're at it.

thanks,
Tom


More information about the Gdb-patches mailing list