Add error_value_not_available, and use it.
if (optim)
error_value_optimized_out ();
if (unavail)
- throw_error (NOT_AVAILABLE_ERROR,
- _("value is not available"));
+ error_value_not_available ();
}
modify_field (type, buffer, value_as_long (fromval),
throw_error (OPTIMIZED_OUT_ERROR, _("value has been optimized out"));
}
+void
+error_value_not_available ()
+{
+ throw_error (NOT_AVAILABLE_ERROR, _("value is not available"));
+}
+
void
value::require_not_optimized_out () const
{
value::require_available () const
{
if (!m_unavailable.empty ())
- throw_error (NOT_AVAILABLE_ERROR, _("value is not available"));
+ error_value_not_available ();
}
gdb::array_view<const gdb_byte>
[[noreturn]] extern void error_value_optimized_out ();
+/* Throw an error complaining that the value is not available. */
+
+[[noreturn]] extern void error_value_not_available ();
+
/* Pointer to internal variable. */
#define VALUE_INTERNALVAR(val) (*((val)->deprecated_internalvar_hack ()))