]> 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 22:34:36 +0000 (22:34 +0000)
committerAndrew Cagney <cagney@redhat.com>
Wed, 2 Feb 2005 22:34:36 +0000 (22:34 +0000)
* value.h (value_lazy): Declare.
* varobj.c, value.c, valops.c, valarith.c, printcmd.c: Update.
* cp-valprint.c, breakpoint.c, ada-lang.c: Update.

14 files changed:
gdb/ChangeLog
gdb/ada-lang.c
gdb/breakpoint.c
gdb/cp-valprint.c
gdb/eval.c
gdb/findvar.c
gdb/gnu-v2-abi.c
gdb/printcmd.c
gdb/stack.c
gdb/valarith.c
gdb/valops.c
gdb/value.c
gdb/value.h
gdb/varobj.c

index c56d5e3cd12957d7a61a98b1b4106b3755e9e598..e2e38a2138820e77bc1246584f94df034d153195 100644 (file)
@@ -1,5 +1,9 @@
 2005-02-02  Andrew Cagney  <cagney@gnu.org>
 
+       * value.h (value_lazy): Declare.
+       * varobj.c, value.c, valops.c, valarith.c, printcmd.c: Update.
+       * cp-valprint.c, breakpoint.c, ada-lang.c: Update.
+
        * value.h (VALUE_CONTENTS_ALL): Delete.
        (value_contents_all): Declare.
        * value.c (value_contents_all): New function.
index 97ffba850dfef3f513282d5bd79f36ab77baab33..3228fe5fc4ad6a3e64d982c567692e44d9869829 100644 (file)
@@ -451,7 +451,7 @@ coerce_unspec_val_to_type (struct value *val, struct type *type)
       result->bitsize = value_bitsize (val);
       result->bitpos = value_bitpos (val);
       VALUE_ADDRESS (result) = VALUE_ADDRESS (val) + value_offset (val);
