blob: 4c26f259673da9fcc961eda6dac22b3d94c56d90 [file] [log] [blame]
Brad Bishopf6355e42020-12-08 14:30:50 -05001From bc2b702d7f73a231bd67c60465137fe37f67479a Mon Sep 17 00:00:00 2001
2From: Nathan Rossi <nathan.rossi@petalogix.com>
3Date: Tue, 8 May 2012 18:11:17 +1000
4Subject: [PATCH 35/52] Fix debug message when register is unavailable
5
6Signed-off-by: Nathan Rossi <nathan.rossi@petalogix.com>
7---
8 gdb/frame.c | 13 ++++++++++---
9 1 file changed, 10 insertions(+), 3 deletions(-)
10
11diff --git a/gdb/frame.c b/gdb/frame.c
12index ff27b9f00e..bf931b370c 100644
13--- a/gdb/frame.c
14+++ b/gdb/frame.c
15@@ -1263,12 +1263,19 @@ frame_unwind_register_value (frame_info *next_frame, int regnum)
16 else
17 {
18 int i;
19- const gdb_byte *buf = value_contents (value);
20+ const gdb_byte *buf = NULL;
21+ if (value_entirely_available(value)) {
22+ buf = value_contents (value);
23+ }
24
25 fprintf_unfiltered (gdb_stdlog, " bytes=");
26 fprintf_unfiltered (gdb_stdlog, "[");
27- for (i = 0; i < register_size (gdbarch, regnum); i++)
28- fprintf_unfiltered (gdb_stdlog, "%02x", buf[i]);
29+ if (buf != NULL) {
30+ for (i = 0; i < register_size (gdbarch, regnum); i++)
31+ fprintf_unfiltered (gdb_stdlog, "%02x", buf[i]);
32+ } else {
33+ fprintf_unfiltered (gdb_stdlog, "unavailable");
34+ }
35 fprintf_unfiltered (gdb_stdlog, "]");
36 }
37 }
38--
392.17.1
40