gdbserver gnu/linux: stepping over breakpoint
[deliverable/binutils-gdb.git] / gdb / gdbserver / linux-low.c
index f2a2224601514833e615e76da8b45fe9f345bdd0..6dd922477d0a0cf4dca718a01d78dc810a426fe4 100644 (file)
@@ -148,6 +148,23 @@ ptid_of_lwp (struct lwp_info *lwp)
 
 /* See nat/linux-nat.h.  */
 
+void
+lwp_set_arch_private_info (struct lwp_info *lwp,
+                          struct arch_lwp_info *info)
+{
+  lwp->arch_private = info;
+}
+
+/* See nat/linux-nat.h.  */
+
+struct arch_lwp_info *
+lwp_arch_private_info (struct lwp_info *lwp)
+{
+  return lwp->arch_private;
+}
+
+/* See nat/linux-nat.h.  */
+
 int
 lwp_is_stopped (struct lwp_info *lwp)
 {
@@ -545,7 +562,7 @@ check_stopped_by_breakpoint (struct lwp_info *lwp)
                {
                  struct thread_info *thr = get_lwp_thread (lwp);
 
-                 debug_printf ("CSBB: Push back software breakpoint for %s\n",
+                 debug_printf ("CSBB: %s stopped by software breakpoint\n",
                                target_pid_to_str (ptid_of (thr)));
                }
 
@@ -568,8 +585,8 @@ check_stopped_by_breakpoint (struct lwp_info *lwp)
                {
                  struct thread_info *thr = get_lwp_thread (lwp);
 
-                 debug_printf ("CSBB: Push back hardware "
-                               "breakpoint/watchpoint for %s\n",
+                 debug_printf ("CSBB: %s stopped by hardware "
+                               "breakpoint/watchpoint\n",
                                target_pid_to_str (ptid_of (thr)));
                }
 
@@ -578,6 +595,16 @@ check_stopped_by_breakpoint (struct lwp_info *lwp)
              current_thread = saved_thread;
              return 1;
            }
+         else if (siginfo.si_code == TRAP_TRACE)
+           {
+             if (debug_threads)
+               {
+                 struct thread_info *thr = get_lwp_thread (lwp);
+
+                 debug_printf ("CSBB: %s stopped by trace\n",
+                               target_pid_to_str (ptid_of (thr)));
+               }
+           }
        }
     }
 #else
@@ -640,7 +667,7 @@ add_lwp (ptid_t ptid)
   memset (lwp, 0, sizeof (*lwp));
 
   if (the_low_target.new_thread != NULL)
-    lwp->arch_private = the_low_target.new_thread ();
+    the_low_target.new_thread (lwp);
 
   lwp->thread = add_thread (ptid, lwp);
 
@@ -2042,16 +2069,28 @@ linux_low_filter_event (int lwpid, int wstat)
        {
          /* We want to report the stop to the core.  Treat the
             SIGSTOP as a normal event.  */
+         if (debug_threads)
+           debug_printf ("LLW: resume_stop SIGSTOP caught for %s.\n",
+                         target_pid_to_str (ptid_of (thread)));
        }
       else if (stopping_threads != NOT_STOPPING_THREADS)
        {
          /* Stopping threads.  We don't want this SIGSTOP to end up
             pending.  */
+         if (debug_threads)
+           debug_printf ("LLW: SIGSTOP caught for %s "
+                         "while stopping threads.\n",
+                         target_pid_to_str (ptid_of (thread)));
          return NULL;
        }
       else
        {
-         /* Filter out the event.  */
+         /* This is a delayed SIGSTOP.  Filter out the event.  */
+         if (debug_threads)
+           debug_printf ("LLW: %s %s, 0, 0 (discard delayed SIGSTOP)\n",
+                         child->stepping ? "step" : "continue",
+                         target_pid_to_str (ptid_of (thread)));
+
          linux_resume_one_lwp (child, child->stepping, 0, NULL);
          return NULL;
        }
@@ -5076,7 +5115,9 @@ static int
 linux_insert_point (enum raw_bkpt_type type, CORE_ADDR addr,
                    int size, struct raw_breakpoint *bp)
 {
-  if (the_low_target.insert_point != NULL)
+  if (type == raw_bkpt_type_sw)
+    return insert_memory_breakpoint (bp);
+  else if (the_low_target.insert_point != NULL)
     return the_low_target.insert_point (type, addr, size, bp);
   else
     /* Unsupported (see target.h).  */
@@ -5087,7 +5128,9 @@ static int
 linux_remove_point (enum raw_bkpt_type type, CORE_ADDR addr,
                    int size, struct raw_breakpoint *bp)
 {
-  if (the_low_target.remove_point != NULL)
+  if (type == raw_bkpt_type_sw)
+    return remove_memory_breakpoint (bp);
+  else if (the_low_target.remove_point != NULL)
     return the_low_target.remove_point (type, addr, size, bp);
   else
     /* Unsupported (see target.h).  */
This page took 0.027956 seconds and 4 git commands to generate.