Wrap gdb_agent_op_sizes by #ifndef IN_PROCESS_AGENT
[deliverable/binutils-gdb.git] / gdb / gdbserver / target.c
index 08506e516bceb384a1787ac2cb5d4eef15b0d6d7..17ff7a67cae3c07b80f3620ff9e635af72540034 100644 (file)
@@ -1,5 +1,5 @@
 /* Target operations for the remote server for GDB.
-   Copyright (C) 2002-2014 Free Software Foundation, Inc.
+   Copyright (C) 2002-2015 Free Software Foundation, Inc.
 
    Contributed by MontaVista Software.
 
@@ -23,8 +23,8 @@
 
 struct target_ops *the_target;
 
-void
-set_desired_inferior (int use_general)
+int
+set_desired_thread (int use_general)
 {
   struct thread_info *found;
 
@@ -33,10 +33,8 @@ set_desired_inferior (int use_general)
   else
     found = find_thread_ptid (cont_thread);
 
-  if (found == NULL)
-    current_inferior = get_first_thread ();
-  else
-    current_inferior = found;
+  current_thread = found;
+  return (current_thread != NULL);
 }
 
 int
@@ -134,6 +132,38 @@ mywait (ptid_t ptid, struct target_waitstatus *ourstatus, int options,
   return ret;
 }
 
+/* See target/target.h.  */
+
+void
+target_stop_and_wait (ptid_t ptid)
+{
+  struct target_waitstatus status;
+  int was_non_stop = non_stop;
+  struct thread_resume resume_info;
+
+  resume_info.thread = ptid;
+  resume_info.kind = resume_stop;
+  resume_info.sig = GDB_SIGNAL_0;
+  (*the_target->resume) (&resume_info, 1);
+
+  non_stop = 1;
+  mywait (ptid, &status, 0, 0);
+  non_stop = was_non_stop;
+}
+
+/* See target/target.h.  */
+
+void
+target_continue_no_signal (ptid_t ptid)
+{
+  struct thread_resume resume_info;
+
+  resume_info.thread = ptid;
+  resume_info.kind = resume_continue;
+  resume_info.sig = GDB_SIGNAL_0;
+  (*the_target->resume) (&resume_info, 1);
+}
+
 int
 start_non_stop (int nonstop)
 {
@@ -151,7 +181,7 @@ start_non_stop (int nonstop)
 void
 set_target_ops (struct target_ops *target)
 {
-  the_target = (struct target_ops *) xmalloc (sizeof (*the_target));
+  the_target = XNEW (struct target_ops);
   memcpy (the_target, target, sizeof (*the_target));
 }
 
@@ -186,3 +216,11 @@ kill_inferior (int pid)
 
   return (*the_target->kill) (pid);
 }
+
+/* Target can do hardware single step.  */
+
+int
+target_can_do_hardware_single_step (void)
+{
+  return 1;
+}
This page took 0.028467 seconds and 4 git commands to generate.