From d0b3a0f9f01d6dd6640247db0cd8a9d815c3e53c Mon Sep 17 00:00:00 2001 From: Mahesh Bodapati Date: Thu, 21 Jul 2022 11:45:01 +0530 Subject: [PATCH] microblaze: apply gdb patches from meta-xilinx repository This patchset fixes many known issues on gnu-toolchain for microblaze. But mainly the atomic-cas and binutils incorrect relocation issues. Patches obtained from https://github.com/Xilinx/meta-xilinx/blob/master/meta-microblaze/recipes-devtools/gdb/gdb Below is a list of patches applied and squashed after filtering out microblaze64 and microblaze-linux patches: 0008-Patch-MicroBlaze.patch Signed-off-by: Alp Sayin --- gdb/microblaze-tdep.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c index 3e8e8fe35b9f..0cdd2f253930 100644 --- a/gdb/microblaze-tdep.c +++ b/gdb/microblaze-tdep.c @@ -401,16 +401,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; } @@ -517,7 +509,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