struct type *type)
{
struct value *v;
- gdb_byte *src; /* First byte containing data to unpack */
+ const gdb_byte *src; /* First byte containing data to unpack */
gdb_byte *unpacked;
const int is_scalar = is_scalar_type (type);
const int is_big_endian = gdbarch_bits_big_endian (get_type_arch (type));
type = ada_check_typedef (type);
if (obj == NULL)
- src = (gdb_byte *) valaddr + offset;
+ src = valaddr + offset;
else
- src = (gdb_byte *) value_contents (obj) + offset;
+ src = value_contents (obj) + offset;
if (is_dynamic_type (type))
{
we do, is unpack the data into a byte-aligned buffer, and then
use that buffer as our object's value for resolving the type. */
staging_len = (bit_size + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT;
- staging = malloc (staging_len);
+ staging = (gdb_byte *) malloc (staging_len);
make_cleanup (xfree, staging);
ada_unpack_from_contents (src, bit_offset, bit_size,
if (obj == NULL)
{
v = allocate_value (type);
- src = (gdb_byte *) valaddr + offset;
+ src = valaddr + offset;
}
else if (VALUE_LVAL (obj) == lval_memory && value_lazy (obj))
{
int src_len = (bit_size + bit_offset + HOST_CHAR_BIT - 1) / 8;
+ gdb_byte *buf;
v = value_at (type, value_address (obj) + offset);
- src = alloca (src_len);
- read_memory (value_address (v), src, src_len);
+ buf = (gdb_byte *) alloca (src_len);
+ read_memory (value_address (v), buf, src_len);
+ src = buf;
}
else
{
v = allocate_value (type);
- src = (gdb_byte *) value_contents (obj) + offset;
+ src = value_contents (obj) + offset;
}
if (obj != NULL)
}
else
set_value_bitsize (v, bit_size);
- unpacked = (gdb_byte *) value_contents (v);
+ unpacked = value_contents_writeable (v);
if (bit_size == 0)
{
{
static char *result;
static size_t result_len = 0;
- char *tmp;
+ const char *tmp;
/* First, unqualify the enumeration name:
1. Search for the last '.' character. If we find one, then skip