mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-08-06 14:49:38 +08:00
* f-exp.y: Symbol '%' is not used as the modulus operator in
Fortran. Delete this from Fortran expression. It is now used by Fortran 90 and later to access the member of derived type. Add this into Fortran expression. * f-valprint.c (f_val_print): Add code to handle TYPE_CODE_STRUCT. Print each elements in the derived type. * f-typeprint.c (print_equivalent_f77_float_type): Add a parameter level into the function definition to do indented printing. And call fprintfi_filtered instead to do indented printing. (f_type_print_base): Replace fprintf_filtered with the indented version (fprintfi_filtered). (f_type_print_base): Call indented print_equivalent_f77_float_type. (f_type_print_base): Add code to handle TYPE_CODE_STRUCT. Print the definition of the derived type.
This commit is contained in:
@ -366,6 +366,7 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
|
||||
struct type *elttype;
|
||||
LONGEST val;
|
||||
CORE_ADDR addr;
|
||||
int index;
|
||||
|
||||
CHECK_TYPEDEF (type);
|
||||
switch (TYPE_CODE (type))
|
||||
@ -583,6 +584,22 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
|
||||
fprintf_filtered (stream, "<incomplete type>");
|
||||
break;
|
||||
|
||||
case TYPE_CODE_STRUCT:
|
||||
/* Starting from the Fortran 90 standard, Fortran supports derived
|
||||
types. */
|
||||
fprintf_filtered (stream, "{ ");
|
||||
for (index = 0; index < TYPE_NFIELDS (type); index++)
|
||||
{
|
||||
int offset = TYPE_FIELD_BITPOS (type, index) / 8;
|
||||
f_val_print (TYPE_FIELD_TYPE (type, index), valaddr + offset,
|
||||
embedded_offset, address, stream,
|
||||
format, deref_ref, recurse, pretty);
|
||||
if (index != TYPE_NFIELDS (type) - 1)
|
||||
fputs_filtered (", ", stream);
|
||||
}
|
||||
fprintf_filtered (stream, "}");
|
||||
break;
|
||||
|
||||
default:
|
||||
error (_("Invalid F77 type code %d in symbol table."), TYPE_CODE (type));
|
||||
}
|
||||
|
Reference in New Issue
Block a user