aboutsummaryrefslogtreecommitdiffstats
path: root/meta-microblaze/recipes-devtools/gdb/gdb/0003-Fix-debug-message-when-register-is-unavailable.patch
blob: d8ba6fca4e556e6da8f81eae2ad3b2e6c16da665 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
From 6ecb1de66a6a5f55e69c9b108a3d5a85b0ebf315 Mon Sep 17 00:00:00 2001
From: Nathan Rossi <nathan.rossi@petalogix.com>
Date: Tue, 8 May 2012 18:11:17 +1000
Subject: [PATCH 3/8] Fix debug message when register is unavailable

Upstream-Status: Pending

Signed-off-by: Nathan Rossi <nathan.rossi@petalogix.com>

Conflicts:
	gdb/frame.c
---
 gdb/frame.c | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/gdb/frame.c b/gdb/frame.c
index ce95cf8343b..c49ab9feab2 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -1261,13 +1261,20 @@ frame_unwind_register_value (frame_info *next_frame, int regnum)
 	  else
 	    {
 	      int i;
-	      gdb::array_view<const gdb_byte> buf = value_contents (value);
-
-	      fprintf_unfiltered (&debug_file, " bytes=");
-	      fprintf_unfiltered (&debug_file, "[");
-	      for (i = 0; i < register_size (gdbarch, regnum); i++)
-		fprintf_unfiltered (&debug_file, "%02x", buf[i]);
-	      fprintf_unfiltered (&debug_file, "]");
+	      const gdb_byte *buf = NULL;
+	      if (value_entirely_available(value)) {
+	        gdb::array_view<const gdb_byte> buf = value_contents (value);
+	      }
+
+	      fprintf_unfiltered (gdb_stdlog, " bytes=");
+	      fprintf_unfiltered (gdb_stdlog, "[");
+	      if (buf != NULL) {
+	        for (i = 0; i < register_size (gdbarch, regnum); i++)
+		  fprintf_unfiltered (gdb_stdlog, "%02x", buf[i]);
+	      } else {
+	        fprintf_unfiltered (gdb_stdlog, "unavailable");
+	      }
+	      fprintf_unfiltered (gdb_stdlog, "]");
 	    }
 	}
 
-- 
2.37.1 (Apple Git-137.1)