public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: "Andrew Burgess (Code Review)" <gerrit@gnutoolchain-gerrit.osci.io>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@sourceware.org>
Subject: [review] gdb/fortran: array stride support
Date: Fri, 15 Nov 2019 23:54:00 -0000	[thread overview]
Message-ID: <20191115235410.CDA0020AF6@gnutoolchain-gerrit.osci.io> (raw)
In-Reply-To: <gerrit.1573743387000.I9af2bcd1f2d4c56f76f5f3f9f89d8f06bef10d9a@gnutoolchain-gerrit.osci.io>

Andrew Burgess has posted comments on this change.

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/627
......................................................................


Patch Set 1:

(3 comments)

I'll roll a new revision - I just wanted to check how you feel about the gdbtypes.c change given my comment below... thanks.

| --- /dev/null
| +++ /COMMIT_MSG
| @@ -1,0 +20,21 @@ information.  The name is possibly a little inaccurate now, but this
| +still sort of makes sense, the structure represents information about
| +the bounds of the range, and also how to move from the lower to the
| +upper bound (the stride).
| +
| +I've added initial support for bit strides, but I've never actually
| +seen an example of this being generated.  Further, I don't really see
| +right now how GDB would currently handle a bit stride that was not a
| +multiple of the byte size as the code in, for example,
| +valarith.c:value_subscripted_rvalue seems geared around byte
| +addressing.  As a consequence if we see a bit stride that is not a
| +multiple of 8 then GDB will give a warning and then carry on, even
| +though the results are likely to be wrong.

PS1, Line 31:

I'll change to an error.

| +
| +gdb/ChangeLog:
| +
| +	* dwarf2read.c (read_subrange_type): Read bit and byte stride and
| +	create a range with stride where appropriate.
| +	* f-valprint.c (f77_print_array_1): Take the stride into account
| +	when walking the array.
| +	* gdbtypes.c (create_range_type): Initialise the stride to
| +	constant zero.
| --- gdb/gdbtypes.c
| +++ gdb/gdbtypes.c
| @@ -978,17 +1007,18 @@ create_static_range_type (struct type *result_type, struct type *index_type,
|  /* Predicate tests whether BOUNDS are static.  Returns 1 if all bounds values
|     are static, otherwise returns 0.  */
|  
|  static int
|  has_static_range (const struct range_bounds *bounds)
|  {
|    return (bounds->low.kind == PROP_CONST
| -	  && bounds->high.kind == PROP_CONST);
| +	  && bounds->high.kind == PROP_CONST
| +	  && bounds->stride.kind == PROP_CONST);

PS1, Line 1015:

If the range is initialised without a stride then the stride property
is set to a constant 0, its only if there _is_ a stride that this
could ever be non-constant.  I'll add a comment to this effect here,
but does this sound like it addresses your concern?

|  }
|  
|  
|  /* Set *LOWP and *HIGHP to the lower and upper bounds of discrete type
|     TYPE.  Return 1 if type is a range type, 0 if it is discrete (and
|     bounds will fit in LONGEST), or -1 otherwise.  */
|  
|  int
|  get_discrete_bounds (struct type *type, LONGEST *lowp, LONGEST *highp)
| --- gdb/gdbtypes.h
| +++ gdb/gdbtypes.h
| @@ -620,8 +620,19 @@ struct range_bounds
| +  /* The stride value for this range.  This can be stored in bits or bytes
| +     based on the value of BYTE_STRIDE_P.  It is optional to have a stride
| +     value, if this range has no stride value defined then this will be set
| +     to the constant zero.  */
| +
| +  struct dynamic_prop stride;
| +
| +  /* If this is true this STRIDE is in bytes, otherwise STRIDE is in bits.  */
| +
| +  bool byte_stride_p;

PS1, Line 629:

I'll move it.

