* disasm.h (gdb_disassembly): Add GDBARCH parameter.
[deliverable/binutils-gdb.git] / gdb / f-valprint.c
index a2d2a20107563b96c0dfd59df2fb17c5274b0b16..7de15cbfeda3120ce3a954d3ed7e35014ac875d7 100644 (file)
@@ -1,7 +1,7 @@
 /* Support for printing Fortran values for GDB, the GNU debugger.
 
    Copyright (C) 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2003, 2005, 2006,
-   2007, 2008 Free Software Foundation, Inc.
+   2007, 2008, 2009 Free Software Foundation, Inc.
 
    Contributed by Motorola.  Adapted from the C definitions by Farooq Butt
    (fmbutt@engage.sps.mot.com), additionally worked over by Stan Shebs.
@@ -245,6 +245,7 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
             CORE_ADDR address, struct ui_file *stream, int recurse,
             const struct value_print_options *options)
 {
+  struct gdbarch *gdbarch = get_type_arch (type);
   unsigned int i = 0;  /* Number of characters printed */
   struct type *elttype;
   LONGEST val;
@@ -256,7 +257,8 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
     {
     case TYPE_CODE_STRING:
       f77_get_dynamic_length_of_aggregate (type);
-      LA_PRINT_STRING (stream, valaddr, TYPE_LENGTH (type), 1, 0, options);
+      LA_PRINT_STRING (stream, builtin_type (gdbarch)->builtin_char,
+                      valaddr, TYPE_LENGTH (type), 0, options);
       break;
 
     case TYPE_CODE_ARRAY:
@@ -293,7 +295,7 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
              && TYPE_CODE (elttype) == TYPE_CODE_INT
              && (options->format == 0 || options->format == 's')
              && addr != 0)
-           i = val_print_string (addr, -1, TYPE_LENGTH (elttype), stream,
+           i = val_print_string (TYPE_TARGET_TYPE (type), addr, -1, stream,
                                  options);
 
          /* Return number of characters printed, including the terminating
@@ -365,7 +367,7 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
            {
              fputs_filtered (" ", stream);
              LA_PRINT_CHAR ((unsigned char) unpack_long (type, valaddr),
-                            stream);
+                            type, stream);
            }
        }
       break;
This page took 0.026863 seconds and 4 git commands to generate.