-      if (VALUE_LAZY (val)
+      if (value_lazy (val)
           || TYPE_LENGTH (type) > TYPE_LENGTH (value_type (val)))
         VALUE_LAZY (result) = 1;
       else
@@ -1811,7 +1811,7 @@ ada_value_primitive_packed_val (struct value *obj, const bfd_byte *valaddr,
       v = allocate_value (type);
       bytes = (unsigned char *) (valaddr + offset);
     }
-  else if (VALUE_LAZY (obj))
+  else if (value_lazy (obj))
     {
       v = value_at (type,
                     VALUE_ADDRESS (obj) + value_offset (obj) + offset);
index d92dbeb86f0fcbd10d19652746f3c6c972a55252..bf8a29f8704aaca8422398d82e47f22f3620b3bf 100644 (file)
@@ -944,7 +944,7 @@ insert_bp_location (struct bp_location *bpt,
                 its contents to evaluate the expression, then we
                 must watch it.  */
              if (VALUE_LVAL (v) == lval_memory
-                 && ! VALUE_LAZY (v))
+                 && ! value_lazy (v))
                {
                  struct type *vtype = check_typedef (value_type (v));
 
@@ -1123,7 +1123,7 @@ insert_breakpoints (void)
          struct value *val;
          val = evaluate_expression (b->owner->exp);
          release_value (val);
-         if (VALUE_LAZY (val))
+         if (value_lazy (val))
            value_fetch_lazy (val);
          b->owner->val = val;
        }
@@ -1475,7 +1475,7 @@ remove_breakpoint (struct bp_location *b, insertion_state_t is)
          /* For each memory reference remove the watchpoint
             at that address.  */
          if (VALUE_LVAL (v) == lval_memory
-             && ! VALUE_LAZY (v))
+             && ! value_lazy (v))
            {
              struct type *vtype = check_typedef (value_type (v));
 
@@ -2728,7 +2728,7 @@ bpstat_stop_status (CORE_ADDR bp_addr, ptid_t ptid, int stopped_by_watchpoint)
        for (v = b->val_chain; v; v = v->next)
          {
            if (VALUE_LVAL (v) == lval_memory
-               && ! VALUE_LAZY (v))
+               && ! value_lazy (v))
              {
                struct type *vtype = check_typedef (value_type (v));
 
@@ -5619,7 +5619,7 @@ watch_command_1 (char *arg, int accessflag, int from_tty)
   mark = value_mark ();
   val = evaluate_expression (exp);
   release_value (val);
-  if (VALUE_LAZY (val))
+  if (value_lazy (val))
     value_fetch_lazy (val);
 
   tok = arg;
@@ -5793,7 +5793,7 @@ can_use_hardware_watchpoint (struct value *v)
     {
       if (VALUE_LVAL (v) == lval_memory)
        {
-         if (VALUE_LAZY (v))
+         if (value_lazy (v))
            /* A lazy memory lvalue is one that GDB never needed to fetch;
               we either just used its address (e.g., `a' in `a.b') or
               we never needed it at all (e.g., `a' in `a,b').  */
@@ -7116,7 +7116,7 @@ breakpoint_re_set_one (void *bint)
        }
       b->val = evaluate_expression (b->exp);
       release_value (b->val);
-      if (VALUE_LAZY (b->val) && breakpoint_enabled (b))
+      if (value_lazy (b->val) && breakpoint_enabled (b))
        value_fetch_lazy (b->val);
 
       if (b->cond_string != NULL)
@@ -7472,7 +7472,7 @@ is valid is not currently in scope.\n", bpt->number);
          mark = value_mark ();
          bpt->val = evaluate_expression (bpt->exp);
          release_value (bpt->val);
-         if (VALUE_LAZY (bpt->val))
+         if (value_lazy (bpt->val))
            value_fetch_lazy (bpt->val);
          
          if (bpt->type == bp_hardware_watchpoint ||
index e90a2b5dfcb19dc39de8c0cd96f2116306efff22..4079b8ffd95b56934082b6bd2e18c459a43302a1 100644 (file)
@@ -781,7 +781,7 @@ cp_print_hpacc_virtual_table_entries (struct type *type, int *vfuncs,
 
          /* Get the address of the vfunction entry */
          struct value *vf = value_copy (v);
-         if (VALUE_LAZY (vf))
+         if (value_lazy (vf))
            (void) value_fetch_lazy (vf);
          /* adjust by offset */
          vf->aligner.contents[0] += 4 * (HP_ACC_VFUNC_START + vx);
index 592a9b2d1483fbe3aaa95b1cfabd98e4ba04e07b..0a727ef914c1a0f6b6f61b696205ef4f183efa7a 100644 (file)
@@ -2143,7 +2143,7 @@ evaluate_subexp_for_address (struct expression *exp, int *pos,
    When used in contexts where arrays will be coerced anyway, this is
    equivalent to `evaluate_subexp' but much faster because it avoids
    actually fetching array contents (perhaps obsolete now that we have
-   VALUE_LAZY).
+   value_lazy()).
 
    Note that we currently only do the coercion for C expressions, where
    arrays are zero based and the coercion is correct.  For other languages,
index 5fc36855d04c70c1046a2118d2fa18bedd555c9c..94140d6f438eaa494a41671381a8b4b969c0cc16 100644 (file)
@@ -738,7 +738,7 @@ locate_var_value (struct symbol *var, struct frame_info *frame)
   if (lazy_value == 0)
     error ("Address of \"%s\" is unknown.", SYMBOL_PRINT_NAME (var));
 
-  if (VALUE_LAZY (lazy_value)
+  if (value_lazy (lazy_value)
       || TYPE_CODE (type) == TYPE_CODE_FUNC)
     {
       struct value *val;
index f545ac180c40e439858fd2f9953c7b94ab9952fe..4d932c465ac5385ac08720f87784fd5826310573 100644 (file)
@@ -164,7 +164,7 @@ gnuv2_virtual_fn_field (struct value **arg1p, struct fn_field * f, int j,
       /* Move the `this' pointer according to the virtual function table. */
       arg1->offset += value_as_long (value_field (entry, 0));
 
-      if (!VALUE_LAZY (arg1))
+      if (!value_lazy (arg1))
        {
          VALUE_LAZY (arg1) = 1;
          value_fetch_lazy (arg1);
index fb13ecb8c959a4ff3c6a7e974796db1abe2427d3..1efd5d358d5da28a23eddc6c7158ea38000c3422 100644 (file)
@@ -1316,7 +1316,7 @@ x_command (char *exp, int from_tty)
       /* Make contents of last address examined available to the user as $__. */
       /* If the last value has not been fetched from memory then don't
          fetch it now - instead mark it by voiding the $__ variable. */
-      if (VALUE_LAZY (last_examine_value))
+      if (value_lazy (last_examine_value))
        set_internalvar (lookup_internalvar ("__"),
                         allocate_value (builtin_type_void));
       else
index 2d8968c41bca239e2c5b15668483c2491c6af62d..aa0cb82412e63512bc00d04030978e47ff4afbfe 100644 (file)
@@ -1824,7 +1824,7 @@ return_command (char *retval_exp, int from_tty)
 
       /* Make sure the value is fully evaluated.  It may live in the
          stack frame we're about to pop.  */
-      if (VALUE_LAZY (return_value))
+      if (value_lazy (return_value))
        value_fetch_lazy (return_value);
 
       if (TYPE_CODE (return_type) == TYPE_CODE_VOID)
index 5233d08754549090389859abc40b84ec2d80e044..5b219575198f25c72082480d0b35206f853beb40 100644 (file)
@@ -268,7 +268,7 @@ value_subscripted_rvalue (struct value *array, struct value *idx, int lowerbound
     error ("no such vector element");
 
   v = allocate_value (elt_type);
-  if (VALUE_LAZY (array))
+  if (value_lazy (array))
     VALUE_LAZY (v) = 1;
   else
     memcpy (VALUE_CONTENTS (v), VALUE_CONTENTS (array) + elt_offs, elt_size);
index 50b7e7cb3b4ad8ce10b87acc35429c64adea83aa..442bb51ddb9c9bed8b5c0e2cfb3960ef3392ee85 100644 (file)
@@ -1312,7 +1312,7 @@ search_struct_field (char *name, struct value *arg1, int offset,
              VALUE_ADDRESS (v2) = VALUE_ADDRESS (arg1);
              VALUE_FRAME_ID (v2) = VALUE_FRAME_ID (arg1);
              v2->offset = value_offset (arg1) + boffset;
-             if (VALUE_LAZY (arg1))
+             if (value_lazy (arg1))
                VALUE_LAZY (v2) = 1;
              else
                memcpy (value_contents_raw (v2),
@@ -2763,7 +2763,7 @@ value_slice (struct value *array, int lowbound, int length)
                                      slice_range_type);
       TYPE_CODE (slice_type) = TYPE_CODE (array_type);
       slice = allocate_value (slice_type);
-      if (VALUE_LAZY (array))
+      if (value_lazy (array))
        VALUE_LAZY (slice) = 1;
       else
        memcpy (VALUE_CONTENTS (slice), VALUE_CONTENTS (array) + offset,
index 690ef9a8048e2c55d2d63ff7b37f21916942dbb8..3ff911ccba6b86441d4d7baff0aee01baa9427a6 100644 (file)
@@ -95,7 +95,7 @@ allocate_value (struct type *type)
   val->bitpos = 0;
   val->bitsize = 0;
   VALUE_REGNUM (val) = -1;
-  VALUE_LAZY (val) = 0;
+  val->lazy = 0;
   VALUE_OPTIMIZED_OUT (val) = 0;
   VALUE_EMBEDDED_OFFSET (val) = 0;
   VALUE_POINTED_TO_OFFSET (val) = 0;
@@ -173,6 +173,12 @@ value_contents_all (struct value *value)
   return value->aligner.contents;
 }
 
+int
+value_lazy (struct value *value)
+{
+  return value->lazy;
+}
+
 \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
@@ -276,12 +282,12 @@ value_copy (struct value *arg)
   val->bitsize = arg->bitsize;
   VALUE_FRAME_ID (val) = VALUE_FRAME_ID (arg);
   VALUE_REGNUM (val) = VALUE_REGNUM (arg);
-  VALUE_LAZY (val) = VALUE_LAZY (arg);
+  val->lazy = arg->lazy;
   VALUE_OPTIMIZED_OUT (val) = VALUE_OPTIMIZED_OUT (arg);
   VALUE_EMBEDDED_OFFSET (val) = VALUE_EMBEDDED_OFFSET (arg);
   VALUE_POINTED_TO_OFFSET (val) = VALUE_POINTED_TO_OFFSET (arg);
   val->modifiable = arg->modifiable;
-  if (!VALUE_LAZY (val))
+  if (!value_lazy (val))
     {
       memcpy (value_contents_all_raw (val), value_contents_all_raw (arg),
              TYPE_LENGTH (value_enclosing_type (arg)));
@@ -306,7 +312,7 @@ record_latest_value (struct value *val)
      In particular, "set $1 = 50" should not affect the variable from which
      the value was taken, and fast watchpoints should be able to assume that
      a value on the value history never changes.  */
-  if (VALUE_LAZY (val))
+  if (value_lazy (val))
     value_fetch_lazy (val);
   /* We preserve VALUE_LVAL so that the user can find out where it was fetched
      from.  This is a bit dubious, because then *&$1 does not just return $1
@@ -476,7 +482,7 @@ value_of_internalvar (struct internalvar *var)
   struct value *val;
 
   val = value_copy (var->value);
-  if (VALUE_LAZY (val))
+  if (value_lazy (val))
     value_fetch_lazy (val);
   VALUE_LVAL (val) = lval_internalvar;
   VALUE_INTERNALVAR (val) = var;
@@ -507,7 +513,7 @@ set_internalvar (struct internalvar *var, struct value *val)
   /* Force the value to be fetched from the target now, to avoid problems
      later when this internalvar is referenced and the target is gone or
      has changed.  */
-  if (VALUE_LAZY (newval))
+  if (value_lazy (newval))
     value_fetch_lazy (newval);
 
   /* Begin code which must not call error().  If var->value points to
@@ -962,7 +968,7 @@ value_primitive_field (struct value *arg1, int offset,
          bases, etc.  */
       v = allocate_value (value_enclosing_type (arg1));
       v->type = type;
-      if (VALUE_LAZY (arg1))
+      if (value_lazy (arg1))
        VALUE_LAZY (v) = 1;
       else
        memcpy (value_contents_all_raw (v), value_contents_all_raw (arg1),
@@ -978,7 +984,7 @@ value_primitive_field (struct value *arg1, int offset,
       /* Plain old data member */
       offset += TYPE_FIELD_BITPOS (arg_type, fieldno) / 8;
       v = allocate_value (type);
-      if (VALUE_LAZY (arg1))
+      if (value_lazy (arg1))
        VALUE_LAZY (v) = 1;
       else
        memcpy (value_contents_raw (v),
index ba435bc335a3f8ac4978c67c34ef5178295ceca5..7963bf176f1e61a494ebb71f3d5e083cdacd8a06 100644 (file)
@@ -179,6 +179,7 @@ extern int value_bitpos (struct value *);
 extern int value_offset (struct value *);
 
 extern struct type *value_enclosing_type (struct value *);
+extern int value_lazy (struct value *);
 #define VALUE_LAZY(val) (val)->lazy
 
 /* VALUE_CONTENTS and value_contents_raw() both return the address of
index d58c8bdbe7477eb331a02260e4af2e670d975c9f..78bea7c72690b54231e8db675cb93adf010c92cd 100644 (file)
@@ -500,7 +500,7 @@ varobj_create (char *objname,
        {
          /* no error */
          release_value (var->value);
-         if (VALUE_LAZY (var->value))
+         if (value_lazy (var->value))
            gdb_value_fetch_lazy (var->value);
        }
       else
@@ -1686,7 +1686,7 @@ value_of_child (struct varobj *parent, int index)
   value = (*parent->root->lang->value_of_child) (parent, index);
 
   /* If we're being lazy, fetch the real value of the variable. */
-  if (value != NULL && VALUE_LAZY (value))
+  if (value != NULL && value_lazy (value))
     {
       /* If we fail to fetch the value of the child, return
          NULL so that callers notice that we're leaving an
@@ -1904,7 +1904,7 @@ c_value_of_root (struct varobj **var_handle)
          go on */
       if (gdb_evaluate_expression (var->root->exp, &new_val))
        {
-         if (VALUE_LAZY (new_val))
+         if (value_lazy (new_val))
            {
              /* We need to catch errors because if
                 value_fetch_lazy fails we still want to continue
@@ -2092,7 +2092,7 @@ c_value_of_variable (struct varobj *var)
            struct cleanup *old_chain = make_cleanup_ui_file_delete (stb);
            char *thevalue;
 
-           if (VALUE_LAZY (var->value))
+           if (value_lazy (var->value))
              gdb_value_fetch_lazy (var->value);
            val_print (value_type (var->value),
                       value_contents_raw (var->value), 0,