Jan Kratochvil fdbd5e3
http://sourceware.org/ml/gdb-patches/2016-02/msg00841.html
Jan Kratochvil fdbd5e3
Subject: [PATCH v2 2/6] fortran: combine subarray and string computation
Jan Kratochvil fdbd5e3
Jan Kratochvil 046f33b
From: Christoph Weinmann <christoph.t.weinmann@intel.com>
Jan Kratochvil 046f33b
Jan Kratochvil 046f33b
Strings only have one dimension, but the element computation is
Jan Kratochvil 046f33b
identical to the subarray computation for ranges and indices.
Jan Kratochvil 046f33b
Jan Kratochvil 046f33b
2013-11-26  Christoph Weinmann  <christoph.t.weinmann@intel.com>
Jan Kratochvil 046f33b
Jan Kratochvil 046f33b
	* eval.c (evaluate_subexp_standard): Call
Jan Kratochvil 046f33b
	value_f90_subarray for print expressions on array and
Jan Kratochvil 046f33b
	string types.
Jan Kratochvil 046f33b
Jan Kratochvil 046f33b
Jan Kratochvil 046f33b
Signed-off-by: Christoph Weinmann <christoph.t.weinmann@intel.com>
Jan Kratochvil 046f33b
---
Jan Kratochvil fdbd5e3
 gdb/eval.c | 10 +---------
Jan Kratochvil fdbd5e3
 1 file changed, 1 insertion(+), 9 deletions(-)
Jan Kratochvil 046f33b
Jan Kratochvil 046f33b
diff --git a/gdb/eval.c b/gdb/eval.c
Jan Kratochvil fdbd5e3
index c9f325f..164d7ab 100644
Jan Kratochvil 046f33b
--- a/gdb/eval.c
Jan Kratochvil 046f33b
+++ b/gdb/eval.c
Jan Kratochvil 046f33b
@@ -2034,16 +2034,8 @@ evaluate_subexp_standard (struct type *expect_type,
Jan Kratochvil 046f33b
       switch (code)
Jan Kratochvil 046f33b
 	{
Jan Kratochvil 046f33b
 	case TYPE_CODE_ARRAY:
Jan Kratochvil 046f33b
-	  return value_f90_subarray (arg1, exp, pos, nargs, noside);
Jan Kratochvil 046f33b
-
Jan Kratochvil 046f33b
 	case TYPE_CODE_STRING:
Jan Kratochvil 046f33b
-	  if (exp->elts[*pos].opcode == OP_F90_RANGE)
Jan Kratochvil 046f33b
-	    return value_f90_subarray (arg1, exp, pos, 1, noside);
Jan Kratochvil 046f33b
-	  else
Jan Kratochvil 046f33b
-	    {
Jan Kratochvil 046f33b
-	      arg2 = evaluate_subexp_with_coercion (exp, pos, noside);
Jan Kratochvil 046f33b
-	      return value_subscript (arg1, value_as_long (arg2));
Jan Kratochvil 046f33b
-	    }
Jan Kratochvil 046f33b
+	  return  value_f90_subarray (arg1, exp, pos, nargs, noside);
Jan Kratochvil 046f33b
 
Jan Kratochvil 046f33b
 	case TYPE_CODE_PTR:
Jan Kratochvil 046f33b
 	case TYPE_CODE_FUNC:
Jan Kratochvil 046f33b
-- 
Jan Kratochvil fdbd5e3
2.5.0
Jan Kratochvil fdbd5e3