This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH V2] Improve user experience in printing Fortran derived types.
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: Walfred Tedeschi <walfred dot tedeschi at intel dot com>
- Cc: palves at redhat dot com, brobecker at adacore dot com, gdb-patches at sourceware dot org
- Date: Tue, 05 Apr 2016 12:46:43 +0100
- Subject: Re: [PATCH V2] Improve user experience in printing Fortran derived types.
- Authentication-results: sourceware.org; auth=none
- References: <1458296757-6795-1-git-send-email-walfred dot tedeschi at intel dot com>
Walfred Tedeschi <walfred.tedeschi@intel.com> writes:
> + int printed_field = 0; /* Number of fields printed. */
> struct type *elttype;
> CORE_ADDR addr;
> int index;
> @@ -375,15 +376,34 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
> fprintf_filtered (stream, "( ");
> for (index = 0; index < TYPE_NFIELDS (type); index++)
> {
> - int offset = TYPE_FIELD_BITPOS (type, index) / 8;
> -
> - val_print (TYPE_FIELD_TYPE (type, index), valaddr,
> - embedded_offset + offset,
> - address, stream, recurse + 1,
> - original_value, options, current_language);
> - if (index != TYPE_NFIELDS (type) - 1)
> - fputs_filtered (", ", stream);
> - }
Why don't we continue using this code above? so that do need to add
'printed_field'.
> + struct value *field =
> + ((struct value *)original_value, index);
A space is needed after ")".
> + struct type *field_type = check_typedef (TYPE_FIELD_TYPE (type, index));
> +
> +
> + if (TYPE_CODE (field_type) != TYPE_CODE_FUNC)
> + {
We didn't do this check before, why do we need this check now?
--
Yao (éå)