* eval.c (evaluate_subexp_standard): Add code to check the target
authorWu Zhou <woodzltc@cn.ibm.com>
Mon, 13 Jun 2005 07:23:15 +0000 (07:23 +0000)
committerWu Zhou <woodzltc@cn.ibm.com>
Mon, 13 Jun 2005 07:23:15 +0000 (07:23 +0000)
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.

gdb/ChangeLog
gdb/eval.c

index e0a96f8bc30d61ea37afb96129641686b530b25b..2e725e83e02ffd27151b0ced6fc510a568cf5cec 100644 (file)
@@ -1,3 +1,10 @@
+2005-06-13  Wu Zhou  <woodzltc@cn.ibm.com>
+
+       * 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.
+
 2005-06-12  Daniel Jacobowitz  <dan@codesourcery.com>
            Nick Roberts  <nickrob@snap.net.nz>
 
index 0ad71793f6485f2f48e877e21ce073ed4cb244e7..20df063d6419b4f754dc73ea46812b1954242fdd 100644 (file)
@@ -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:
This page took 0.029273 seconds and 4 git commands to generate.