From: Joel Brobecker <brobecker@adacore.com>
To: Bernhard Heckel <bernhard.heckel@intel.com>
Cc: yao@codesourcery.com, gdb-patches@sourceware.org
Subject: Re: [PATCH V2 1/3] fort_dyn_array: Enable dynamic member types inside a structure.
Date: Thu, 14 Apr 2016 13:45:00 -0000 [thread overview]
Message-ID: <20160414134538.GA5026@adacore.com> (raw)
In-Reply-To: <1459936659-19039-2-git-send-email-bernhard.heckel@intel.com>
Just a few minor nits that I happen to see while glancing at the patch:
> --- a/gdb/gdbtypes.c
> +++ b/gdb/gdbtypes.c
> @@ -2064,7 +2064,8 @@ resolve_dynamic_struct (struct type *type,
>
> pinfo.type = check_typedef (TYPE_FIELD_TYPE (type, i));
> pinfo.valaddr = addr_stack->valaddr;
> - pinfo.addr = addr_stack->addr;
> + pinfo.addr = addr_stack->addr
> + + (TYPE_FIELD_BITPOS (resolved_type, i) / TARGET_CHAR_BIT);
The GCS recommends in that case to use an extra pair of parens.
The purpose is to help code formatters align the code properly.
pinfo.addr
= (addr_stack->addr
+ (TYPE_FIELD_BITPOS (resolved_type, i) / TARGET_CHAR_BIT));
> + /* The length of a type won't change for fortran, but it does for C and Ada.
> + For fortran the size of dynamic fields might change over time but not the
> + type length of the structure. If we would adapt it we run into problems
> + when calculating the element offset for arrays of structs. */
May I suggest the following rephrasing, which sounds a litle better
to me?
"If we adapt it, we run into problems [...]"
> +/* Remove dynamic property from TYPE in case it exist. */
"exists"
> +void
> +remove_dyn_prop (enum dynamic_prop_node_kind prop_kind,
> + struct type *type)
> +{
> + struct dynamic_prop_list *prev_node, *curr_node;
> +
> + curr_node = TYPE_DYN_PROP_LIST (type);
> + prev_node = NULL;
> +
> + while (NULL != curr_node)
> + {
> + if (curr_node->prop_kind == prop_kind)
> + {
> + /* Upadate the linked list but don't free anything.
"Update"
> + /* Internal variables which are created from values with a dynamic location
> + don't need the location property of the origin anymore.
> + Remove the location property in case it exist. */
> + remove_dyn_prop (DYN_PROP_DATA_LOCATION, value_type (new_data.value));
I am also wondering why it makes a difference to remove it, and
it would be useful to explain it here.
--
Joel
next prev parent reply other threads:[~2016-04-14 13:45 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-06 9:58 [PATCH V2 0/3] fortran: Enable arrays of structures with dynamic member types Bernhard Heckel
2016-04-06 9:58 ` [PATCH V2 2/3] fort_dyn_array: Support evaluation of dynamic elements inside arrays Bernhard Heckel
2016-04-07 16:21 ` Yao Qi
2016-04-06 9:58 ` [PATCH V2 1/3] fort_dyn_array: Enable dynamic member types inside a structure Bernhard Heckel
2016-04-07 16:19 ` Yao Qi
2016-04-07 16:26 ` Yao Qi
2016-04-08 6:13 ` Heckel, Bernhard
2016-04-14 13:45 ` Joel Brobecker [this message]
2016-04-06 9:58 ` [PATCH V2 3/3] fort_dyn_array: Use value constructor instead of raw-buffer manipulation Bernhard Heckel
2016-04-07 16:22 ` 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=20160414134538.GA5026@adacore.com \
--to=brobecker@adacore.com \
--cc=bernhard.heckel@intel.com \
--cc=gdb-patches@sourceware.org \
--cc=yao@codesourcery.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).