Avoid crash with GCC trunk
authorTom Tromey <tromey@adacore.com>
Mon, 17 May 2021 19:07:25 +0000 (13:07 -0600)
committerTom Tromey <tromey@adacore.com>
Mon, 17 May 2021 19:07:25 +0000 (13:07 -0600)
commit9e541c7918c184aa226c1544159e37b6387ef205
tree35029f718ccd907854a426de26697f110bb53070
parent591732169550b26608f186c9927f4cf9a47d99d5
Avoid crash with GCC trunk

With GCC trunk, gdb.ada/access_to_packed_array.exp causes a GDB crash.
The problem is that ptype tries to resolve a dynamic type.  However,
the inferior is not running, so there are no frames.

This patch updates dwarf2_evaluate_loc_desc::get_frame_base to handle
this situation.

gdb/ChangeLog
2021-05-17  Tom Tromey  <tromey@adacore.com>

* dwarf2/loc.c (dwarf2_evaluate_loc_desc::get_frame_base): Throw
if frame is null.
gdb/ChangeLog
gdb/dwarf2/loc.c