From David Purves <purves@apogee.com>:

* stabsread.c (rs6000_builtin_type): Create a complex float instead
	of an error.
	(read_sun_floating_type): Similarly.
	(read_range_type): Create a complex float if self_subrange is
 	true.
This commit is contained in:
Stan Shebs 1998-10-06 02:52:31 +00:00
parent 8e40ea4bbe
commit ee31ae2284
2 changed files with 29 additions and 12 deletions

View file

@ -1,3 +1,12 @@
Mon Oct 5 19:44:39 1998 Stan Shebs <shebs@andros.cygnus.com>
From David Purves <purves@apogee.com>:
* stabsread.c (rs6000_builtin_type): Create a complex float instead
of an error.
(read_sun_floating_type): Similarly.
(read_range_type): Create a complex float if self_subrange is
true.
Fri Oct 2 19:42:31 1998 Stu Grossman <grossman@babylon-5.cygnus.com> Fri Oct 2 19:42:31 1998 Stu Grossman <grossman@babylon-5.cygnus.com>
* c-lang.c (emit_char c_printchar c_printstr), c-lang.h (c_printstr) * c-lang.c (emit_char c_printchar c_printstr), c-lang.h (c_printstr)

View file

@ -2892,11 +2892,11 @@ rs6000_builtin_type (typenum)
break; break;
case 25: case 25:
/* Complex type consisting of two IEEE single precision values. */ /* Complex type consisting of two IEEE single precision values. */
rettype = init_type (TYPE_CODE_ERROR, 8, 0, "complex", NULL); rettype = init_type (TYPE_CODE_COMPLEX, 8, 0, "complex", NULL);
break; break;
case 26: case 26:
/* Complex type consisting of two IEEE double precision values. */ /* Complex type consisting of two IEEE double precision values. */
rettype = init_type (TYPE_CODE_ERROR, 16, 0, "double complex", NULL); rettype = init_type (TYPE_CODE_COMPLEX, 16, 0, "double complex", NULL);
break; break;
case 27: case 27:
rettype = init_type (TYPE_CODE_INT, 1, 0, "integer*1", NULL); rettype = init_type (TYPE_CODE_INT, 1, 0, "integer*1", NULL);
@ -4413,7 +4413,7 @@ read_sun_floating_type (pp, typenums, objfile)
|| details == NF_COMPLEX32) || details == NF_COMPLEX32)
/* This is a type we can't handle, but we do know the size. /* This is a type we can't handle, but we do know the size.
We also will be able to give it a name. */ We also will be able to give it a name. */
return init_type (TYPE_CODE_ERROR, nbytes, 0, NULL, objfile); return init_type (TYPE_CODE_COMPLEX, nbytes, 0, NULL, objfile);
return init_type (TYPE_CODE_FLT, nbytes, 0, NULL, objfile); return init_type (TYPE_CODE_FLT, nbytes, 0, NULL, objfile);
} }
@ -4617,21 +4617,29 @@ read_range_type (pp, typenums, objfile)
if (self_subrange && n2 == 0 && n3 == 0) if (self_subrange && n2 == 0 && n3 == 0)
return init_type (TYPE_CODE_VOID, 1, 0, NULL, objfile); return init_type (TYPE_CODE_VOID, 1, 0, NULL, objfile);
/* If n3 is zero and n2 is positive, we want a floating type, /* If n3 is zero and n2 is positive, we want a floating type, and n2
and n2 is the width in bytes. is the width in bytes.
Fortran programs appear to use this for complex types also, Fortran programs appear to use this for complex types also. To
and they give no way to distinguish between double and single-complex! distinguish between floats and complex, g77 (and others?) seem
to use self-subranges for the complexes, and subranges of int for
the floats.
GDB does not have complex types. Also note that for complexes, g77 sets n2 to the size of one of
the member floats, not the whole complex beast. My guess is that
Just return the complex as a float of that size. It won't work right this was to work well with pre-COMPLEX versions of gdb. */
for the complex values, but at least it makes the file loadable. */
if (n3 == 0 && n2 > 0) if (n3 == 0 && n2 > 0)
{
if (self_subrange)
{
return init_type (TYPE_CODE_COMPLEX, 2 * n2, 0, NULL, objfile);
}
else
{ {
return init_type (TYPE_CODE_FLT, n2, 0, NULL, objfile); return init_type (TYPE_CODE_FLT, n2, 0, NULL, objfile);
} }
}
/* If the upper bound is -1, it must really be an unsigned int. */ /* If the upper bound is -1, it must really be an unsigned int. */