+2015-11-27  Yao Qi  <yao.qi@linaro.org>
+
+       * nat/aarch64-linux-hw-point.c (aarch64_dr_state_remove_one_point):
+       Don't assert on alignment.
+       (aarch64_handle_breakpoint): Only check alignment when IS_INSERT
+       is true.
+
 2015-11-27  Yao Qi  <yao.qi@linaro.org>
 
        * aarch64-tdep.c (is_hfa): Rename to ...
 
 
   /* Set up state pointers.  */
   is_watchpoint = (type != hw_execute);
-  gdb_assert (aarch64_point_is_aligned (is_watchpoint, addr, len));
   if (is_watchpoint)
     {
       num_regs = aarch64_num_wp_regs;
                           int len, int is_insert,
                           struct aarch64_debug_reg_state *state)
 {
-  /* The hardware breakpoint on AArch64 should always be 4-byte
-     aligned, but on AArch32, it can be 2-byte aligned.  */
-  if (!aarch64_point_is_aligned (0 /* is_watchpoint */ , addr, len))
-    return -1;
-
   if (is_insert)
-    return aarch64_dr_state_insert_one_point (state, type, addr, len);
+    {
+      /* The hardware breakpoint on AArch64 should always be 4-byte
+        aligned, but on AArch32, it can be 2-byte aligned.  Note that
+        we only check the alignment on inserting breakpoint because
+        aarch64_point_is_aligned needs the inferior_ptid inferior's
+        regcache to decide whether the inferior is 32-bit or 64-bit.
+        However when GDB follows the parent process and detach breakpoints
+        from child process, inferior_ptid is the child ptid, but the
+        child inferior doesn't exist in GDB's view yet.  */
+      if (!aarch64_point_is_aligned (0 /* is_watchpoint */ , addr, len))
+       return -1;
+
+      return aarch64_dr_state_insert_one_point (state, type, addr, len);
+    }
   else
     return aarch64_dr_state_remove_one_point (state, type, addr, len);
 }