cmd->name_allocated = 1;
}
-/* Update VALUE before discarding OBJFILE. COPIED_TYPES is used to
- prevent cycles / duplicates. */
-
void
-preserve_one_value (struct value *value, struct objfile *objfile,
- htab_t copied_types)
+value::preserve (struct objfile *objfile, htab_t copied_types)
{
- if (value->m_type->objfile_owner () == objfile)
- value->m_type = copy_type_recursive (value->m_type, copied_types);
+ if (m_type->objfile_owner () == objfile)
+ m_type = copy_type_recursive (m_type, copied_types);
- if (value->m_enclosing_type->objfile_owner () == objfile)
- value->m_enclosing_type = copy_type_recursive (value->m_enclosing_type,
- copied_types);
+ if (m_enclosing_type->objfile_owner () == objfile)
+ m_enclosing_type = copy_type_recursive (m_enclosing_type, copied_types);
}
/* Likewise for internal variable VAR. */
break;
case INTERNALVAR_VALUE:
- preserve_one_value (var->u.value, objfile, copied_types);
+ var->u.value->preserve (objfile, copied_types);
break;
}
}
}
if (varobj->value != nullptr)
- preserve_one_value (varobj->value.get (), objfile, copied_types);
+ varobj->value.get ()->preserve (objfile, copied_types);
}
/* Update the internal variables and value history when OBJFILE is
htab_up copied_types = create_copied_types_hash ();
for (const value_ref_ptr &item : value_history)
- preserve_one_value (item.get (), objfile, copied_types.get ());
+ item.get ()->preserve (objfile, copied_types.get ());
for (var = internalvars; var; var = var->next)
preserve_one_internalvar (var, objfile, copied_types.get ());
METHOD. */
struct value *call_xmethod (gdb::array_view<value *> argv);
+ /* Update this value before discarding OBJFILE. COPIED_TYPES is
+ used to prevent cycles / duplicates. */
+ void preserve (struct objfile *objfile, htab_t copied_types);
+
/* Type of value; either not an lval, or one of the various
different possible kinds of lval. */
extern struct value *make_cv_value (int, int, struct value *);
-extern void preserve_one_value (struct value *, struct objfile *, htab_t);
-
/* From valops.c */
extern struct value *varying_to_slice (struct value *);