This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug gdb/21226] DW_OP_stack_value pieces yield wrong data on big-endian targets
- From: "cvs-commit at gcc dot gnu.org" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Tue, 13 Jun 2017 13:22:45 +0000
- Subject: [Bug gdb/21226] DW_OP_stack_value pieces yield wrong data on big-endian targets
- Auto-submitted: auto-generated
- References: <bug-21226-4717@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=21226
--- Comment #4 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Andreas Arnez <arnez@sourceware.org>:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e93523245b704bc126705620969b4736b00350c5
commit e93523245b704bc126705620969b4736b00350c5
Author: Andreas Arnez <arnez@linux.vnet.ibm.com>
Date: Tue Jun 13 15:20:26 2017 +0200
PR gdb/21226: Take DWARF stack value pieces from LSB end
When taking a DW_OP_piece or DW_OP_bit_piece from a DW_OP_stack_value, the
existing logic always takes the piece from the lowest-addressed end, which
is wrong on big-endian targets. The DWARF standard states that the
"DW_OP_bit_piece operation describes a sequence of bits using the least
significant bits of that value", and this also matches the current logic
in GCC. For instance, the GCC guality test case pr54970.c fails on s390x
because of this.
This fix adjusts the piece accordingly on big-endian targets. It is
assumed that:
* DW_OP_piece shall take the piece from the LSB end as well;
* pieces reaching outside the stack value bits are considered undefined,
and a zero value can be used instead.
gdb/ChangeLog:
PR gdb/21226
* dwarf2loc.c (read_pieced_value): Anchor stack value pieces at
the LSB end, independent of endianness.
gdb/testsuite/ChangeLog:
PR gdb/21226
* gdb.dwarf2/nonvar-access.exp: Add checks for verifying that
stack value pieces are taken from the LSB end.
--
You are receiving this mail because:
You are on the CC list for the bug.