* config/tc-mips.c (macro_build_jalr): Reverse a negative
[deliverable/binutils-gdb.git] / gdb / p-valprint.c
index 618fc17ce4fad2f93fb238d75955594de6a851cf..e55b12269a9725b6180c2aef192fa5884f80f67f 100644 (file)
@@ -68,7 +68,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
   switch (TYPE_CODE (type))
     {
     case TYPE_CODE_ARRAY:
-      if (get_array_bounds (type, &low_bound, &high_bound)) 
+      if (get_array_bounds (type, &low_bound, &high_bound))
        {
          len = high_bound - low_bound + 1;
          elttype = check_typedef (TYPE_TARGET_TYPE (type));
@@ -272,10 +272,19 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
        {
          if (TYPE_CODE (elttype) != TYPE_CODE_UNDEF)
            {
-             struct value *deref_val =
-               value_at
-               (TYPE_TARGET_TYPE (type),
-                unpack_pointer (type, valaddr + embedded_offset));
+             struct value *deref_val;
+
+             deref_val = coerce_ref_if_computed (original_value);
+             if (deref_val != NULL)
+               {
+                 /* More complicated computed references are not supported.  */
+                 gdb_assert (embedded_offset == 0);
+               }
+             else
+               deref_val = value_at (TYPE_TARGET_TYPE (type),
+                                     unpack_pointer (type,
+                                                     (valaddr
+                                                      + embedded_offset)));
 
              common_val_print (deref_val, stream, recurse + 1, options,
                                current_language);
@@ -317,7 +326,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
              len = extract_unsigned_integer (valaddr + embedded_offset
                                              + length_pos, length_size,
                                              byte_order);
-             LA_PRINT_STRING (stream, char_type, 
+             LA_PRINT_STRING (stream, char_type,
                               valaddr + embedded_offset + string_pos,
                               len, NULL, 0, options);
            }
@@ -590,7 +599,7 @@ pascal_value_print (struct value *val, struct ui_file *stream,
     {
       /* Hack:  remove (char *) for char strings.  Their
          type is indicated by the quoted string anyway.  */
-      if (TYPE_CODE (type) == TYPE_CODE_PTR 
+      if (TYPE_CODE (type) == TYPE_CODE_PTR
          && TYPE_NAME (type) == NULL
          && TYPE_NAME (TYPE_TARGET_TYPE (type)) != NULL
          && strcmp (TYPE_NAME (TYPE_TARGET_TYPE (type)), "char") == 0)
This page took 0.025249 seconds and 4 git commands to generate.