]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2005-02-02 Andrew Cagney <cagney@gnu.org>
authorAndrew Cagney <cagney@redhat.com>
Wed, 2 Feb 2005 21:36:17 +0000 (21:36 +0000)
committerAndrew Cagney <cagney@redhat.com>
Wed, 2 Feb 2005 21:36:17 +0000 (21:36 +0000)
* value.h (VALUE_CONTENTS_ALL): Delete.
(value_contents_all): Declare.
* value.c (value_contents_all): New function.
* hpacc-abi.c, cp-valprint.c, valops.c, c-valprint.c: Update.
* m68k-tdep.c, i386-tdep.c, infcall.c, valops.c: Update.

gdb/ChangeLog
gdb/c-valprint.c
gdb/cp-valprint.c
gdb/hpacc-abi.c
gdb/i386-tdep.c
gdb/infcall.c
gdb/m68k-tdep.c
gdb/valops.c
gdb/value.c
gdb/value.h
gdb/vax-tdep.c

index 8806bfc8f10d85580a431cb478db05d282ead5cb..c56d5e3cd12957d7a61a98b1b4106b3755e9e598 100644 (file)
@@ -1,13 +1,17 @@
 2005-02-02  Andrew Cagney  <cagney@gnu.org>
 
+       * value.h (VALUE_CONTENTS_ALL): Delete.
+       (value_contents_all): Declare.
+       * value.c (value_contents_all): New function.
+       * hpacc-abi.c, cp-valprint.c, valops.c, c-valprint.c: Update.
+       * m68k-tdep.c, i386-tdep.c, infcall.c, valops.c: Update.
+
        * value.c (value_enclosing_type): New function.
        * value.h (VALUE_ENCLOSING_TYPE): Delete.
        (value_enclosing_type): Declare.
        * xstormy16-tdep.c, vax-tdep.c, m68k-tdep.c, i386-tdep.c: Update.
        * gnu-v3-abi.c, hpacc-abi.c, infcall.c, valops.c: Update.
 
-2005-02-01  Andrew Cagney  <cagney@gnu.org>
-
        * value.c (value_contents_all_raw)
        (value_contents_raw): New functions.
        * value.h (VALUE_CONTENTS_ALL_RAW, VALUE_CONTENTS_RAW): Delete.
index 532dedcf635342bb9371af17419054120171318f..6f106195811f72f50ef8a14379484682d6233bad 100644 (file)
@@ -579,8 +579,9 @@ c_value_print (struct value *val, struct ui_file *stream, int format,
                            TYPE_NAME (real_type),
                            full ? "" : _(" [incomplete object]"));
          /* Print out object: enclosing type is same as real_type if full */
-         return val_print (value_enclosing_type (val), VALUE_CONTENTS_ALL (val), 0,
-                        VALUE_ADDRESS (val), stream, format, 1, 0, pretty);
+         return val_print (value_enclosing_type (val),
+                           value_contents_all (val), 0,
+                           VALUE_ADDRESS (val), stream, format, 1, 0, pretty);
           /* Note: When we look up RTTI entries, we don't get any information on
              const or volatile attributes */
        }
@@ -589,13 +590,14 @@ c_value_print (struct value *val, struct ui_file *stream, int format,
          /* No RTTI information, so let's do our best */
          fprintf_filtered (stream, "(%s ?) ",
                            TYPE_NAME (value_enclosing_type (val)));
-         return val_print (value_enclosing_type (val), VALUE_CONTENTS_ALL (val), 0,
-                        VALUE_ADDRESS (val), stream, format, 1, 0, pretty);
+         return val_print (value_enclosing_type (val),
+                           value_contents_all (val), 0,
+                           VALUE_ADDRESS (val), stream, format, 1, 0, pretty);
        }
       /* Otherwise, we end up at the return outside this "if" */
     }
 
