X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Ff-typeprint.c;h=32989d41a55a2dd628fde9f9a8adeadcaa3c72e5;hb=b8162e5ac9e052b2a88912b729081600972e854c;hp=f80d01675ac39c829acc296dea0544b91b6c0d8f;hpb=0e9f083f4cb94a9dc861f38ba151aac06efce2b8;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c index f80d01675a..32989d41a5 100644 --- a/gdb/f-typeprint.c +++ b/gdb/f-typeprint.c @@ -1,6 +1,6 @@ /* Support for printing Fortran types for GDB, the GNU debugger. - Copyright (C) 1986-2013 Free Software Foundation, Inc. + Copyright (C) 1986-2016 Free Software Foundation, Inc. Contributed by Motorola. Adapted from the C version by Farooq Butt (fmbutt@engage.sps.mot.com). @@ -30,9 +30,7 @@ #include "gdbcore.h" #include "target.h" #include "f-lang.h" - -#include -#include +#include "typeprint.h" #if 0 /* Currently unused. */ static void f_type_print_args (struct type *, struct ui_file *); @@ -56,6 +54,18 @@ f_print_type (struct type *type, const char *varstring, struct ui_file *stream, enum type_code code; int demangled_args; + if (type_not_associated (type)) + { + val_print_not_associated (stream); + return; + } + + if (type_not_allocated (type)) + { + val_print_not_allocated (stream); + return; + } + f_type_print_base (type, stream, show, level); code = TYPE_CODE (type); if ((varstring != NULL && *varstring != '\0') @@ -170,28 +180,35 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream, if (arrayprint_recurse_level == 1) fprintf_filtered (stream, "("); - if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_ARRAY) - f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 0, 0, - arrayprint_recurse_level); - - lower_bound = f77_get_lowerbound (type); - if (lower_bound != 1) /* Not the default. */ - fprintf_filtered (stream, "%d:", lower_bound); - - /* Make sure that, if we have an assumed size array, we - print out a warning and print the upperbound as '*'. */ - - if (TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type)) - fprintf_filtered (stream, "*"); + if (type_not_associated (type)) + val_print_not_associated (stream); + else if (type_not_allocated (type)) + val_print_not_allocated (stream); else - { - upper_bound = f77_get_upperbound (type); - fprintf_filtered (stream, "%d", upper_bound); - } - - if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_ARRAY) - f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 0, 0, - arrayprint_recurse_level); + { + if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_ARRAY) + f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, + 0, 0, arrayprint_recurse_level); + + lower_bound = f77_get_lowerbound (type); + if (lower_bound != 1) /* Not the default. */ + fprintf_filtered (stream, "%d:", lower_bound); + + /* Make sure that, if we have an assumed size array, we + print out a warning and print the upperbound as '*'. */ + + if (TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type)) + fprintf_filtered (stream, "*"); + else + { + upper_bound = f77_get_upperbound (type); + fprintf_filtered (stream, "%d", upper_bound); + } + + if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_ARRAY) + f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, + 0, 0, arrayprint_recurse_level); + } if (arrayprint_recurse_level == 1) fprintf_filtered (stream, ")"); else @@ -276,7 +293,7 @@ f_type_print_base (struct type *type, struct ui_file *stream, int show, } if (TYPE_CODE (type) != TYPE_CODE_TYPEDEF) - CHECK_TYPEDEF (type); + type = check_typedef (type); switch (TYPE_CODE (type)) {