gdb/
[deliverable/binutils-gdb.git] / gdb / c-valprint.c
index 138aca6d9705662b7228e730ecdb3097cfe2cfc9..76579d2116c1a016fdb14f516ed2d57503c53629 100644 (file)
@@ -240,7 +240,7 @@ c_val_print (struct type *type, const gdb_byte *valaddr,
        }
       /* Array of unspecified length: treat like pointer to first
         elt.  */
-      addr = address;
+      addr = address + embedded_offset;
       goto print_unpacked_pointer;
 
     case TYPE_CODE_MEMBERPTR:
@@ -686,29 +686,33 @@ c_value_print (struct value *val, struct ui_file *stream,
            }
          /* Pointer to class, check real type of object.  */
          fprintf_filtered (stream, "(");
-          real_type = value_rtti_target_type (val, &full,
-                                             &top, &using_enc);
-          if (real_type)
-           {
-             /* RTTI entry found.  */
-              if (TYPE_CODE (type) == TYPE_CODE_PTR)
-                {
-                  /* Create a pointer type pointing to the real
-                    type.  */
-                  type = lookup_pointer_type (real_type);
-                }
-              else
-                {
-                  /* Create a reference type referencing the real
-                    type.  */
-                  type = lookup_reference_type (real_type);
-                }
-             /* JYG: Need to adjust pointer value.  */
-             val = value_from_pointer (type, value_as_address (val) - top);
-
-              /* Note: When we look up RTTI entries, we don't get any 
-                 information on const or volatile attributes.  */
-            }
+
+         if (value_entirely_available (val))
+           {
+             real_type = value_rtti_target_type (val, &full, &top, &using_enc);
+             if (real_type)
+               {
+                 /* RTTI entry found.  */
+                 if (TYPE_CODE (type) == TYPE_CODE_PTR)
+                   {
+                     /* Create a pointer type pointing to the real
+                        type.  */
+                     type = lookup_pointer_type (real_type);
+                   }
+                 else
+                   {
+                     /* Create a reference type referencing the real
+                        type.  */
+                     type = lookup_reference_type (real_type);
+                   }
+                 /* Need to adjust pointer value.  */
+                 val = value_from_pointer (type, value_as_address (val) - top);
+
+                 /* Note: When we look up RTTI entries, we don't get
+                    any information on const or volatile
+                    attributes.  */
+               }
+           }
           type_print (type, "", stream, -1);
          fprintf_filtered (stream, ") ");
          val_type = type;
This page took 0.025276 seconds and 4 git commands to generate.