-  return val_print (type, VALUE_CONTENTS_ALL (val),
+  return val_print (type, value_contents_all (val),
                    VALUE_EMBEDDED_OFFSET (val),
                    VALUE_ADDRESS (val) + value_offset (val),
                    stream, format, 1, 0, pretty);
index a4aef464a9f9f49ecca3c620d719cefa6edf0473..e90a2b5dfcb19dc39de8c0cd96f2116306efff22 100644 (file)
@@ -664,12 +664,12 @@ cp_print_static_field (struct type *type,
                    sizeof (CORE_ADDR));
 
       CHECK_TYPEDEF (type);
-      cp_print_value_fields (type, type, VALUE_CONTENTS_ALL (val),
+      cp_print_value_fields (type, type, value_contents_all (val),
                             VALUE_EMBEDDED_OFFSET (val), VALUE_ADDRESS (val),
                             stream, format, recurse, pretty, NULL, 1);
       return;
     }
-  val_print (type, VALUE_CONTENTS_ALL (val), 
+  val_print (type, value_contents_all (val), 
             VALUE_EMBEDDED_OFFSET (val), VALUE_ADDRESS (val),
             stream, format, 0, recurse, pretty);
 }
index 1cd7ad6d9899b709a5babc91a57b1acd85b89da7..79b4c6989304306bbfdf1e4332bcfa7ca5021c7e 100644 (file)
@@ -219,7 +219,7 @@ hpacc_value_rtti_type (struct value *v, int *full, int *top, int *using_enc)
     *using_enc = 1;
 
   /* First get the virtual table address */
-  coreptr = *(CORE_ADDR *) ((VALUE_CONTENTS_ALL (v))
+  coreptr = *(CORE_ADDR *) ((value_contents_all (v))
                             + value_offset (v)
                             + (using_enclosing
                                ? 0
index 671ad506b3e3cea99b4ca467a0d42bde8c134cfc..1033eaf9638d9558995ccbea6f2b4476576f2df7 100644 (file)
@@ -1233,7 +1233,7 @@ i386_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
 
         This makes sure the stack says word-aligned.  */
       sp -= (len + 3) & ~3;
-      write_memory (sp, VALUE_CONTENTS_ALL (args[i]), len);
+      write_memory (sp, value_contents_all (args[i]), len);
     }
 
   /* Push value address.  */
index 4025ee221b4cf12c893e72307f97d6d96d8631d2..667a07fad0855151ed76796a438f73117120a5f6 100644 (file)
@@ -591,7 +591,7 @@ You must use a pointer to function type variable. Command ignored.", arg_name);
                  sp += aligned_len;
                }
              /* Push the structure.  */
-             write_memory (addr, VALUE_CONTENTS_ALL (args[i]), len);
+             write_memory (addr, value_contents_all (args[i]), len);
              /* The value we're going to pass is the address of the
                 thing we just pushed.  */
              /*args[i] = value_from_longest (lookup_pointer_type (values_type),
index 553bddebda6e0ffb45c938caa34c2155e3d9c854..0e6ec107545b7db28cff153a69e61a40fa2d2a5b 100644 (file)
@@ -432,7 +432,7 @@ m68k_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
       else
        offset = container_len - len;
       sp -= container_len;
-      write_memory (sp + offset, VALUE_CONTENTS_ALL (args[i]), len);
+      write_memory (sp + offset, value_contents_all (args[i]), len);
     }
 
   /* Store struct value address.  */
index ac55d535e46bdb39ae7831230c6ea08155338811..50b7e7cb3b4ad8ce10b87acc35429c64adea83aa 100644 (file)
@@ -485,10 +485,11 @@ value_at_lazy (struct type *type, CORE_ADDR addr)
   return val;
 }
 
-/* Called only from the VALUE_CONTENTS and VALUE_CONTENTS_ALL macros,
-   if the current data for a variable needs to be loaded into
+/* Called only from the VALUE_CONTENTS and value_contents_all()
+   macros, if the current data for a variable needs to be loaded into
    VALUE_CONTENTS(VAL).  Fetches the data from the user's process, and
-   clears the lazy flag to indicate that the data in the buffer is valid.
+   clears the lazy flag to indicate that the data in the buffer is
+   valid.
 
    If the value is zero-length, we avoid calling read_memory, which would
    abort.  We mark the value as fetched anyway -- all 0 bytes of it.
@@ -1023,7 +1024,7 @@ value_array (int lowbound, int highbound, struct value **elemvec)
       for (idx = 0; idx < nelem; idx++)
        {
          memcpy (value_contents_all_raw (val) + (idx * typelength),
-                 VALUE_CONTENTS_ALL (elemvec[idx]),
+                 value_contents_all (elemvec[idx]),
                  typelength);
        }
       return val;
@@ -1037,7 +1038,8 @@ value_array (int lowbound, int highbound, struct value **elemvec)
   addr = allocate_space_in_inferior (nelem * typelength);
   for (idx = 0; idx < nelem; idx++)
     {
-      write_memory (addr + (idx * typelength), VALUE_CONTENTS_ALL (elemvec[idx]),
+      write_memory (addr + (idx * typelength),
+                   value_contents_all (elemvec[idx]),
                    typelength);
     }
 
@@ -1503,7 +1505,7 @@ search_struct_method (char *name, struct value **arg1p,
                 according to HP/Taligent runtime spec.  */
              int skip;
              find_rt_vbase_offset (type, TYPE_BASECLASS (type, i),
-                                   VALUE_CONTENTS_ALL (*arg1p),
+                                   value_contents_all (*arg1p),
                                    offset + VALUE_EMBEDDED_OFFSET (*arg1p),
                                    &base_offset, &skip);
              if (skip >= 0)
@@ -1737,7 +1739,7 @@ find_method_list (struct value **argp, char *method, int offset,
               * according to HP/Taligent runtime spec.  */
              int skip;
              find_rt_vbase_offset (type, TYPE_BASECLASS (type, i),
-                                   VALUE_CONTENTS_ALL (*argp),
+                                   value_contents_all (*argp),
                                    offset + VALUE_EMBEDDED_OFFSET (*argp),
                                    &base_offset, &skip);
              if (skip >= 0)
index 25791434234b18e202ffb0044459b4d87a7220b5..690ef9a8048e2c55d2d63ff7b37f21916942dbb8 100644 (file)
@@ -165,6 +165,14 @@ value_enclosing_type (struct value *value)
   return value->enclosing_type;
 }
 
+const bfd_byte *
+value_contents_all (struct value *value)
+{
+  if (value->lazy)
+    value_fetch_lazy (value);
+  return value->aligner.contents;
+}
+
 \f
 /* Return a mark in the value chain.  All values allocated after the
    mark is obtained (except for those released) are subject to being freed
index ed4d9ee0b3412e3c287e7d80fd75c6c52d0d6416..ba435bc335a3f8ac4978c67c34ef5178295ceca5 100644 (file)
@@ -203,9 +203,7 @@ extern bfd_byte *value_contents_raw (struct value *);
    pointer by the embedded_offset value.  */
 
 extern bfd_byte *value_contents_all_raw (struct value *);
-#define VALUE_CONTENTS_ALL(val) \
-  ((void) (VALUE_LAZY(val) && value_fetch_lazy(val)), \
-  (val)->aligner.contents)
+extern const bfd_byte *value_contents_all (struct value *);
 
 extern int value_fetch_lazy (struct value *val);
 
index 028e24b46404df3db31a81b2b31fbc8a10e39415..44bd8457b17f937ac297d36c7a92583686d45815 100644 (file)
@@ -128,7 +128,7 @@ vax_store_arguments (struct regcache *regcache, int nargs,
 
       sp -= (len + 3) & ~3;
       count += (len + 3) / 4;
-      write_memory (sp, VALUE_CONTENTS_ALL (args[i]), len);
+      write_memory (sp, value_contents_all (args[i]), len);
     }
 
   /* Push argument count.  */