| +
|    /* * The bias.  Sometimes a range value is biased before storage.
|       The bias is added to the stored bits to form the true value.  */
|  
|    LONGEST bias;
|  
|    /* True if HIGH range bound contains the number of elements in the
|       subrange.  This affects how the final high bound is computed.  */
|  

-- 
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: I9af2bcd1f2d4c56f76f5f3f9f89d8f06bef10d9a
Gerrit-Change-Number: 627
Gerrit-PatchSet: 1
Gerrit-Owner: Andrew Burgess <andrew.burgess@embecosm.com>
Gerrit-Reviewer: Andrew Burgess <andrew.burgess@embecosm.com>
Gerrit-CC: Tom Tromey <tromey@sourceware.org>
Gerrit-Comment-Date: Fri, 15 Nov 2019 23:54:10 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Tom Tromey <tromey@sourceware.org>
Gerrit-MessageType: comment

  parent reply	other threads:[~2019-11-15 23:54 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-14 14:56 Andrew Burgess (Code Review)
2019-11-15 22:36 ` Tom Tromey (Code Review)
2019-11-15 23:54 ` Andrew Burgess (Code Review) [this message]
2019-11-18 18:58 ` Tom Tromey (Code Review)
2019-11-18 21:47 ` [review v2] " Andrew Burgess (Code Review)
2019-11-18 21:50 ` Andrew Burgess (Code Review)
2019-11-18 21:55 ` [review v3] " Andrew Burgess (Code Review)
2019-11-22 10:10 ` [review v4] " Andrew Burgess (Code Review)
2019-11-22 10:12 ` Andrew Burgess (Code Review)
2019-11-22 13:06 ` Simon Marchi (Code Review)
2019-11-22 17:30 ` [review v5] " Andrew Burgess (Code Review)
2019-11-22 17:31 ` Andrew Burgess (Code Review)
2019-11-22 17:46 ` Simon Marchi (Code Review)
2019-11-28  0:45 ` [review v6] " Andrew Burgess (Code Review)
2019-11-29 23:32 ` [review v7] " Andrew Burgess (Code Review)
2019-11-29 23:35 ` Andrew Burgess (Code Review)
2019-11-30 21:47 ` [review v8] " Andrew Burgess (Code Review)
2019-11-30 22:10 ` [review v9] " Andrew Burgess (Code Review)
2019-11-30 22:11 ` Andrew Burgess (Code Review)
2019-12-01  0:09 ` Simon Marchi (Code Review)
2019-12-01  0:09 ` Simon Marchi (Code Review)
2019-12-01 22:33 ` [pushed] " Sourceware to Gerrit sync (Code Review)
2019-12-01 22:33 ` Sourceware to Gerrit sync (Code Review)
2020-01-14  4:11 ` [PATCH] Add gdb.fortran/vla-stride.exp and report a bug (was: Re: [review] gdb/fortran: array stride support) Sergio Durigan Junior
2020-01-19  1:59   ` Andrew Burgess
2020-02-05 16:38     ` [PATCH] Add gdb.fortran/vla-stride.exp and report a bug Sergio Durigan Junior
2020-02-25 16:35       ` [PUSHED] gdb/fortran: Support negative array stride in one limited case Andrew Burgess
2020-08-06 10:41         ` Copyright status gdb.fortran/vla-stride.exp test-case Tom de Vries
2020-08-06 13:35           ` Andrew Burgess
2020-08-18  9:50             ` Tom de Vries
2020-08-18 10:12               ` Andrew Burgess
2020-12-12  6:33         ` [PUSHED] gdb/fortran: Support negative array stride in one limited case Simon Marchi
2020-12-12 22:18           ` Andrew Burgess
2020-12-13  0:51             ` Simon Marchi

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=20191115235410.CDA0020AF6@gnutoolchain-gerrit.osci.io \
    --to=gerrit@gnutoolchain-gerrit.osci.io \
    --cc=gdb-patches@sourceware.org \
    --cc=gnutoolchain-gerrit@osci.io \
    --cc=tromey@sourceware.org \
    /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).