aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2loc.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2011-08-08 21:41:14 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2011-08-08 21:41:14 +0000
commitb6cede7829a76495f4f491e74be169b41e100975 (patch)
tree963c0e628d5d110c1b56e165efc85e1adc0ae496 /gdb/dwarf2loc.c
parent3c542bc3125684eb36fb767376bf7c402b70750d (diff)
downloadgdb-b6cede7829a76495f4f491e74be169b41e100975.zip
gdb-b6cede7829a76495f4f491e74be169b41e100975.tar.gz
gdb-b6cede7829a76495f4f491e74be169b41e100975.tar.bz2
gdb/
* dwarf2loc.c (dwarf2_evaluate_loc_desc_full) <DWARF_VALUE_STACK> (dwarf2_evaluate_loc_desc_full) <DWARF_VALUE_LITERAL>: New variable objfile_gdbarch. Fix BFD_ENDIAN_BIG case. gdb/testsuite/ * gdb.dwarf2/dw2-op-stack-value.S: New file. * gdb.dwarf2/dw2-op-stack-value.exp: New file.
Diffstat (limited to 'gdb/dwarf2loc.c')
-rw-r--r--gdb/dwarf2loc.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
index 8ecc688..41891bb 100644
--- a/gdb/dwarf2loc.c
+++ b/gdb/dwarf2loc.c
@@ -1232,7 +1232,13 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
retval = allocate_value (type);
contents = value_contents_raw (retval);
if (n > TYPE_LENGTH (type))
- n = TYPE_LENGTH (type);
+ {
+ struct gdbarch *objfile_gdbarch = get_objfile_arch (objfile);
+
+ if (gdbarch_byte_order (objfile_gdbarch) == BFD_ENDIAN_BIG)
+ val_bytes += n - TYPE_LENGTH (type);
+ n = TYPE_LENGTH (type);
+ }
memcpy (contents, val_bytes, n);
}
break;
@@ -1254,7 +1260,13 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
n -= byte_offset;
if (n > TYPE_LENGTH (type))
- n = TYPE_LENGTH (type);
+ {
+ struct gdbarch *objfile_gdbarch = get_objfile_arch (objfile);
+
+ if (gdbarch_byte_order (objfile_gdbarch) == BFD_ENDIAN_BIG)
+ ldata += n - TYPE_LENGTH (type);
+ n = TYPE_LENGTH (type);
+ }
memcpy (contents, ldata, n);
}
break;