* linespec.c (decode_objc): Add cleanup to free
[deliverable/binutils-gdb.git] / gdb / eval.c
index 0244f7a039bbe8479fbf94325d5102445231031c..7f1dfac0cc70f3b4cf44dfb62fc989c9df655025 100644 (file)
@@ -335,7 +335,8 @@ evaluate_struct_tuple (struct value *struct_val,
              for (fieldno = 0; fieldno < TYPE_NFIELDS (struct_type);
                   fieldno++)
                {
-                 char *field_name = TYPE_FIELD_NAME (struct_type, fieldno);
+                 const char *field_name =
+                   TYPE_FIELD_NAME (struct_type, fieldno);
 
                  if (field_name != NULL && strcmp (field_name, label) == 0)
                    {
@@ -348,7 +349,8 @@ evaluate_struct_tuple (struct value *struct_val,
              for (fieldno = 0; fieldno < TYPE_NFIELDS (struct_type);
                   fieldno++)
                {
-                 char *field_name = TYPE_FIELD_NAME (struct_type, fieldno);
+                 const char *field_name =
+                   TYPE_FIELD_NAME (struct_type, fieldno);
 
                  field_type = TYPE_FIELD_TYPE (struct_type, fieldno);
                  if ((field_name == 0 || *field_name == '\0')
@@ -791,7 +793,7 @@ evaluate_subexp_standard (struct type *expect_type,
   struct type *type;
   int nargs;
   struct value **argvec;
-  int upper, lower;
+  int lower;
   int code;
   int ix;
   long mem_offset;
@@ -1356,8 +1358,7 @@ evaluate_subexp_standard (struct type *expect_type,
                  val_type = expect_type;
              }
 
-           struct_return = using_struct_return (exp->gdbarch,
-                                                value_type (method),
+           struct_return = using_struct_return (exp->gdbarch, method,
                                                 val_type);
          }
        else if (expect_type != NULL)
@@ -1999,16 +2000,10 @@ evaluate_subexp_standard (struct type *expect_type,
         if (opts.objectprint && TYPE_TARGET_TYPE(type)
             && (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_CLASS))
           {
-            real_type = value_rtti_target_type (arg1, &full, &top, &using_enc);
+            real_type = value_rtti_indirect_type (arg1, &full, &top,
+                                                 &using_enc);
             if (real_type)
-              {
-                if (TYPE_CODE (type) == TYPE_CODE_PTR)
-                  real_type = lookup_pointer_type (real_type);
-                else
-                  real_type = lookup_reference_type (real_type);
-
                 arg1 = value_cast (real_type, arg1);
-              }
           }
       }
 
@@ -2052,8 +2047,8 @@ evaluate_subexp_standard (struct type *expect_type,
 
        case TYPE_CODE_MEMBERPTR:
          /* Now, convert these values to an address.  */
-         arg1 = value_cast (lookup_pointer_type (TYPE_DOMAIN_TYPE (type)),
-                            arg1);
+         arg1 = value_cast_pointers (lookup_pointer_type (TYPE_DOMAIN_TYPE (type)),
+                                     arg1, 1);
 
          mem_offset = value_as_long (arg2);
 
This page took 0.039166 seconds and 4 git commands to generate.