* elflink.h (elf_bfd_final_link): Check if dynobj is not NULL
[binutils-gdb.git] / gdb / printcmd.c
index c601d88a74a0f7300edb974c2875af19021a7c7c..9db15476885d9d3d20146c401f7644fd26a2420a 100644 (file)
@@ -75,7 +75,7 @@ static CORE_ADDR last_examine_address;
 /* Contents of last address examined.
    This is not valid past the end of the `x' command!  */
 
-static value_ptr last_examine_value;
+static struct value *last_examine_value;
 
 /* Largest offset between a symbolic value and an address, that will be
    printed as `0x1234 <symbol+offset>'.  */
@@ -172,7 +172,7 @@ static void validate_format (struct format_data, char *);
 static void do_examine (struct format_data, CORE_ADDR addr,
                        asection * section);
 
-static void print_formatted (value_ptr, int, int, struct ui_file *);
+static void print_formatted (struct value *, int, int, struct ui_file *);
 
 static struct format_data decode_format (char **, int, int);
 
@@ -280,7 +280,7 @@ decode_format (char **string_ptr, int oformat, int osize)
    This is used to pad hex numbers so they line up.  */
 
 static void
-print_formatted (register value_ptr val, register int format, int size,
+print_formatted (struct value *val, register int format, int size,
                 struct ui_file *stream)
 {
   struct type *type = check_typedef (VALUE_TYPE (val));
@@ -455,10 +455,12 @@ print_scalar_formatted (char *valaddr, struct type *type, int format, int size,
       break;
 
     case 'f':
-      if (len == sizeof (float))
+      if (len == TYPE_LENGTH (builtin_type_float))
         type = builtin_type_float;
-      else if (len == sizeof (double))
+      else if (len == TYPE_LENGTH (builtin_type_double))
         type = builtin_type_double;
+      else if (len == TYPE_LENGTH (builtin_type_long_double))
+        type = builtin_type_long_double;
       print_floating (valaddr, type, stream);
       break;
 
@@ -894,7 +896,7 @@ print_command_1 (char *exp, int inspect, int voidprint)
   struct expression *expr;
   register struct cleanup *old_chain = 0;
   register char format = 0;
-  register value_ptr val;
+  struct value *val;
   struct format_data fmt;
   int cleanup = 0;
 
@@ -932,7 +934,7 @@ print_command_1 (char *exp, int inspect, int voidprint)
          && (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_STRUCT
              || TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_UNION))
        {
-         value_ptr v;
+         struct value *v;
 
          v = value_from_vtable_info (val, TYPE_TARGET_TYPE (type));
          if (v != 0)
@@ -1012,7 +1014,7 @@ output_command (char *exp, int from_tty)
   struct expression *expr;
   register struct cleanup *old_chain;
   register char format = 0;
-  register value_ptr val;
+  struct value *val;
   struct format_data fmt;
 
   if (exp && *exp == '/')
@@ -1348,7 +1350,7 @@ x_command (char *exp, int from_tty)
           && VALUE_LVAL (val) == lval_memory)
        next_address = VALUE_ADDRESS (val);
       else
-       next_address = value_as_pointer (val);
+       next_address = value_as_address (val);
       if (VALUE_BFD_SECTION (val))
        next_section = VALUE_BFD_SECTION (val);
       do_cleanups (old_chain);
@@ -1563,7 +1565,7 @@ do_one_display (struct display *d)
   if (d->format.size)
     {
       CORE_ADDR addr;
-      value_ptr val;
+      struct value *val;
 
       annotate_display_format ();
 
@@ -1586,7 +1588,7 @@ do_one_display (struct display *d)
        printf_filtered ("  ");
 
       val = evaluate_expression (d->exp);
-      addr = value_as_pointer (val);
+      addr = value_as_address (val);
       if (d->format.format == 'i')
        addr = ADDR_BITS_REMOVE (addr);
 
@@ -1765,7 +1767,7 @@ void
 print_variable_value (struct symbol *var, struct frame_info *frame,
                      struct ui_file *stream)
 {
-  value_ptr val = read_var_value (var, frame);
+  struct value *val = read_var_value (var, frame);
 
   value_print (val, stream, 0, Val_pretty_default);
 }
@@ -1786,7 +1788,7 @@ print_frame_args (struct symbol *func, struct frame_info *fi, int num,
   int first = 1;
   register int i;
   register struct symbol *sym;
-  register value_ptr val;
+  struct value *val;
   /* Offset of next stack argument beyond the one we have seen that is
      at the highest offset.
      -1 if we haven't come to a stack argument yet.  */
@@ -2036,14 +2038,15 @@ printf_command (char *arg, int from_tty)
   register char *f = NULL;
   register char *s = arg;
   char *string = NULL;
-  value_ptr *val_args;
+  struct value **val_args;
   char *substrings;
   char *current_substring;
   int nargs = 0;
   int allocated_args = 20;
   struct cleanup *old_cleanups;
 
-  val_args = (value_ptr *) xmalloc (allocated_args * sizeof (value_ptr));
+  val_args = (struct value **) xmalloc (allocated_args
+                                       * sizeof (struct value *));
   old_cleanups = make_cleanup (free_current_contents, &val_args);
 
   if (s == 0)
@@ -2207,9 +2210,9 @@ printf_command (char *arg, int from_tty)
       {
        char *s1;
        if (nargs == allocated_args)
-         val_args = (value_ptr *) xrealloc ((char *) val_args,
-                                            (allocated_args *= 2)
-                                            * sizeof (value_ptr));
+         val_args = (struct value **) xrealloc ((char *) val_args,
+                                                (allocated_args *= 2)
+                                                * sizeof (struct value *));
        s1 = s;
        val_args[nargs] = parse_to_comma_and_eval (&s1);
 
@@ -2244,7 +2247,7 @@ printf_command (char *arg, int from_tty)
              char *str;
              CORE_ADDR tem;
              int j;
-             tem = value_as_pointer (val_args[i]);
+             tem = value_as_address (val_args[i]);
 
              /* This is a %s argument.  Find the length of the string.  */
              for (j = 0;; j++)