]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gdb/testsuite/ChangeLog
Fix size check in dwarf2_evaluate_loc_desc_full
authorTom Tromey <tom@tromey.com>
Sun, 28 May 2017 14:06:54 +0000 (08:06 -0600)
committerTom Tromey <tom@tromey.com>
Sun, 9 Jul 2017 16:46:49 +0000 (10:46 -0600)
commit0327869232a2f447474306a4d88214324d8abd40
tree816c0a96acba61464c8df452677f1d6ddb00f9ef
parentf4db828807aa2ad2279b6afa582c64bb5e3153d5
Fix size check in dwarf2_evaluate_loc_desc_full

This Rust bug report:

https://github.com/rust-lang/rust/issues/41970

noted an error from gdb.  What is happening here (for me, the original
report had a different error) is that a pieced DWARF expression is not
writing to every byte in the resulting value.  GDB errors in this
case.  However, it seems to me that it is always valid to write fewer
bytes; the issue comes from writing too many -- that is, the test is
reversed.  The test was also checking the sub-object, but this also
seems incorrect, as it's expected for the expression to write the
entirety of the enclosing object.  So, this patch reverses the test
and applies it to the outer type, not the subobject type.

Regtested on the buildbot.

gdb/ChangeLog
2017-07-09  Tom Tromey  <tom@tromey.com>

* dwarf2loc.c (dwarf2_evaluate_loc_desc_full): Reverse size
check and apply to outer type.

gdb/testsuite/ChangeLog
2017-07-09  Tom Tromey  <tom@tromey.com>

* gdb.dwarf2/shortpiece.exp: New file.
gdb/ChangeLog
gdb/dwarf2loc.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.dwarf2/shortpiece.exp [new file with mode: 0644]