diff options
author | Andrew Burgess <andrew.burgess@embecosm.com> | 2021-05-12 13:44:06 +0100 |
---|---|---|
committer | Andrew Burgess <andrew.burgess@embecosm.com> | 2021-06-07 16:45:10 +0100 |
commit | a12a15e7c5ff9f3549dd185fa1acd5a9dddd001b (patch) | |
tree | 71278848c6d52c54c8d85799717efcb248721df9 /elfcpp/elfcpp_file.h | |
parent | ecac8d1c14acba1fd20b99c2481d0cab5887e3b7 (diff) | |
download | gdb-a12a15e7c5ff9f3549dd185fa1acd5a9dddd001b.zip gdb-a12a15e7c5ff9f3549dd185fa1acd5a9dddd001b.tar.gz gdb-a12a15e7c5ff9f3549dd185fa1acd5a9dddd001b.tar.bz2 |
gdb: handle case where type alignment is unknown
It was spotted that if type_align returned 0 then it was possible to
trigger a divide by zero exception within GDB. It turns out this will
only happen in an edge case where GDB is unable to figure out the
alignment of a field within a structure.
The attached test generates some non-standard, probably broken, DWARF,
that triggers this condition, and then fixes this issue by throwing an
exception when this case occurs.
gdb/ChangeLog:
PR gdb/27847
* amd64-tdep.c (amd64_has_unaligned_fields): Move call to
type_align, and spot case where the alignment is unknown.
gdb/testsuite/ChangeLog:
PR gdb/27847
* gdb.dwarf2/dw2-weird-type-len.c: New file.
* gdb.dwarf2/dw2-weird-type-len.exp: New file.
Diffstat (limited to 'elfcpp/elfcpp_file.h')
0 files changed, 0 insertions, 0 deletions