Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Walfred Tedeschi <walfred.tedeschi@intel.com>
To: Yao Qi <qiyaoltc@gmail.com>, Pedro Alves <palves@redhat.com>
Cc: gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH V2] Improve user experience in printing Fortran derived types.
Date: Tue, 05 Apr 2016 12:17:00 -0000	[thread overview]
Message-ID: <5703ACCF.4060903@intel.com> (raw)
In-Reply-To: <86a8l8nuqk.fsf@gmail.com>

Yao,

Thanks for your review!

The idea is to have same look and fell as C/C++ code.
Only variables are displayed, not functions.
I based the patch in the C/C++ code, which is much younger.

Am 4/5/2016 um 1:46 PM schrieb Yao Qi:
> 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'.

We need print_field due to the code below. There we discard function 
members.

>
>> +	  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?
>

Here member functions, or methods of the derived type, are discarded.

Thanks and regards,
-Fred
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928

  reply	other threads:[~2016-04-05 12:17 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
2016-04-05 12:17   ` Walfred Tedeschi [this message]
     [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=5703ACCF.4060903@intel.com \
    --to=walfred.tedeschi@intel.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    --cc=qiyaoltc@gmail.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