This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] Fix size check in dwarf2_evaluate_loc_desc_full


On 2017-05-29 18:25, Tom Tromey wrote:
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.

Your explanation sounds sensible to me (and the tests suggests it's good). Andreas, since you played with DWARF pieces quite a bit, do you have an opinion on this?

Would it be possible to test the error case as well by feeding bad DWARF info in the test case?

Thanks!

Simon


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]