Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <qiyaoltc@gmail.com>
To: Walfred Tedeschi <walfred.tedeschi@intel.com>
Cc: palves@redhat.com,  brobecker@adacore.com,  gdb-patches@sourceware.org
Subject: Re: [PATCH V2] Improve user experience in printing Fortran derived types.
Date: Tue, 05 Apr 2016 11:47:00 -0000	[thread overview]
Message-ID: <86a8l8nuqk.fsf@gmail.com> (raw)
In-Reply-To: <1458296757-6795-1-git-send-email-walfred.tedeschi@intel.com>	(Walfred Tedeschi's message of "Fri, 18 Mar 2016 11:25:57 +0100")

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 (齐尧)


  reply	other threads:[~2016-04-05 11:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-18 10:26 Walfred Tedeschi
2016-04-05 11:47 ` Yao Qi [this message]
2016-04-05 12:17   ` Walfred Tedeschi
     [not found]     ` <8660vwnsb3.fsf@gmail.com>
2016-05-02 12:35       ` Walfred Tedeschi
2016-05-03 16:14         ` Yao Qi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86a8l8nuqk.fsf@gmail.com \
    --to=qiyaoltc@gmail.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    --cc=walfred.tedeschi@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox