gdb: add target_ops::supports_displaced_step
[deliverable/binutils-gdb.git] / gdb / microblaze-linux-tdep.c
index 2b07d95f7df658790fc6a3732e5b4f7d6adbd0e1..be710bedb649698210b15c9c16ab32ae1d7adb8d 100644 (file)
@@ -1,6 +1,6 @@
 /* Target-dependent code for Xilinx MicroBlaze.
 
-   Copyright 2009 Free Software Foundation, Inc.
+   Copyright (C) 2009-2020 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
 #include "trad-frame.h"
 #include "frame-unwind.h"
 #include "tramp-frame.h"
-
+#include "linux-tdep.h"
 
 static int
-microblaze_linux_memory_remove_breakpoint (struct bp_target_info *bp_tgt)
+microblaze_linux_memory_remove_breakpoint (struct gdbarch *gdbarch, 
+                                          struct bp_target_info *bp_tgt)
 {
-  CORE_ADDR addr = bp_tgt->placed_address;
+  CORE_ADDR addr = bp_tgt->reqstd_address;
   const gdb_byte *bp;
   int val;
   int bplen;
@@ -48,8 +49,6 @@ microblaze_linux_memory_remove_breakpoint (struct bp_target_info *bp_tgt)
 
   /* Determine appropriate breakpoint contents and size for this address.  */
   bp = gdbarch_breakpoint_from_pc (gdbarch, &addr, &bplen);
-  if (bp == NULL)
-    error (_("Software breakpoints not implemented for this target."));
 
   val = target_read_memory (addr, old_contents, bplen);
 
@@ -57,7 +56,7 @@ microblaze_linux_memory_remove_breakpoint (struct bp_target_info *bp_tgt)
      program modified the code on us, so it is wrong to put back the
      old value.  */
   if (val == 0 && memcmp (bp, old_contents, bplen) == 0)
-    val = target_write_memory (addr, bp_tgt->shadow_contents, bplen);
+    val = target_write_raw_memory (addr, bp_tgt->shadow_contents, bplen);
 
   return val;
 }
@@ -71,11 +70,9 @@ microblaze_linux_sigtramp_cache (struct frame_info *next_frame,
   CORE_ADDR base;
   CORE_ADDR gpregs;
   int regnum;
-  struct gdbarch *gdbarch = get_frame_arch (next_frame);
-  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
-  base = frame_unwind_register_unsigned (next_frame, SP_REGNUM);
-  if (bias > 0 && frame_pc_unwind (next_frame) != func)
+  base = frame_unwind_register_unsigned (next_frame, MICROBLAZE_SP_REGNUM);
+  if (bias > 0 && get_frame_address_in_block (next_frame) != func)
     /* See below, some signal trampolines increment the stack as their
        first instruction, need to compensate for that.  */
     base -= bias;
@@ -108,8 +105,8 @@ static struct tramp_frame microblaze_linux_sighandler_tramp_frame =
   SIGTRAMP_FRAME,
   4,
   {
-    { 0x31800077, -1 }, /* addik R12,R0,119.  */
-    { 0xb9cc0008, -1 }, /* brki R14,8.  */
+    { 0x31800077, ULONGEST_MAX }, /* addik R12,R0,119.  */
+    { 0xb9cc0008, ULONGEST_MAX }, /* brki R14,8.  */
     { TRAMP_SENTINEL_INSN },
   },
   microblaze_linux_sighandler_cache_init
@@ -120,7 +117,7 @@ static void
 microblaze_linux_init_abi (struct gdbarch_info info,
                           struct gdbarch *gdbarch)
 {
-  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+  linux_init_abi (info, gdbarch);
 
   set_gdbarch_memory_remove_breakpoint (gdbarch,
                                        microblaze_linux_memory_remove_breakpoint);
@@ -134,8 +131,9 @@ microblaze_linux_init_abi (struct gdbarch_info info,
                                &microblaze_linux_sighandler_tramp_frame);
 }
 
+void _initialize_microblaze_linux_tdep ();
 void
-_initialize_microblaze_linux_tdep (void)
+_initialize_microblaze_linux_tdep ()
 {
   gdbarch_register_osabi (bfd_arch_microblaze, 0, GDB_OSABI_LINUX, 
                          microblaze_linux_init_abi);
This page took 0.031896 seconds and 4 git commands to generate.