This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Support for HWbreak/watchpoint accross fork/vfork on arm-native



On 13/02/2014 23:39, Pedro Alves wrote:
+static int
+update_registers_callback (struct lwp_info *lwp, void *arg)
+{
+  struct update_registers_data *data = (struct update_registers_data *) arg;
+
+  /* Force iterate_over_lwps to return matched lwp_info*.  */
+  if (arg == NULL)
+    return 1;
+
You don't seem to have addressed my comment here?  It was:

"I don't understand this.  It seems nothing passes a NULL arg."

I was using iterate_over_lwps to return matching lwp_info struct and that happens only when if update_registers_callback returns 1.
Its not being used anywhere now and can be removed.



    if (watchpoint)
      {
        count = arm_linux_get_hw_watchpoint_count ();
-      bpts = t->wpts;
-      dir = -1;
+      bpts = arm_linux_get_debug_reg_state (pid)->wpts;
+      if (count > MAX_WPTS)
+        warning (_("arm-linux-gdb supports %d hardware watchpoints but target \
+                 supports %d"), MAX_WPTS, count);
Like in the Aarch64 port, add a 'count = MAX_WPTS' as well, otherwise
GDB would access the arrays out of bounds when that happens.
OK will update and repost.

      }
    else
      {
        count = arm_linux_get_hw_breakpoint_count ();
-      bpts = t->bpts;
-      dir = 1;
+      bpts = arm_linux_get_debug_reg_state (pid)->bpts;
+      if (count > MAX_BPTS)
+        warning (_("arm-linux-gdb supports %d hardware breakpoints but target \
+                 supports %d"), MAX_BPTS, count);
Likewise.
OK will update and repost.

      }
for (i = 0; i < count; ++i)
      if (!arm_hwbp_control_is_enabled (bpts[i].control))


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]