gdb: add target_ops::supports_displaced_step
[deliverable/binutils-gdb.git] / gdb / ia64-linux-nat.c
index ef70da5a97db344c979320ea62b55518d22e7cc9..8f36ea78e762ceeb3a44ceef113ce26ce478c5ed 100644 (file)
@@ -1,7 +1,7 @@
 /* Functions specific to running gdb native on IA-64 running
    GNU/Linux.
 
-   Copyright (C) 1999-2018 Free Software Foundation, Inc.
+   Copyright (C) 1999-2020 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -28,7 +28,7 @@
 
 #include <signal.h>
 #include "nat/gdb_ptrace.h"
-#include "gdb_wait.h"
+#include "gdbsupport/gdb_wait.h"
 #ifdef HAVE_SYS_REG_H
 #include <sys/reg.h>
 #endif
@@ -57,8 +57,6 @@ public:
                                        ULONGEST offset, ULONGEST len,
                                        ULONGEST *xfered_len) override;
 
-  const struct target_desc *read_description () override;
-
   /* Override watchpoint routines.  */
 
   /* The IA-64 architecture can step over a watch point (without
@@ -70,7 +68,7 @@ public:
      has determined that a hardware watchpoint has indeed been hit.
      The CPU will then be able to execute one instruction without
      triggering a watchpoint.  */
-  bool have_steppable_watchpoint () { return 1; }
+  bool have_steppable_watchpoint () override { return true; }
 
   int can_use_hw_breakpoint (enum bptype, int, int) override;
   bool stopped_by_watchpoint () override;
@@ -82,6 +80,8 @@ public:
   /* Override linux_nat_target low methods.  */
   void low_new_thread (struct lwp_info *lp) override;
   bool low_status_is_event (int status) override;
+
+  void enable_watchpoints_in_psr (ptid_t ptid);
 };
 
 static ia64_linux_nat_target the_ia64_linux_nat_target;
@@ -531,10 +531,10 @@ fill_fpregset (const struct regcache *regcache,
 #define IA64_PSR_DB (1UL << 24)
 #define IA64_PSR_DD (1UL << 39)
 
-static void
-enable_watchpoints_in_psr (ptid_t ptid)
+void
+ia64_linux_nat_target::enable_watchpoints_in_psr (ptid_t ptid)
 {
-  struct regcache *regcache = get_thread_regcache (ptid);
+  struct regcache *regcache = get_thread_regcache (this, ptid);
   ULONGEST psr;
 
   regcache_cooked_read_unsigned (regcache, IA64_PSR_REGNUM, &psr);
@@ -553,9 +553,9 @@ store_debug_register (ptid_t ptid, int idx, long val)
 {
   int tid;
 
-  tid = ptid_get_lwp (ptid);
+  tid = ptid.lwp ();
   if (tid == 0)
-    tid = ptid_get_pid (ptid);
+    tid = ptid.pid ();
 
   (void) ptrace (PT_WRITE_U, tid, (PTRACE_TYPE_ARG3) (PT_DBR + 8 * idx), val);
 }
@@ -672,8 +672,8 @@ ia64_linux_nat_target::remove_watchpoint (CORE_ADDR addr, int len,
   return -1;
 }
 
-static void
-ia64_linux_new_thread (struct lwp_info *lp)
+void
+ia64_linux_nat_target::low_new_thread (struct lwp_info *lp)
 {
   int i, any;
 
@@ -719,10 +719,9 @@ ia64_linux_nat_target::stopped_by_watchpoint ()
   return stopped_data_address (&addr);
 }
 
-static int
-ia64_linux_can_use_hw_breakpoint (struct target_ops *self,
-                                 enum bptype type,
-                                 int cnt, int othertype)
+int
+ia64_linux_nat_target::can_use_hw_breakpoint (enum bptype type,
+                                             int cnt, int othertype)
 {
   return 1;
 }
@@ -924,8 +923,9 @@ ia64_linux_nat_target::low_status_is_event (int status)
                                 || WSTOPSIG (status) == SIGILL);
 }
 
+void _initialize_ia64_linux_nat ();
 void
-_initialize_ia64_linux_nat (void)
+_initialize_ia64_linux_nat ()
 {
   /* Register the target.  */
   linux_target = &the_ia64_linux_nat_target;
This page took 0.025358 seconds and 4 git commands to generate.