From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 106613 invoked by alias); 15 Nov 2019 23:54:19 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 106599 invoked by uid 89); 15 Nov 2019 23:54:18 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3 autolearn=ham version=3.3.1 spammy= X-HELO: mx1.osci.io Received: from polly.osci.io (HELO mx1.osci.io) (8.43.85.229) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 15 Nov 2019 23:54:17 +0000 Received: by mx1.osci.io (Postfix, from userid 994) id 5EADE203AC; Fri, 15 Nov 2019 18:54:15 -0500 (EST) Received: from gnutoolchain-gerrit.osci.io (gnutoolchain-gerrit.osci.io [IPv6:2620:52:3:1:5054:ff:fe06:16ca]) by mx1.osci.io (Postfix) with ESMTP id 0FDCD200BC; Fri, 15 Nov 2019 18:54:13 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by gnutoolchain-gerrit.osci.io (Postfix) with ESMTP id CDA0020AF6; Fri, 15 Nov 2019 18:54:10 -0500 (EST) X-Gerrit-PatchSet: 1 Date: Fri, 15 Nov 2019 23:54:00 -0000 From: "Andrew Burgess (Code Review)" To: gdb-patches@sourceware.org Cc: Tom Tromey Auto-Submitted: auto-generated X-Gerrit-MessageType: comment Subject: [review] gdb/fortran: array stride support X-Gerrit-Change-Id: I9af2bcd1f2d4c56f76f5f3f9f89d8f06bef10d9a X-Gerrit-Change-Number: 627 X-Gerrit-ChangeURL: X-Gerrit-Commit: c9eaa3e9c36d105ed499e65eac5ea7dde36d22d2 In-Reply-To: References: X-Gerrit-Comment-Date: Fri, 15 Nov 2019 18:54:10 -0500 Reply-To: gnutoolchain-gerrit@osci.io MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline User-Agent: Gerrit/3.0.3-76-gf8b6da0ab5 Content-Type: text/plain; charset=UTF-8 Message-Id: <20191115235410.CDA0020AF6@gnutoolchain-gerrit.osci.io> X-SW-Source: 2019-11/txt/msg00490.txt.bz2 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 Gerrit-Reviewer: Andrew Burgess Gerrit-CC: Tom Tromey Gerrit-Comment-Date: Fri, 15 Nov 2019 23:54:10 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: Tom Tromey Gerrit-MessageType: comment