RE: [ping] [PATCH v2 0/6] fortran: multi-dimensional subarrays with strides https://sourceware.org/ml/gdb-patches/2016-07/msg00009.html From 733b3b60be5c8d23fa7e47498d35e4701528f3ae Mon Sep 17 00:00:00 2001 From: Christoph Weinmann Date: Fri, 13 Nov 2015 09:00:33 +0100 Subject: [PATCH 2/6] fortran: combine subarray and string computation Strings types are handled like array types with only one dimension. Therefore the same algorithm to calculate subsets is used. 2013-11-26 Christoph Weinmann * eval.c (evaluate_subexp_standard): Call value_f90_subarray for print expressions on array and string types. Signed-off-by: Christoph Weinmann --- gdb/eval.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/gdb/eval.c b/gdb/eval.c index 35815a4..5c20fee 100644 --- a/gdb/eval.c +++ b/gdb/eval.c @@ -2035,16 +2035,8 @@ evaluate_subexp_standard (struct type *expect_type, switch (code) { case TYPE_CODE_ARRAY: - return value_f90_subarray (arg1, exp, pos, nargs, noside); - case TYPE_CODE_STRING: - if (exp->elts[*pos].opcode == OP_RANGE) - return value_f90_subarray (arg1, exp, pos, 1, noside); - else - { - arg2 = evaluate_subexp_with_coercion (exp, pos, noside); - return value_subscript (arg1, value_as_long (arg2)); - } + return value_f90_subarray (arg1, exp, pos, nargs, noside); case TYPE_CODE_PTR: case TYPE_CODE_FUNC: -- 2.5.5