/* Support for printing Pascal values for GDB, the GNU debugger.
- Copyright (C) 2000, 2001, 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011
- Free Software Foundation, Inc.
+ Copyright (C) 2000-2001, 2003, 2005-2012 Free Software Foundation,
+ Inc.
This file is part of GDB.
switch (TYPE_CODE (type))
{
case TYPE_CODE_ARRAY:
- if (get_array_bounds (type, &low_bound, &high_bound))
+ if (get_array_bounds (type, &low_bound, &high_bound))
{
len = high_bound - low_bound + 1;
elttype = check_typedef (TYPE_TARGET_TYPE (type));
print_address_demangle (gdbarch, addr, stream, demangle);
break;
}
- elttype = check_typedef (TYPE_TARGET_TYPE (type));
+ check_typedef (TYPE_TARGET_TYPE (type));
addr = unpack_pointer (type, valaddr + embedded_offset);
print_unpacked_pointer:
{
if (TYPE_CODE (elttype) != TYPE_CODE_UNDEF)
{
- struct value *deref_val =
- value_at
- (TYPE_TARGET_TYPE (type),
- unpack_pointer (type, valaddr + embedded_offset));
+ struct value *deref_val;
+
+ deref_val = coerce_ref_if_computed (original_value);
+ if (deref_val != NULL)
+ {
+ /* More complicated computed references are not supported. */
+ gdb_assert (embedded_offset == 0);
+ }
+ else
+ deref_val = value_at (TYPE_TARGET_TYPE (type),
+ unpack_pointer (type,
+ (valaddr
+ + embedded_offset)));
common_val_print (deref_val, stream, recurse + 1, options,
current_language);
len = extract_unsigned_integer (valaddr + embedded_offset
+ length_pos, length_size,
byte_order);
- LA_PRINT_STRING (stream, char_type,
+ LA_PRINT_STRING (stream, char_type,
valaddr + embedded_offset + string_pos,
len, NULL, 0, options);
}
{
/* Hack: remove (char *) for char strings. Their
type is indicated by the quoted string anyway. */
- if (TYPE_CODE (type) == TYPE_CODE_PTR
+ if (TYPE_CODE (type) == TYPE_CODE_PTR
&& TYPE_NAME (type) == NULL
&& TYPE_NAME (TYPE_TARGET_TYPE (type)) != NULL
&& strcmp (TYPE_NAME (TYPE_TARGET_TYPE (type)), "char") == 0)
int
pascal_object_is_vtbl_ptr_type (struct type *type)
{
- char *typename = type_name_no_tag (type);
+ const char *typename = type_name_no_tag (type);
return (typename != NULL
&& strcmp (typename, pascal_vtbl_ptr_name) == 0);
{
int boffset = 0;
struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i));
- char *basename = type_name_no_tag (baseclass);
+ const char *basename = type_name_no_tag (baseclass);
const gdb_byte *base_valaddr = NULL;
int thisoffset;
volatile struct gdb_exception ex;