... and update all users.
gdb/ChangeLog:
* gdbtypes.h (get_type_arch): Rename to...
(struct type) <arch>: ... this, update all users.
Change-Id: I0e3ef938a0afe798ac0da74a9976bbd1d082fc6f
+2021-01-28 Simon Marchi <simon.marchi@polymtl.ca>
+
+ * gdbtypes.h (get_type_arch): Rename to...
+ (struct type) <arch>: ... this, update all users.
+
2021-01-28 Simon Marchi <simon.marchi@polymtl.ca>
* gdbtypes.h (struct type) <arch>: Rename to...
static CORE_ADDR
value_pointer (struct value *value, struct type *type)
{
- struct gdbarch *gdbarch = get_type_arch (type);
unsigned len = TYPE_LENGTH (type);
gdb_byte *buf = (gdb_byte *) alloca (len);
CORE_ADDR addr;
addr = value_address (value);
- gdbarch_address_to_pointer (gdbarch, type, buf, addr);
+ gdbarch_address_to_pointer (type->arch (), type, buf, addr);
addr = extract_unsigned_integer (buf, len, type_byte_order (type));
return addr;
}
static struct type *
ada_scaling_type (struct type *type)
{
- return builtin_type (get_type_arch (type))->builtin_long_double;
+ return builtin_type (type->arch ())->builtin_long_double;
}
/* Assuming that TYPE is the representation of an Ada fixed-point
so we have to work-around this deficiency by handling
System.Address values as a special case. */
- struct gdbarch *gdbarch = get_type_arch (type);
+ struct gdbarch *gdbarch = type->arch ();
struct type *ptr_type = builtin_type (gdbarch)->builtin_data_ptr;
CORE_ADDR addr = extract_typed_address (valaddr, ptr_type);
for (tmp = &(b->loc); *tmp != NULL; tmp = &((*tmp)->next))
;
*tmp = loc;
- loc->gdbarch = get_type_arch (value_type (v));
+ loc->gdbarch = value_type (v)->arch ();
loc->pspace = frame_pspace;
loc->address = address_significant (loc->gdbarch, addr);
{
const char *encoding;
- classify_type (type, get_type_arch (type), &encoding);
+ classify_type (type, type->arch (), &encoding);
generic_emit_char (c, type, stream, quoter, encoding);
}
{
c_string_type str_type;
- str_type = classify_type (type, get_type_arch (type), NULL);
+ str_type = classify_type (type, type->arch (), NULL);
switch (str_type)
{
case C_CHAR:
const char *type_encoding;
const char *encoding;
- str_type = (classify_type (type, get_type_arch (type), &type_encoding)
+ str_type = (classify_type (type, type->arch (), &type_encoding)
& ~C_CHAR);
switch (str_type)
{
if (! c_textual_element_type (element_type, 0))
goto error;
- classify_type (element_type, get_type_arch (element_type), charset);
+ classify_type (element_type, element_type->arch (), charset);
width = TYPE_LENGTH (element_type);
/* If the string lives in GDB's memory instead of the inferior's,
}
address_space_id
- = address_space_type_instance_flags_to_name (get_type_arch (type),
+ = address_space_type_instance_flags_to_name (type->arch (),
type->instance_flags ());
if (address_space_id)
{
const struct value_print_options *options)
{
int want_space = 0;
- struct gdbarch *gdbarch = get_type_arch (type);
+ struct gdbarch *gdbarch = type->arch ();
if (elttype->code () == TYPE_CODE_FUNC)
{
}
struct type *type = check_typedef (value_type (val));
- struct gdbarch *arch = get_type_arch (type);
const gdb_byte *valaddr = value_contents_for_printing (val);
if (options->vtblprint && cp_is_vtbl_ptr_type (type))
TYPE_CODE_STRUCT.) */
CORE_ADDR addr = extract_typed_address (valaddr, type);
- print_function_pointer_address (options, arch, addr, stream);
+ print_function_pointer_address (options, type->arch (), addr, stream);
}
else
{
/* Print vtable entry - we only get here if NOT using
-fvtable_thunks. (Otherwise, look under
TYPE_CODE_PTR.) */
- struct gdbarch *gdbarch = get_type_arch (type);
int offset = TYPE_FIELD_BITPOS (type, VTBL_FNADDR_OFFSET) / 8;
struct type *field_type = type->field (VTBL_FNADDR_OFFSET).type ();
const gdb_byte *valaddr = value_contents_for_printing (val);
CORE_ADDR addr = extract_typed_address (valaddr + offset, field_type);
- print_function_pointer_address (options, gdbarch, addr, stream);
+ print_function_pointer_address (options, type->arch (), addr, stream);
}
else
cp_print_value_fields (val, stream, recurse, options, NULL, 0);
i_offset += value_embedded_offset (val);
addr = extract_typed_address (valaddr + i_offset, i_type);
print_function_pointer_address (opts,
- get_type_arch (type),
+ type->arch (),
addr, stream);
}
}
m_stride = type_length_units (elt_type);
else
{
- struct gdbarch *arch = get_type_arch (elt_type);
- int unit_size = gdbarch_addressable_memory_unit_size (arch);
+ int unit_size
+ = gdbarch_addressable_memory_unit_size (elt_type->arch ());
m_stride /= (unit_size * 8);
}
};
switch (TYPE_LENGTH (type))
{
case 1:
- encoding = target_charset (get_type_arch (type));
+ encoding = target_charset (type->arch ());
break;
case 4:
if (type_byte_order (type) == BFD_ENDIAN_BIG)
stride = type_length_units (elt_type);
else
{
- struct gdbarch *arch = get_type_arch (elt_type);
- int unit_size = gdbarch_addressable_memory_unit_size (arch);
+ int unit_size
+ = gdbarch_addressable_memory_unit_size (elt_type->arch ());
stride /= (unit_size * 8);
}
fprintf_filtered (stream, ") ");
fprintf_filtered (stream, "(");
if (nfields == 0 && type->is_prototyped ())
- print_type (builtin_f_type (get_type_arch (type))->builtin_void,
- "", stream, -1, 0, 0);
+ print_type (builtin_f_type (type->arch ())->builtin_void,
+ "", stream, -1, 0, 0);
else
for (i = 0; i < nfields; i++)
{
case TYPE_CODE_VOID:
{
- gdbarch *gdbarch = get_type_arch (type);
- struct type *void_type = builtin_f_type (gdbarch)->builtin_void;
+ struct type *void_type = builtin_f_type (type->arch ())->builtin_void;
fprintf_filtered (stream, "%*s%s", level, "", void_type->name ());
}
break;
const struct value_print_options *options) const
{
struct type *type = check_typedef (value_type (val));
- struct gdbarch *gdbarch = get_type_arch (type);
+ struct gdbarch *gdbarch = type->arch ();
int printed_field = 0; /* Number of fields printed. */
struct type *elttype;
CORE_ADDR addr;
_("extract_typed_address: "
"type is not a pointer or reference"));
- return gdbarch_pointer_to_address (get_type_arch (type), type, buf);
+ return gdbarch_pointer_to_address (type->arch (), type, buf);
}
/* All 'store' functions accept a host-format integer and store a
_("store_typed_address: "
"type is not a pointer or reference"));
- gdbarch_address_to_pointer (get_type_arch (type), type, buf, addr);
+ gdbarch_address_to_pointer (type->arch (), type, buf, addr);
}
/* Copy a value from SOURCE of size SOURCE_SIZE bytes to DEST of size DEST_SIZE
return alloc_type_arch (type->arch_owner ());
}
-/* If TYPE is gdbarch-associated, return that architecture.
- If TYPE is objfile-associated, return that objfile's architecture. */
+/* See gdbtypes.h. */
-struct gdbarch *
-get_type_arch (const struct type *type)
+gdbarch *
+type::arch () const
{
struct gdbarch *arch;
- if (type->is_objfile_owned ())
- arch = type->objfile_owner ()->arch ();
+ if (this->is_objfile_owned ())
+ arch = this->objfile_owner ()->arch ();
else
- arch = type->arch_owner ();
+ arch = this->arch_owner ();
/* The ARCH can be NULL if TYPE is associated with neither an objfile nor
a gdbarch, however, this is very rare, and even then, in most cases
- that get_type_arch is called, we assume that a non-NULL value is
+ that type::arch is called, we assume that a non-NULL value is
returned. */
- gdb_assert (arch != NULL);
+ gdb_assert (arch != nullptr);
return arch;
}
unsigned int
type_length_units (struct type *type)
{
- struct gdbarch *arch = get_type_arch (type);
- int unit_size = gdbarch_addressable_memory_unit_size (arch);
+ int unit_size = gdbarch_addressable_memory_unit_size (type->arch ());
return TYPE_LENGTH (type) / unit_size;
}
/* Allocate the structure. */
if (!oldtype->is_objfile_owned ())
- type = GDBARCH_OBSTACK_ZALLOC (get_type_arch (oldtype), struct type);
+ type = GDBARCH_OBSTACK_ZALLOC (oldtype->arch_owner (), struct type);
else
type = OBSTACK_ZALLOC (&oldtype->objfile_owner ()->objfile_obstack,
struct type);
/* FIXME! Assumes the machine has only one representation for pointers! */
- TYPE_LENGTH (ntype)
- = gdbarch_ptr_bit (get_type_arch (type)) / TARGET_CHAR_BIT;
+ TYPE_LENGTH (ntype) = gdbarch_ptr_bit (type->arch ()) / TARGET_CHAR_BIT;
ntype->set_code (TYPE_CODE_PTR);
/* Mark pointers as unsigned. The target converts between pointers
references, and that it matches the (only) representation for
pointers! */
- TYPE_LENGTH (ntype) =
- gdbarch_ptr_bit (get_type_arch (type)) / TARGET_CHAR_BIT;
+ TYPE_LENGTH (ntype) = gdbarch_ptr_bit (type->arch ()) / TARGET_CHAR_BIT;
ntype->set_code (refcode);
*reftype = ntype;
set_type_self_type (type, self_type);
/* Assume that a data member pointer is the same size as a normal
pointer. */
- TYPE_LENGTH (type)
- = gdbarch_ptr_bit (get_type_arch (to_type)) / TARGET_CHAR_BIT;
+ TYPE_LENGTH (type) = gdbarch_ptr_bit (to_type->arch ()) / TARGET_CHAR_BIT;
}
/* Smash TYPE to be a type of pointer to methods type TO_TYPE.
I really don't think this is going to work with current GDB, the
array indexing code in GDB seems to be pretty heavily tied to byte
offsets right now. Assuming 8 bits in a byte. */
- struct gdbarch *gdbarch = get_type_arch (dyn_range_type);
+ struct gdbarch *gdbarch = dyn_range_type->arch ();
int unit_size = gdbarch_addressable_memory_unit_size (gdbarch);
if (!byte_stride_p && (value % (unit_size * 8)) != 0)
error (_("bit strides that are not a multiple of the byte size "
if (sym)
TYPE_TARGET_TYPE (type) = SYMBOL_TYPE (sym);
else /* TYPE_CODE_UNDEF */
- TYPE_TARGET_TYPE (type) = alloc_type_arch (get_type_arch (type));
+ TYPE_TARGET_TYPE (type) = alloc_type_arch (type->arch ());
}
type = TYPE_TARGET_TYPE (type);
static void
check_stub_method (struct type *type, int method_id, int signature_id)
{
- struct gdbarch *gdbarch = get_type_arch (type);
+ struct gdbarch *gdbarch = type->arch ();
struct fn_field *f;
char *mangled_name = gdb_mangle_name (type, method_id, signature_id);
char *demangled_name = gdb_demangle (mangled_name,
return raw_align;
/* Allow the architecture to provide an alignment. */
- struct gdbarch *arch = get_type_arch (type);
- ULONGEST align = gdbarch_type_align (arch, type);
+ ULONGEST align = gdbarch_type_align (type->arch (), type);
if (align != 0)
return align;
enum bfd_endian
type_byte_order (const struct type *type)
{
- bfd_endian byteorder = gdbarch_byte_order (get_type_arch (type));
+ bfd_endian byteorder = gdbarch_byte_order (type->arch ());
if (type->endianity_is_not_default ())
{
if (byteorder == BFD_ENDIAN_BIG)
if (*slot != NULL)
return ((struct type_pair *) *slot)->newobj;
- new_type = alloc_type_arch (get_type_arch (type));
+ new_type = alloc_type_arch (type->arch ());
/* We must add the new type to the hash table immediately, in case
we encounter this type again during a recursive call below. */
copy the entire thing and then update specific fields as needed. */
*TYPE_MAIN_TYPE (new_type) = *TYPE_MAIN_TYPE (type);
- new_type->set_owner (get_type_arch (type));
+ new_type->set_owner (type->arch ());
if (type->name ())
new_type->set_name (xstrdup (type->name ()));
void
append_flags_type_flag (struct type *type, int bitpos, const char *name)
{
- struct gdbarch *gdbarch = get_type_arch (type);
-
append_flags_type_field (type, bitpos, 1,
- builtin_type (gdbarch)->builtin_bool,
+ builtin_type (type->arch ())->builtin_bool,
name);
}
return this->main_type->m_owner.gdbarch;
}
+ /* Return the type's architecture. For types owned by an
+ architecture, that architecture is returned. For types owned by an
+ objfile, that objfile's architecture is returned.
+
+ The return value is always non-nullptr. */
+ gdbarch *arch () const;
+
/* * Return true if this is an integer type whose logical (bit) size
differs from its storage size; false otherwise. Always return
false for non-integer (i.e., non-TYPE_SPECIFIC_INT) types. */
extern struct type *alloc_type_arch (struct gdbarch *);
extern struct type *alloc_type_copy (const struct type *);
-/* * Return the type's architecture. For types owned by an
- architecture, that architecture is returned. For types owned by an
- objfile, that objfile's architecture is returned. */
-
-extern struct gdbarch *get_type_arch (const struct type *);
-
/* * This returns the target type (or NULL) of TYPE, also skipping
past typedefs. */
extern void allocate_fixed_point_type_info (struct type *type);
/* * When the type includes explicit byte ordering, return that.
- Otherwise, the byte ordering from gdbarch_byte_order for
- get_type_arch is returned. */
-
+ Otherwise, the byte ordering from gdbarch_byte_order for
+ the type's arch is returned. */
+
extern enum bfd_endian type_byte_order (const struct type *type);
/* A flag to enable printing of debugging information of C++
return NULL;
/* Determine architecture. */
- gdbarch = get_type_arch (values_type);
+ gdbarch = values_type->arch ();
if (using_enc_p)
*using_enc_p = 0;
error (_("Only classes can have virtual functions."));
/* Determine architecture. */
- gdbarch = get_type_arch (values_type);
+ gdbarch = values_type->arch ();
/* Cast our value to the base class which defines this virtual
function. This takes care of any necessary `this'
long int cur_base_offset, base_offset;
/* Determine architecture. */
- gdbarch = get_type_arch (type);
+ gdbarch = type->arch ();
ptr_type = builtin_type (gdbarch)->builtin_data_ptr;
/* If it isn't a virtual base, this is easy. The offset is in the
struct ui_file *stream)
{
struct type *self_type = TYPE_SELF_TYPE (type);
- struct gdbarch *gdbarch = get_type_arch (self_type);
+ struct gdbarch *gdbarch = self_type->arch ();
CORE_ADDR ptr_value;
LONGEST adjustment;
int vbit;
static int
gnuv3_method_ptr_size (struct type *type)
{
- struct gdbarch *gdbarch = get_type_arch (type);
-
- return 2 * TYPE_LENGTH (builtin_type (gdbarch)->builtin_data_ptr);
+ return 2 * TYPE_LENGTH (builtin_type (type->arch ())->builtin_data_ptr);
}
/* GNU v3 implementation of cplus_make_method_ptr. */
gnuv3_make_method_ptr (struct type *type, gdb_byte *contents,
CORE_ADDR value, int is_virtual)
{
- struct gdbarch *gdbarch = get_type_arch (type);
+ struct gdbarch *gdbarch = type->arch ();
int size = TYPE_LENGTH (builtin_type (gdbarch)->builtin_data_ptr);
enum bfd_endian byte_order = type_byte_order (type);
method_type = TYPE_TARGET_TYPE (check_typedef (value_type (method_ptr)));
/* Extract the pointer to member. */
- gdbarch = get_type_arch (self_type);
+ gdbarch = self_type->arch ();
vbit = gnuv3_decode_method_ptr (gdbarch, contents, &ptr_value, &adjustment);
/* First convert THIS to match the containing type of the pointer to
type = check_typedef (value_type (value));
}
- gdbarch = get_type_arch (type);
+ gdbarch = type->arch ();
vtable = NULL;
if (type->code () == TYPE_CODE_STRUCT)
/* Ignore top-level cv-qualifiers. */
type = make_cv_type (0, 0, type, NULL);
- gdbarch = get_type_arch (type);
+ gdbarch = type->arch ();
type_name = type_to_string (type);
if (type_name.empty ())
static std::string
gnuv3_get_typename_from_type_info (struct value *type_info_ptr)
{
- struct gdbarch *gdbarch = get_type_arch (value_type (type_info_ptr));
+ struct gdbarch *gdbarch = value_type (type_info_ptr)->arch ();
struct bound_minimal_symbol typeinfo_sym;
CORE_ADDR addr;
const char *symname;
struct value *val,
const struct value_print_options *options)
{
- struct gdbarch *gdbarch = get_type_arch (type);
+ struct gdbarch *gdbarch = type->arch ();
struct type *elt_ptr_type = type->field (0).type ();
struct type *elt_type = TYPE_TARGET_TYPE (elt_ptr_type);
LONGEST length;
const struct language_defn *language)
{
struct type *type = value_type (value);
- struct gdbarch *gdbarch = get_type_arch (type);
+ struct gdbarch *gdbarch = type->arch ();
SCM exception = SCM_BOOL_F;
SCM printer = SCM_BOOL_F;
SCM val_obj = SCM_BOOL_F;
struct value *index
= vlscm_convert_value_from_scheme (FUNC_NAME, SCM_ARG2, index_scm,
&except_scm,
- get_type_arch (type),
+ type->arch (),
current_language);
if (index == NULL)
return except_scm;
struct type **function_type)
{
struct type *ftype = check_typedef (value_type (function));
- struct gdbarch *gdbarch = get_type_arch (ftype);
+ struct gdbarch *gdbarch = ftype->arch ();
struct type *value_type = NULL;
/* Initialize it just to avoid a GCC false warning. */
CORE_ADDR funaddr = 0;
const struct value_print_options *options,
struct ui_file *stream)
{
- struct gdbarch *gdbarch = get_type_arch (type);
+ struct gdbarch *gdbarch = type->arch ();
struct type *elttype = check_typedef (TYPE_TARGET_TYPE (type));
int want_space = 0;
int recurse,
const struct value_print_options *options)
{
- struct gdbarch *gdbarch = get_type_arch (type);
+ struct gdbarch *gdbarch = type->arch ();
CORE_ADDR addr = unpack_pointer (type, valaddr);
struct type *elttype = check_typedef (TYPE_TARGET_TYPE (type));
{
struct type *type = check_typedef (value_type (val));
- struct gdbarch *gdbarch = get_type_arch (type);
+ struct gdbarch *gdbarch = type->arch ();
enum bfd_endian byte_order = type_byte_order (type);
unsigned int i = 0; /* Number of characters printed */
unsigned len;
/* We often wrap here if there are long symbolic names. */
wrap_here (" ");
next_address = (value_address (val)
- + gdb_print_insn (get_type_arch (type),
+ + gdb_print_insn (type->arch (),
value_address (val), stream,
&branch_delay_insns));
return;
static struct type *
float_type_from_length (struct type *type)
{
- struct gdbarch *gdbarch = get_type_arch (type);
+ struct gdbarch *gdbarch = type->arch ();
const struct builtin_type *builtin = builtin_type (gdbarch);
if (TYPE_LENGTH (type) == TYPE_LENGTH (builtin->builtin_float))
const struct value_print_options *options,
int size, struct ui_file *stream)
{
- struct gdbarch *gdbarch = get_type_arch (type);
+ struct gdbarch *gdbarch = type->arch ();
unsigned int len = TYPE_LENGTH (type);
enum bfd_endian byte_order = type_byte_order (type);
{
const gdb_byte *str;
size_t len;
- struct gdbarch *gdbarch = get_type_arch (value_type (value));
+ struct gdbarch *gdbarch = value_type (value)->arch ();
struct type *wctype = lookup_typename (current_language,
"wchar_t", NULL, 0);
int wcwidth = TYPE_LENGTH (wctype);
{
/* Parameter data. */
struct type *param_type = value_type (value);
- struct gdbarch *gdbarch = get_type_arch (param_type);
+ struct gdbarch *gdbarch = param_type->arch ();
/* Determine target type corresponding to the format string. */
struct type *fmt_type;
break;
case wide_char_arg:
{
- struct gdbarch *gdbarch
- = get_type_arch (value_type (val_args[i]));
+ struct gdbarch *gdbarch = value_type (val_args[i])->arch ();
struct type *wctype = lookup_typename (current_language,
"wchar_t", NULL, 0);
struct type *valtype;
const struct language_defn *language)
{
struct type *type = value_type (value);
- struct gdbarch *gdbarch = get_type_arch (type);
+ struct gdbarch *gdbarch = type->arch ();
enum string_repr_result print_result;
if (value_lazy (value))
that. */
struct type *elttype = check_typedef (TYPE_TARGET_TYPE (type));
CORE_ADDR addr = value_as_address (val);
- struct gdbarch *arch = get_type_arch (type);
+ struct gdbarch *arch = type->arch ();
if (opts.addressprint)
{
{
if (!rust_chartype_p (chtype))
generic_emit_char (ch, chtype, stream, quoter,
- target_charset (get_type_arch (chtype)));
+ target_charset (chtype->arch ()));
else if (ch == '\\' || ch == quoter)
fprintf_filtered (stream, "\\%c", ch);
else if (ch == '\n')
LONGEST stride = array_type->bit_stride ();
if (stride != 0)
{
- struct gdbarch *arch = get_type_arch (elt_type);
+ struct gdbarch *arch = elt_type->arch ();
int unit_size = gdbarch_addressable_memory_unit_size (arch);
elt_size = stride / (unit_size * 8);
}
struct value *
value_x_unop (struct value *arg1, enum exp_opcode op, enum noside noside)
{
- struct gdbarch *gdbarch = get_type_arch (value_type (arg1));
+ struct gdbarch *gdbarch = value_type (arg1)->arch ();
char *ptr;
char tstr[13], mangle_tstr[13];
int static_memfuncp, nargs;
struct type *type2 = check_typedef (value_type (arg2));
const struct language_defn *language = current_language;
- struct gdbarch *gdbarch = get_type_arch (type1);
+ struct gdbarch *gdbarch = type1->arch ();
struct value *val;
gdb_mpq v1, v2, res;
int
value_bit_index (struct type *type, const gdb_byte *valaddr, int index)
{
- struct gdbarch *gdbarch = get_type_arch (type);
+ struct gdbarch *gdbarch = type->arch ();
LONGEST low_bound, high_bound;
LONGEST word;
unsigned rel_index;
otherwise occur when dealing with a target having two byte
pointers and four byte addresses. */
- int addr_bit = gdbarch_addr_bit (get_type_arch (type2));
+ int addr_bit = gdbarch_addr_bit (type2->arch ());
LONGEST longest = value_as_long (arg2);
if (addr_bit < sizeof (LONGEST) * HOST_CHAR_BIT)
{
case lval_internalvar:
set_internalvar (VALUE_INTERNALVAR (toval), fromval);
- return value_of_internalvar (get_type_arch (type),
+ return value_of_internalvar (type->arch (),
VALUE_INTERNALVAR (toval));
case lval_internalvar_component:
CORE_ADDR address, struct ui_file *stream,
const struct value_print_options *options)
{
- struct gdbarch *gdbarch = get_type_arch (type);
+ struct gdbarch *gdbarch = type->arch ();
if (elttype->code () == TYPE_CODE_FUNC)
{
print_ref_address (struct type *type, const gdb_byte *address_buffer,
int embedded_offset, struct ui_file *stream)
{
- struct gdbarch *gdbarch = get_type_arch (type);
+ struct gdbarch *gdbarch = type->arch ();
if (address_buffer != NULL)
{
const struct value_print_options *options)
{
LONGEST val;
- struct gdbarch *gdbarch = get_type_arch (type);
+ struct gdbarch *gdbarch = type->arch ();
int unit_size = gdbarch_addressable_memory_unit_size (gdbarch);
gdb_assert (!options->format);
struct value *original_value,
const struct value_print_options *options)
{
- struct gdbarch *gdbarch = get_type_arch (type);
+ struct gdbarch *gdbarch = type->arch ();
gdb_assert (!options->format);
+ embedded_offset);
ULONGEST val = unpack_long (type, valaddr);
int field, nfields = type->num_fields ();
- struct gdbarch *gdbarch = get_type_arch (type);
+ struct gdbarch *gdbarch = type->arch ();
struct type *bool_type = builtin_type (gdbarch)->builtin_bool;
fputs_filtered ("[", stream);
unsigned int fetchlimit; /* Maximum number of chars to print. */
int bytes_read;
gdb::unique_xmalloc_ptr<gdb_byte> buffer; /* Dynamically growable fetch buffer. */
- struct gdbarch *gdbarch = get_type_arch (elttype);
+ struct gdbarch *gdbarch = elttype->arch ();
enum bfd_endian byte_order = type_byte_order (elttype);
int width = TYPE_LENGTH (elttype);
struct gdbarch *
get_value_arch (const struct value *value)
{
- return get_type_arch (value_type (value));
+ return value_type (value)->arch ();
}
int
CORE_ADDR
value_as_address (struct value *val)
{
- struct gdbarch *gdbarch = get_type_arch (value_type (val));
+ struct gdbarch *gdbarch = value_type (val)->arch ();
/* Assume a CORE_ADDR can fit in a LONGEST (for now). Not sure
whether we want this to be true eventually. */
thevalue = std::string (s.get ());
len = thevalue.size ();
- gdbarch = get_type_arch (value_type (value));
+ gdbarch = value_type (value)->arch ();
type = builtin_type (gdbarch)->builtin_char;
if (!string_print)