#include "valprint.h"
#include "cp-support.h"
#include "language.h"
+#include "python/python.h"
/* Controls printing of vtbl's */
static void
if (skip >= 1)
fprintf_filtered (stream, "<invalid address>");
else
- cp_print_value_fields (baseclass, thistype, base_valaddr,
- thisoffset + boffset, address + boffset,
- stream, recurse, options,
- ((struct type **)
- obstack_base (&dont_print_vb_obstack)),
- 0);
+ {
+ int result = 0;
+
+ /* Attempt to run the Python pretty-printers on the
+ baseclass if possible. */
+ if (!options->raw)
+ result = apply_val_pretty_printer (baseclass, base_valaddr,
+ thisoffset + boffset,
+ address + boffset,
+ stream, recurse,
+ options,
+ current_language);
+
+ if (!result)
+ cp_print_value_fields (baseclass, thistype, base_valaddr,
+ thisoffset + boffset, address + boffset,
+ stream, recurse, options,
+ ((struct type **)
+ obstack_base (&dont_print_vb_obstack)),
+ 0);
+ }
fputs_filtered (", ", stream);
flush_it:
if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
{
CORE_ADDR *first_dont_print;
+ CORE_ADDR addr;
int i;
first_dont_print
while (--i >= 0)
{
- if (VALUE_ADDRESS (val) == first_dont_print[i])
+ if (value_address (val) == first_dont_print[i])
{
fputs_filtered ("<same as static member of an already"
" seen type>",
}
}
- obstack_grow (&dont_print_statmem_obstack, (char *) &VALUE_ADDRESS (val),
+ addr = value_address (val);
+ obstack_grow (&dont_print_statmem_obstack, (char *) &addr,
sizeof (CORE_ADDR));
CHECK_TYPEDEF (type);
cp_print_value_fields (type, type, value_contents_all (val),
- value_embedded_offset (val), VALUE_ADDRESS (val),
+ value_embedded_offset (val), addr,
stream, recurse, options, NULL, 1);
return;
}
opts = *options;
opts.deref_ref = 0;
val_print (type, value_contents_all (val),
- value_embedded_offset (val), VALUE_ADDRESS (val),
+ value_embedded_offset (val), value_address (val),
stream, recurse, &opts, current_language);
}
cp_print_class_member (const gdb_byte *valaddr, struct type *type,
struct ui_file *stream, char *prefix)
{
+ enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (type));
+
/* VAL is a byte offset into the structure type DOMAIN.
Find the name of the field for that offset and
print it. */
struct type *domain = TYPE_DOMAIN_TYPE (type);
- LONGEST val = extract_signed_integer (valaddr, TYPE_LENGTH (type));
+ LONGEST val;
unsigned int fieldno;
+ val = extract_signed_integer (valaddr, TYPE_LENGTH (type), byte_order);
+
/* Pointers to data members are usually byte offsets into an object.
Because a data member can have offset zero, and a NULL pointer to
member must be distinct from any valid non-NULL pointer to