aboutsummaryrefslogtreecommitdiff
path: root/gdb/eval.c
diff options
context:
space:
mode:
authorWu Zhou <woodzltc@cn.ibm.com>2005-06-13 07:23:15 +0000
committerWu Zhou <woodzltc@cn.ibm.com>2005-06-13 07:23:15 +0000
commitdf0ca547847b27bc3b2beaa3966d133bcae82d3c (patch)
treeecffc56b854cfde3350db65e922691b6fdf3b70d /gdb/eval.c
parent589e074d2e7ed4f075e1eb8193610770db6489be (diff)
downloadgdb-df0ca547847b27bc3b2beaa3966d133bcae82d3c.zip
gdb-df0ca547847b27bc3b2beaa3966d133bcae82d3c.tar.gz
gdb-df0ca547847b27bc3b2beaa3966d133bcae82d3c.tar.bz2
* eval.c (evaluate_subexp_standard): Add code to check the target
type of a TYPE_CODE_PTR value when we encounter a f77 undetermined arglist. If it is array, string or function, work on the target value instead.
Diffstat (limited to 'gdb/eval.c')
-rw-r--r--gdb/eval.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gdb/eval.c b/gdb/eval.c
index 0ad7179..20df063 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -1246,6 +1246,24 @@ evaluate_subexp_standard (struct type *expect_type,
type = check_typedef (value_type (arg1));
code = TYPE_CODE (type);
+ if (code == TYPE_CODE_PTR)
+ {
+ /* Fortran always passes variable to subroutines as pointer.
+ So we need to look into its target type to see if it is
+ array, string or function. If it is, we need to switch
+ to the target value the original one points to. */
+ struct type *target_type = check_typedef (TYPE_TARGET_TYPE (type));
+
+ if (TYPE_CODE (target_type) == TYPE_CODE_ARRAY
+ || TYPE_CODE (target_type) == TYPE_CODE_STRING
+ || TYPE_CODE (target_type) == TYPE_CODE_FUNC)
+ {
+ arg1 = value_ind (arg1);
+ type = check_typedef (value_type (arg1));
+ code = TYPE_CODE (type);
+ }
+ }
+
switch (code)
{
case TYPE_CODE_ARRAY: