diff options
author | Tom Tromey <tromey@adacore.com> | 2021-05-17 13:07:25 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2021-05-17 13:07:25 -0600 |
commit | 9e541c7918c184aa226c1544159e37b6387ef205 (patch) | |
tree | 35029f718ccd907854a426de26697f110bb53070 /gdb/dwarf2 | |
parent | 591732169550b26608f186c9927f4cf9a47d99d5 (diff) | |
download | gdb-9e541c7918c184aa226c1544159e37b6387ef205.zip gdb-9e541c7918c184aa226c1544159e37b6387ef205.tar.gz gdb-9e541c7918c184aa226c1544159e37b6387ef205.tar.bz2 |
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.
Diffstat (limited to 'gdb/dwarf2')
-rw-r--r-- | gdb/dwarf2/loc.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c index aec50da..e816f92 100644 --- a/gdb/dwarf2/loc.c +++ b/gdb/dwarf2/loc.c @@ -785,6 +785,9 @@ public: its length in LENGTH. */ void get_frame_base (const gdb_byte **start, size_t * length) override { + if (frame == nullptr) + error (_("frame address is not available.")); + /* FIXME: cagney/2003-03-26: This code should be using get_frame_base_address(), and then implement a dwarf2 specific this_base method. */ |