diff options
author | Tom de Vries <tdevries@suse.de> | 2024-02-26 15:31:34 +0100 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2024-02-26 15:31:34 +0100 |
commit | 2aaba7444679492ae9e2757d7d05ba63bd2ec3c7 (patch) | |
tree | 4c803b75164e38f742a7f3d884d2fda64c48a271 /gdb/frame.c | |
parent | 4a4fd10d1707424b9b13aa4af0cec7590c086ea0 (diff) | |
download | binutils-2aaba7444679492ae9e2757d7d05ba63bd2ec3c7.zip binutils-2aaba7444679492ae9e2757d7d05ba63bd2ec3c7.tar.gz binutils-2aaba7444679492ae9e2757d7d05ba63bd2ec3c7.tar.bz2 |
[gdb] Fix "value is not available" with debug frame
On arm-linux, with a started hello world, running "info frame" works fine, but
when I set debug frame to on, I run into:
...
(gdb) info frame
...
[frame] frame_unwind_register_value: exit
value is not available
(gdb)
...
The problem is here in frame_unwind_register_value:
...
if (value->lazy ())
gdb_printf (&debug_file, " lazy");
else
{
int i;
gdb::array_view<const gdb_byte> buf = value->contents ();
...
where we call value->contents () while !value->entirely_available ().
Fix this by checking value->entirely_available () and printing:
...
[frame] frame_unwind_register_value: -> register=91 unavailable
...
Tested on arm-linux.
PR gdb/31369
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31369
Diffstat (limited to 'gdb/frame.c')
-rw-r--r-- | gdb/frame.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gdb/frame.c b/gdb/frame.c index 9c3f0df..5c7aae9 100644 --- a/gdb/frame.c +++ b/gdb/frame.c @@ -1315,6 +1315,8 @@ frame_unwind_register_value (const frame_info_ptr &next_frame, int regnum) if (value->lazy ()) gdb_printf (&debug_file, " lazy"); + else if (!value->entirely_available ()) + gdb_printf (&debug_file, " unavailable"); else { int i; |