diff options
author | David Taylor <dtaylor@emc.com> | 2016-04-12 15:02:57 -0400 |
---|---|---|
committer | David Taylor <david.taylor@emc.com> | 2016-06-24 21:02:36 -0400 |
commit | 6b8505468e64c2be8d0eea1f2b8db86fa3897600 (patch) | |
tree | 81de3154cfc05d9811239c11ef05cbb3a6fec06d /gdb/dwarf2loc.c | |
parent | e0204c4d4ceb9be0b0ccf8f92ab683aab54f67cd (diff) | |
download | gdb-6b8505468e64c2be8d0eea1f2b8db86fa3897600.zip gdb-6b8505468e64c2be8d0eea1f2b8db86fa3897600.tar.gz gdb-6b8505468e64c2be8d0eea1f2b8db86fa3897600.tar.bz2 |
Support structure offsets that are 512K or larger.
GDB computes structure byte offsets using a 32 bit integer. And,
first it computes the offset in bits and then converts to bytes. The
result is that any offset that if 512K bytes or larger overflows.
This patch changes GDB to use LONGEST for such calculations.
PR gdb/17520 Structure offset wrong when 1/4 GB or greater.
* c-lang.h: Change all parameters, variables, and struct or union
members used as struct or union fie3ld offsets from int to
LONGEST.
* c-valprint.c: Likewise.
* cp-abi.c: Likewise.
* cp-abi.h: Likewise.
* cp-valprint.c: Likewise.
* d-valprint.c: Likewise.
* dwarf2loc.c: Likewise.
* eval.c: Likewise.
* extension-priv.h: Likewise.
* extension.c: Likewise.
* extension.h: Likewise.
* findvar.c: Likewise.
* gdbtypes.h: Likewise.
* gnu-v2-abi.c: Likewise.
* gnu-v3-abi.c: Likewise.
* go-valprint.c: Likewise.
* guile/guile-internal.h: Likewise.
* guile/scm-pretty-print.c: Likewise.
* jv-valprint.c Likewise.
* opencl-lang.c: Likewise.
* p-lang.h: Likewise.
* python/py-prettyprint.c: Likewise.
* python/python-internal.h: Likewise.
* spu-tdep.c: Likewise.
* typeprint.c: Likewise.
* valarith.c: Likewise.
* valops.c: Likewise.
* valprint.c: Likewise.
* valprint.h: Likewise.
* value.c: Likewise.
* value.h: Likewise.
* p-valprint.c: Likewise.
* c-typeprint.c (c_type_print_base): When printing offset, use
plongest, not %d.
* gdbtypes.c (recursive_dump_type): Ditto.
Diffstat (limited to 'gdb/dwarf2loc.c')
-rw-r--r-- | gdb/dwarf2loc.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c index adb0ac2..548e468 100644 --- a/gdb/dwarf2loc.c +++ b/gdb/dwarf2loc.c @@ -1765,7 +1765,7 @@ read_pieced_value (struct value *v) struct gdbarch *arch = get_frame_arch (frame); int gdb_regnum = dwarf_reg_to_regnum_or_error (arch, p->v.regno); int optim, unavail; - int reg_offset = source_offset; + LONGEST reg_offset = source_offset; if (gdbarch_byte_order (arch) == BFD_ENDIAN_BIG && this_size < register_size (arch, gdb_regnum)) @@ -2016,7 +2016,7 @@ write_pieced_value (struct value *to, struct value *from) a synthetic pointer. */ static int -check_pieced_synthetic_pointer (const struct value *value, int bit_offset, +check_pieced_synthetic_pointer (const struct value *value, LONGEST bit_offset, int bit_length) { struct piece_closure *c @@ -2132,7 +2132,8 @@ indirect_pieced_value (struct value *value) struct type *type; struct frame_info *frame; struct dwarf2_locexpr_baton baton; - int i, bit_offset, bit_length; + int i, bit_length; + LONGEST bit_offset; struct dwarf_expr_piece *piece = NULL; LONGEST byte_offset; enum bfd_endian byte_order; |