This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 2/6] fortran: combine subarray and string computation
- From: christoph dot t dot weinmann at intel dot com
- To: brobecker at adacore dot com, jan dot kratochvil at redhat dot com
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 1 Dec 2015 14:21:11 +0100
- Subject: [PATCH 2/6] fortran: combine subarray and string computation
- Authentication-results: sourceware.org; auth=none
- References: <1448976075-11456-1-git-send-email-christoph dot t dot weinmann at intel dot com>
From: Christoph Weinmann <christoph.t.weinmann@intel.com>
Strings only have one dimension, but the element computation is
identical to the subarray computation for ranges and indices.
2013-11-26 Christoph Weinmann <christoph.t.weinmann@intel.com>
* eval.c (evaluate_subexp_standard): Call
value_f90_subarray for print expressions on array and
string types.
Signed-off-by: Christoph Weinmann <christoph.t.weinmann@intel.com>
---
gdb/eval.c | 10 +---------
1 files changed, 1 insertions(+), 9 deletions(-)
diff --git a/gdb/eval.c b/gdb/eval.c
index 2ceccbc..0c1b607 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -2034,16 +2034,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_F90_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:
--
1.7.0.7