aboutsummaryrefslogtreecommitdiff
path: root/libiberty/objalloc.c
diff options
context:
space:
mode:
authorAndreas Arnez <arnez@linux.vnet.ibm.com>2017-06-13 15:20:30 +0200
committerAndreas Arnez <arnez@linux.vnet.ibm.com>2017-06-13 15:20:30 +0200
commit03c8af18d1a8f359fd023696848bda488119da60 (patch)
treef1fe1a485db241dfd1cf7dbe5c5268da065661c9 /libiberty/objalloc.c
parent840989c113433c069f54872d7e051e1572202326 (diff)
downloadgdb-03c8af18d1a8f359fd023696848bda488119da60.zip
gdb-03c8af18d1a8f359fd023696848bda488119da60.tar.gz
gdb-03c8af18d1a8f359fd023696848bda488119da60.tar.bz2
Fix handling of DWARF register pieces on big-endian targets
For big-endian targets the logic in read/write_pieced_value tries to take a register piece from the LSB end. This requires offsets and sizes to be adjusted accordingly, and that's where the current implementation has some issues: * The formulas for recalculating the bit- and byte-offsets into the register are wrong. They just happen to yield correct results if everything is byte-aligned and the piece's last byte belongs to the given value. * After recalculating the bit offset into the register, the number of bytes to be copied from the register is not recalculated. Of course this does not matter if everything (particularly the piece size) is byte-aligned. These issues are fixed. The size calculation is performed with a new helper function bits_to_bytes(). gdb/ChangeLog: * dwarf2loc.c (bits_to_bytes): New function. (read_pieced_value): Fix offset calculations for register pieces on big-endian targets. (write_pieced_value): Likewise. gdb/testsuite/ChangeLog: * gdb.dwarf2/var-access.exp: Add test for non-byte-aligned register pieces.
Diffstat (limited to 'libiberty/objalloc.c')
0 files changed, 0 insertions, 0 deletions