X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fcp-valprint.c;h=49d71a4480a3170da0890add3b44e448310a60a2;hb=e17a4113357102b55cfa5b80557d590a46a43300;hp=d264b40e25b64e7decf3e2919428eb0f95a86647;hpb=5af949e350b923403600c1da34774b49a77c925c;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c index d264b40e25..49d71a4480 100644 --- a/gdb/cp-valprint.c +++ b/gdb/cp-valprint.c @@ -564,13 +564,17 @@ void 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