return encoding;
}
+/* See language.h. */
+
+struct value *
+f_language::value_string (struct gdbarch *gdbarch,
+ const char *ptr, ssize_t len) const
+{
+ struct type *type = language_string_char_type (this, gdbarch);
+ return ::value_string (ptr, len, type);
+}
+
/* A helper function for the "bound" intrinsics that checks that TYPE
is an array. LBOUND_P is true for lower bound; this is used for
the error message, if any. */
builtin_f_type (gdbarch)->builtin_integer,
1, ndimensions);
struct type *elm_type = builtin_f_type (gdbarch)->builtin_integer;
- struct type *result_type = create_array_type (nullptr, elm_type, range);
+ struct type *result_type = create_array_type (alloc, elm_type, range);
struct value *result = value::allocate (result_type);
/* Walk the array dimensions backwards due to the way the array will be
{
if (inner_p)
{
- gdb_assert (m_mark == nullptr);
- m_mark = value_mark ();
+ gdb_assert (!m_mark.has_value ());
+ m_mark.emplace ();
}
}
{
if (inner_p)
{
- gdb_assert (m_mark != nullptr);
- value_free_to_mark (m_mark);
- m_mark = nullptr;
+ gdb_assert (m_mark.has_value ());
+ m_mark.reset ();
}
}
written. */
LONGEST m_dest_offset;
- /* Set with a call to VALUE_MARK, and then reset after calling
- VALUE_FREE_TO_MARK. */
- struct value *m_mark = nullptr;
+ /* Set and reset to handle removing intermediate values from the
+ value chain. */
+ gdb::optional<scoped_value_mark> m_mark;
};
/* A class used by FORTRAN_VALUE_SUBARRAY when repacking Fortran array
builtin_type (gdbarch)->builtin_int,
1, ndimensions);
struct type *elm_type = builtin_f_type (gdbarch)->builtin_integer;
- struct type *result_type = create_array_type (nullptr, elm_type, range);
+ struct type *result_type = create_array_type (alloc, elm_type, range);
struct value *result = value::allocate (result_type);
LONGEST elm_len = elm_type->length ();
&p_low, &p_high, 0, &p_stride,
true);
array_slice_type
- = create_array_type (nullptr, array_slice_type, new_range);
+ = create_array_type (alloc, array_slice_type, new_range);
}
if (fortran_array_slicing_debug)
&p_low, &p_high, 0, &p_stride,
true);
repacked_array_type
- = create_array_type (nullptr, repacked_array_type, new_range);
+ = create_array_type (alloc, repacked_array_type, new_range);
}
/* Now copy the elements from the original ARRAY into the packed
bool is_artificial = ((arg_num >= func_type->num_fields ())
? true
- : TYPE_FIELD_ARTIFICIAL (func_type, arg_num));
+ : func_type->field (arg_num).is_artificial ());
/* If this is an artificial argument, then either, this is an argument
beyond the end of the known arguments, or possibly, there are no known