This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[review v9] gdb/fortran: array stride support
- From: "Andrew Burgess (Code Review)" <gerrit at gnutoolchain-gerrit dot osci dot io>
- To: gdb-patches at sourceware dot org
- Cc: Simon Marchi <simon dot marchi at polymtl dot ca>, Tom Tromey <tromey at sourceware dot org>
- Date: Sat, 30 Nov 2019 17:11:20 -0500
- Subject: [review v9] gdb/fortran: array stride support
- Auto-submitted: auto-generated
- References: <gerrit.1573743387000.I9af2bcd1f2d4c56f76f5f3f9f89d8f06bef10d9a@gnutoolchain-gerrit.osci.io>
- Reply-to: gnutoolchain-gerrit at osci dot io
Andrew Burgess has posted comments on this change.
Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/627
......................................................................
Patch Set 9:
(1 comment)
| --- gdb/gdbtypes.c
| +++ gdb/gdbtypes.c
| @@ -2017,0 +2061,19 @@ resolve_dynamic_range (struct type *dyn_range_type,
| + {
| + stride.kind = PROP_CONST;
| + stride.data.const_val = value;
| +
| + /* If we have a bit stride that is not a multiple of the byte stride
| + then I really don't think this is going to work with current GDB.
| + The array indexing code in GDB seems to be pretty heavily tied to
| + byte offsets right now. If this comes up then we warn the user
| + and set up a known incorrect stride. */
| + if (!byte_stride_p && (value % HOST_CHAR_BIT) != 0)
PS4, Line 2070:
I think that the latest version should address this issue. There were
four places I'd made use of TARGET_CHAR_BIT, in f-valprint.c,
valarith.c, and gdbtypes.c I'm now also using
gdbarch_addressable_memory_unit_size to convert the byte stride into
address unit stride. In gdbtypes.h I now just use '8' because here we
really want to convert bytes to bits, there's no address units
involved here I think.
| + error (_("bit strides that are not a multiple of the byte size "
| + "are currently not supported"));
| + }
| + else
| + {
| + stride.kind = PROP_UNDEFINED;
| + stride.data.const_val = 0;
| + byte_stride_p = true;
| + }
--
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: I9af2bcd1f2d4c56f76f5f3f9f89d8f06bef10d9a
Gerrit-Change-Number: 627
Gerrit-PatchSet: 9
Gerrit-Owner: Andrew Burgess <andrew.burgess@embecosm.com>
Gerrit-Reviewer: Andrew Burgess <andrew.burgess@embecosm.com>
Gerrit-CC: Simon Marchi <simon.marchi@polymtl.ca>
Gerrit-CC: Tom Tromey <tromey@sourceware.org>
Gerrit-Comment-Date: Sat, 30 Nov 2019 22:11:20 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Andrew Burgess <andrew.burgess@embecosm.com>
Comment-In-Reply-To: Simon Marchi <simon.marchi@polymtl.ca>
Gerrit-MessageType: comment