GDB broken on MIPS targets with unmarked binaries

Andrew Cagney ac131313@cygnus.com
Wed Jun 5 14:41:00 GMT 2002


> The expansion appears to be:
>> tdep->mips_fp_register_double = (((((38) >= 38 && (38) < 38 +32) ?
>> 	builtin_type_float : ((38) == 32 ) ?
>>         builtin_type_uint32 : ((38) >= 70 && (38) <= 89) ?
>> 	builtin_type_uint32 :
>>         builtin_type_int))->main_type->length == 8);
>> 
>> I can't see any reason for it to crash; I haven't reproduced this
>> locally yet, although I'm working on it.  The above expansion came from
>> the second person to mention this to me.
> 
> 
> I believe you're right about the patch at fault, though I don't know
> what to do about it.  This makes builtin_type_int == NULL during
> evaluation of that expression, along with all the others.

The patch isn't `at fault' - it is detecting a fault in mips_tdep.c :-) 
  builtin_type_float would have contained a value from the previously 
selected ISA.

That code is trying to reverse engineer the header files to figure out 
what the default should be for the given target.

I think better would be to is set mips_fp_register_double=-1 and then 
change FP_REGISTER_DOUBLE to a real function (gdb multi-arch can now be 
assumed) that, when -1, apply the above logic (and even update the result).

enjoy,
Andrew




More information about the Gdb mailing list