MSP430 Assembler: Leave placement of .lower and .upper sections to generic linker...
[deliverable/binutils-gdb.git] / gdb / arm-linux-nat.c
index e4622b040762382d430dfc05124bb4ef1e836831..52668da9fcf058efa4ca1c4bb05e9d836a9805fc 100644 (file)
@@ -38,6 +38,7 @@
 #include <sys/procfs.h>
 
 #include "nat/linux-ptrace.h"
+#include "linux-tdep.h"
 
 /* Prototypes for supply_gregset etc.  */
 #include "gregset.h"
@@ -533,7 +534,7 @@ ps_get_thread_area (struct ps_prochandle *ph,
 const struct target_desc *
 arm_linux_nat_target::read_description ()
 {
-  CORE_ADDR arm_hwcap = 0;
+  CORE_ADDR arm_hwcap = linux_get_hwcap (this);
 
   if (have_ptrace_getregset == TRIBOOL_UNKNOWN)
     {
@@ -551,11 +552,6 @@ arm_linux_nat_target::read_description ()
        have_ptrace_getregset = TRIBOOL_TRUE;
     }
 
-  if (target_auxv_search (this, AT_HWCAP, &arm_hwcap) != 1)
-    {
-      return this->beneath ()->read_description ();
-    }
-
   if (arm_hwcap & HWCAP_IWMMXT)
     return tdesc_arm_with_iwmmxt;
 
@@ -952,26 +948,18 @@ arm_linux_hw_breakpoint_equal (const struct arm_linux_hw_breakpoint *p1,
 /* Callback to mark a watch-/breakpoint to be updated in all threads of
    the current process.  */
 
-struct update_registers_data
-{
-  int watch;
-  int index;
-};
-
 static int
-update_registers_callback (struct lwp_info *lwp, void *arg)
+update_registers_callback (struct lwp_info *lwp, int watch, int index)
 {
-  struct update_registers_data *data = (struct update_registers_data *) arg;
-
   if (lwp->arch_private == NULL)
     lwp->arch_private = XCNEW (struct arch_lwp_info);
 
   /* The actual update is done later just before resuming the lwp,
      we just mark that the registers need updating.  */
-  if (data->watch)
-    lwp->arch_private->wpts_changed[data->index] = 1;
+  if (watch)
+    lwp->arch_private->wpts_changed[index] = 1;
   else
-    lwp->arch_private->bpts_changed[data->index] = 1;
+    lwp->arch_private->bpts_changed[index] = 1;
 
   /* If the lwp isn't stopped, force it to momentarily pause, so
      we can update its breakpoint registers.  */
@@ -991,7 +979,6 @@ arm_linux_insert_hw_breakpoint1 (const struct arm_linux_hw_breakpoint* bpt,
   ptid_t pid_ptid;
   gdb_byte count, i;
   struct arm_linux_hw_breakpoint* bpts;
-  struct update_registers_data data;
 
   pid = inferior_ptid.pid ();
   pid_ptid = ptid_t (pid);
@@ -1010,10 +997,13 @@ arm_linux_insert_hw_breakpoint1 (const struct arm_linux_hw_breakpoint* bpt,
   for (i = 0; i < count; ++i)
     if (!arm_hwbp_control_is_enabled (bpts[i].control))
       {
-        data.watch = watchpoint;
-        data.index = i;
         bpts[i] = *bpt;
-        iterate_over_lwps (pid_ptid, update_registers_callback, &data);
+        iterate_over_lwps (pid_ptid,
+                          [=] (struct lwp_info *info)
+                          {
+                            return update_registers_callback (info, watchpoint,
+                                                              i);
+                          });
         break;
       }
 
@@ -1030,7 +1020,6 @@ arm_linux_remove_hw_breakpoint1 (const struct arm_linux_hw_breakpoint *bpt,
   gdb_byte count, i;
   ptid_t pid_ptid;
   struct arm_linux_hw_breakpoint* bpts;
-  struct update_registers_data data;
 
   pid = inferior_ptid.pid ();
   pid_ptid = ptid_t (pid);
@@ -1049,10 +1038,13 @@ arm_linux_remove_hw_breakpoint1 (const struct arm_linux_hw_breakpoint *bpt,
   for (i = 0; i < count; ++i)
     if (arm_linux_hw_breakpoint_equal (bpt, bpts + i))
       {
-        data.watch = watchpoint;
-        data.index = i;
         bpts[i].control = arm_hwbp_control_disable (bpts[i].control);
-        iterate_over_lwps (pid_ptid, update_registers_callback, &data);
+       iterate_over_lwps (pid_ptid,
+                          [=] (struct lwp_info *info)
+                          {
+                            return update_registers_callback (info, watchpoint,
+                                                              i);
+                          });
         break;
       }
 
This page took 0.025543 seconds and 4 git commands to generate.