summaryrefslogtreecommitdiffstats
path: root/recipes-devtools/gdb/files/0013-microblaze-Handle-framless-functions-in-determining-.patch
blob: 70dcbe4391dfadfd192de135fd80377d52d08ba3 (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
From: David Holsgrove <david.holsgrove@xilinx.com>
Date: Thu, 7 Nov 2013 16:58:48 +1000
Subject: microblaze: Handle framless functions in determining
 prev reg

Add check for cache->frameless_p in microblaze_frame_prev_register
to handle frameless functions, and correct the behaviour of using
'next' to step through debugging

Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
Signed-off-by: Nagaraju Mekala <nagaraju.mekala@xilinx.com>
Upstream-Status: Pending
---
 gdb/microblaze-tdep.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c
index f4b48a6..a85adea6 100644
--- a/gdb/microblaze-tdep.c
+++ b/gdb/microblaze-tdep.c
@@ -577,6 +577,16 @@ microblaze_frame_prev_register (struct frame_info *this_frame,
      return frame_unwind_got_constant (this_frame, regnum,
                                        cache->register_offsets[MICROBLAZE_SP_REGNUM]);
 
+  if (cache->frameless_p)
+    {
+      if (regnum == MICROBLAZE_PC_REGNUM)
+        regnum = 15;
+      if (regnum == MICROBLAZE_SP_REGNUM)
+        regnum = 1;
+      return trad_frame_get_prev_register (this_frame,
+            cache->saved_regs, regnum);
+    }
+
   if (regnum == MICROBLAZE_PC_REGNUM)
     {
       regnum = 15;
-- 
1.7.9.5