aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2021-05-17 13:07:25 -0600
committerTom Tromey <tromey@adacore.com>2021-05-17 13:07:25 -0600
commit9e541c7918c184aa226c1544159e37b6387ef205 (patch)
tree35029f718ccd907854a426de26697f110bb53070 /gdb/dwarf2
parent591732169550b26608f186c9927f4cf9a47d99d5 (diff)
downloadgdb-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.c3
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. */