From 0532b1db08b9d8efc670f7288fe2d8168b8ed0d1 Mon Sep 17 00:00:00 2001
From: Mahesh Bodapati <mbodapat@xilinx.com>
Date: Thu, 21 Jul 2022 11:45:01 +0530
Subject: [PATCH 8/8] =?UTF-8?q?[Patch,MicroBlaze]:=20Depth:=20=20Total=20n?=
 =?UTF-8?q?umber=20of=20inline=20functions=20[refer=20inline-frame.c]=20st?=
 =?UTF-8?q?ate->skipped=5Fframes=20:=20Number=20of=20inline=20functions=20?=
 =?UTF-8?q?skipped.=20the=20current=20unwind=5Fpc=20is=20causing=20an=20is?=
 =?UTF-8?q?sue=20when=20we=20try=20to=20step=20into=20inline=20functions[D?=
 =?UTF-8?q?epth=20is=20becoming=200].=20It=E2=80=99s=20incrementing=20pc?=
 =?UTF-8?q?=20by=208=20even=20with=20si=20instruction.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 gdb/microblaze-tdep.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c
index d83072cdaef..38ba38e8c7d 100644
--- a/gdb/microblaze-tdep.c
+++ b/gdb/microblaze-tdep.c
@@ -513,16 +513,8 @@ microblaze_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc,
 static CORE_ADDR
 microblaze_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
 {
-  gdb_byte buf[4];
   CORE_ADDR pc;
-
-  frame_unwind_register (next_frame, MICROBLAZE_PC_REGNUM, buf);
-  pc = extract_typed_address (buf, builtin_type (gdbarch)->builtin_func_ptr);
-  /* For sentinel frame, return address is actual PC.  For other frames,
-     return address is pc+8.  This is a workaround because gcc does not
-     generate correct return address in CIE.  */
-  if (frame_relative_level (next_frame) >= 0)
-    pc += 8;
+  pc=frame_unwind_register_unsigned (next_frame, MICROBLAZE_PC_REGNUM);
   return pc;
 }
 
@@ -553,7 +545,6 @@ microblaze_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc)
   ostart_pc = microblaze_analyze_prologue (gdbarch, func_start, 0xffffffffUL, 
 					   &cache);
 
-
   if (ostart_pc > start_pc)
     return ostart_pc;
   return start_pc;
@@ -660,7 +651,8 @@ static const struct frame_unwind microblaze_frame_unwind =
   microblaze_frame_this_id,
   microblaze_frame_prev_register,
   NULL,
-  default_frame_sniffer
+  default_frame_sniffer,
+  NULL,
 };
 
 static CORE_ADDR
-- 
2.37.1 (Apple Git-137.1)

