import gdb-1999-10-11 snapshot
[deliverable/binutils-gdb.git] / gdb / valops.c
index 3c30d8ff9bec475aec0d09c1d77722a4729a5480..d51b67db64df80bca109004fe33d03985c938daf 100644 (file)
@@ -61,10 +61,6 @@ static CORE_ADDR value_push PARAMS ((CORE_ADDR, value_ptr));
 static value_ptr search_struct_field PARAMS ((char *, value_ptr, int,
                                              struct type *, int));
 
-static value_ptr search_struct_field_aux PARAMS ((char *, value_ptr, int,
-                                         struct type *, int, int *, char *,
-                                                 struct type **));
-
 static value_ptr search_struct_method PARAMS ((char *, value_ptr *,
                                               value_ptr *,
                                               int, int *, struct type *));
@@ -970,7 +966,6 @@ value_ind (arg1)
 {
   struct type *base_type;
   value_ptr arg2;
-  value_ptr real_val;
 
   COERCE_ARRAY (arg1);
 
@@ -1066,7 +1061,12 @@ push_bytes (sp, buffer, len)
   return sp;
 }
 
-/* Push onto the stack the specified value VALUE.  */
+#ifndef PARM_BOUNDARY
+#define PARM_BOUNDARY (0)
+#endif
+
+/* Push onto the stack the specified value VALUE.  Pad it correctly for
+   it to be an argument to a function.  */
 
 static CORE_ADDR
 value_push (sp, arg)
@@ -1074,18 +1074,31 @@ value_push (sp, arg)
      value_ptr arg;
 {
   register int len = TYPE_LENGTH (VALUE_ENCLOSING_TYPE (arg));
+  register int container_len;
+  register int offset;
+
+  /* How big is the container we're going to put this value in?  */
+  if (PARM_BOUNDARY)
+    container_len = ((len + PARM_BOUNDARY / TARGET_CHAR_BIT - 1)
+                    & ~(PARM_BOUNDARY / TARGET_CHAR_BIT - 1));
+
+  /* Are we going to put it at the high or low end of the container?  */
+  if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+    offset = container_len - len;
+  else
+    offset = 0;
 
   if (INNER_THAN (1, 2))
     {
       /* stack grows downward */
-      sp -= len;
-      write_memory (sp, VALUE_CONTENTS_ALL (arg), len);
+      sp -= container_len;
+      write_memory (sp + offset, VALUE_CONTENTS_ALL (arg), len);
     }
   else
     {
       /* stack grows upward */
-      write_memory (sp, VALUE_CONTENTS_ALL (arg), len);
-      sp += len;
+      write_memory (sp + offset, VALUE_CONTENTS_ALL (arg), len);
+      sp += container_len;
     }
 
   return sp;
@@ -2544,7 +2557,6 @@ value_find_oload_method_list (argp, method, offset, static_memfuncp, num_fns, ba
      int *boffset;
 {
   struct type *t;
-  value_ptr v;
 
   t = check_typedef (VALUE_TYPE (*argp));
 
@@ -2677,8 +2689,6 @@ find_overload_match (arg_types, nargs, name, method, lax, obj, fsym, valp, symp,
   /* Consider each candidate in turn */
   for (ix = 0; ix < num_fns; ix++)
     {
-      int jj;
-
       /* Number of parameters for current candidate */
       nparms = method ? TYPE_NFIELDS (fns_ptr[ix].type)
        : TYPE_NFIELDS (SYMBOL_TYPE (oload_syms[ix]));
This page took 0.024404 seconds and 4 git commands to generate.