From 75d2491453a4224be083aaf15cfd3865443dcfd3 Mon Sep 17 00:00:00 2001 From: Christoph Weinmann Date: Fri, 13 Nov 2015 09:00:33 +0100 Subject: 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 40ce446..a6b729d 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: -- cgit v1.1