const struct value *original_value,
const struct value_print_options *options)
{
+ struct gdbarch *gdbarch = get_type_arch (type);
+ int unit_size = gdbarch_addressable_memory_unit_size (gdbarch);
+
if (options->format && options->format != 's')
{
val_print_scalar_formatted (type, valaddr, embedded_offset,
{
struct type *unresolved_elttype = TYPE_TARGET_TYPE(type);
struct type *elttype = check_typedef (unresolved_elttype);
- CORE_ADDR addr = unpack_pointer (type, valaddr + embedded_offset);
+ CORE_ADDR addr = unpack_pointer (type,
+ valaddr + embedded_offset * unit_size);
print_unpacked_pointer (type, elttype, addr, stream, options);
}
unsigned int i;
unsigned int len;
LONGEST val;
+ struct gdbarch *gdbarch = get_type_arch (type);
+ int unit_size = gdbarch_addressable_memory_unit_size (gdbarch);
if (options->format)
{
return;
}
len = TYPE_NFIELDS (type);
- val = unpack_long (type, valaddr + embedded_offset);
+ val = unpack_long (type, valaddr + embedded_offset * unit_size);
for (i = 0; i < len; i++)
{
QUIT;
const struct generic_val_print_decorations *decorations)
{
LONGEST val;
+ struct gdbarch *gdbarch = get_type_arch (type);
+ int unit_size = gdbarch_addressable_memory_unit_size (gdbarch);
if (options->format || options->output_format)
{
}
else
{
- val = unpack_long (type, valaddr + embedded_offset);
+ val = unpack_long (type, valaddr + embedded_offset * unit_size);
if (val == 0)
fputs_filtered (decorations->false_name, stream);
else if (val == 1)
const struct value *original_value,
const struct value_print_options *options)
{
+ struct gdbarch *gdbarch = get_type_arch (type);
+ int unit_size = gdbarch_addressable_memory_unit_size (gdbarch);
+
if (options->format || options->output_format)
{
struct value_print_options opts = *options;
original_value, &opts, 0, stream);
}
else
- val_print_type_code_int (type, valaddr + embedded_offset, stream);
+ val_print_type_code_int (type, valaddr + embedded_offset * unit_size,
+ stream);
}
/* generic_val_print helper for TYPE_CODE_CHAR. */
const struct value_print_options *options)
{
LONGEST val;
+ struct gdbarch *gdbarch = get_type_arch (type);
+ int unit_size = gdbarch_addressable_memory_unit_size (gdbarch);
if (options->format || options->output_format)
{
}
else
{
- val = unpack_long (type, valaddr + embedded_offset);
+ val = unpack_long (type, valaddr + embedded_offset * unit_size);
if (TYPE_UNSIGNED (type))
fprintf_filtered (stream, "%u", (unsigned int) val);
else
const struct value *original_value,
const struct value_print_options *options)
{
+ struct gdbarch *gdbarch = get_type_arch (type);
+ int unit_size = gdbarch_addressable_memory_unit_size (gdbarch);
+
if (options->format)
{
val_print_scalar_formatted (type, valaddr, embedded_offset,
}
else
{
- print_floating (valaddr + embedded_offset, type, stream);
+ print_floating (valaddr + embedded_offset * unit_size, type, stream);
}
}
const struct value *original_value,
const struct value_print_options *options)
{
+ struct gdbarch *gdbarch = get_type_arch (type);
+ int unit_size = gdbarch_addressable_memory_unit_size (gdbarch);
+
if (options->format)
val_print_scalar_formatted (type, valaddr, embedded_offset, original_value,
options, 0, stream);
else
- print_decimal_floating (valaddr + embedded_offset, type, stream);
+ print_decimal_floating (valaddr + embedded_offset * unit_size, type,
+ stream);
}
/* generic_val_print helper for TYPE_CODE_COMPLEX. */
const struct generic_val_print_decorations
*decorations)
{
+ struct gdbarch *gdbarch = get_type_arch (type);
+ int unit_size = gdbarch_addressable_memory_unit_size (gdbarch);
+
fprintf_filtered (stream, "%s", decorations->complex_prefix);
if (options->format)
val_print_scalar_formatted (TYPE_TARGET_TYPE (type), valaddr,
embedded_offset, original_value, options, 0,
stream);
else
- print_floating (valaddr + embedded_offset, TYPE_TARGET_TYPE (type),
- stream);
+ print_floating (valaddr + embedded_offset * unit_size,
+ TYPE_TARGET_TYPE (type), stream);
fprintf_filtered (stream, "%s", decorations->complex_infix);
if (options->format)
val_print_scalar_formatted (TYPE_TARGET_TYPE (type), valaddr,
embedded_offset
- + TYPE_LENGTH (TYPE_TARGET_TYPE (type)),
+ + type_length_units (TYPE_TARGET_TYPE (type)),
original_value, options, 0, stream);
else
- print_floating (valaddr + embedded_offset
+ print_floating (valaddr + embedded_offset * unit_size
+ TYPE_LENGTH (TYPE_TARGET_TYPE (type)),
TYPE_TARGET_TYPE (type), stream);
fprintf_filtered (stream, "%s", decorations->complex_suffix);
int size,
struct ui_file *stream)
{
+ struct gdbarch *arch = get_type_arch (type);
+ int unit_size = gdbarch_addressable_memory_unit_size (arch);
+
gdb_assert (val != NULL);
gdb_assert (valaddr == value_contents_for_printing_const (val));
else if (!value_bytes_available (val, embedded_offset, TYPE_LENGTH (type)))
val_print_unavailable (stream);
else
- print_scalar_formatted (valaddr + embedded_offset, type,
+ print_scalar_formatted (valaddr + embedded_offset * unit_size, type,
options, size, stream);
}
LONGEST low_pos, high_pos;
elttype = TYPE_TARGET_TYPE (type);
- eltlen = TYPE_LENGTH (check_typedef (elttype));
+ eltlen = type_length_units (check_typedef (elttype));
index_type = TYPE_INDEX_TYPE (type);
if (get_array_bounds (type, &low_bound, &high_bound))