This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [V4 00/21] Fortran dynamic array support


On Thu, 25 Aug 2016 19:22:17 +0200, Jan Kratochvil wrote:
> I see the source handles negative stide specially.  Particularly the comment
> here does not explain the code it comments:

With the attached patch disabling these cases still the supplied
gdb.fortran/static-arrays.exp and gdb.fortran/vla-stride.exp PASS (on Fedora 24
x86_64).


Jan
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index 88801ac..695825a 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -2197,12 +2197,14 @@ resolve_dynamic_type_internal (struct type *type,
     {
       struct type *range_type = TYPE_INDEX_TYPE (resolved_type);
 
+#if 0
       /* Adjust the data location with the value of byte stride if set, which
          can describe the separation between successive elements along the
          dimension.  */
       if (TYPE_BYTE_STRIDE (range_type) < 0)
         value += (TYPE_HIGH_BOUND (range_type) - TYPE_LOW_BOUND (range_type))
                   * TYPE_BYTE_STRIDE (range_type);
+#endif
 
       TYPE_DATA_LOCATION_ADDR (resolved_type) = value;
       TYPE_DATA_LOCATION_KIND (resolved_type) = PROP_CONST;
diff --git a/gdb/valarith.c b/gdb/valarith.c
index 9093969..eca7992 100644
--- a/gdb/valarith.c
+++ b/gdb/valarith.c
@@ -199,12 +199,14 @@ value_subscripted_rvalue (struct value *array, LONGEST index, int lowerbound)
 
   if (elt_stride > 0)
     elt_offs *= elt_stride;
+#if 0
   else if (elt_stride < 0)
     {
       int offs = (elt_offs + 1) * elt_stride;
 
       elt_offs = TYPE_LENGTH (array_type) + offs;
     }
+#endif
   else
     elt_offs *= elt_size;
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]