* linux-low.c (linux_resume): Take a struct thread_resume *
[deliverable/binutils-gdb.git] / gdb / gdbserver / target.h
index 094f4ce4354cd5c8a16d6622bb722edce08d5134..aa0a44afd61a317feb50917e01800346b18de3d8 100644 (file)
 #ifndef TARGET_H
 #define TARGET_H
 
+/* This structure describes how to resume a particular thread (or
+   all threads) based on the client's request.  If thread is -1, then
+   this entry applies to all threads.  These are generally passed around
+   as an array, and terminated by a thread == -1 entry.  */
+
+struct thread_resume
+{
+  int thread;
+
+  /* If non-zero, leave this thread stopped.  */
+  int leave_stopped;
+
+  /* If non-zero, we want to single-step.  */
+  int step;
+
+  /* If non-zero, send this signal when we resume.  */
+  int sig;
+};
+
 struct target_ops
 {
   /* Start a new process.
@@ -32,7 +51,7 @@ struct target_ops
      ARGS is a standard NULL-terminated array of arguments,
      to be passed to the inferior as ``argv''.
 
-     Returns 0 on success, -1 on failure.  Registers the new
+     Returns the new PID on success, -1 on failure.  Registers the new
      process with the process list.  */
 
   int (*create_inferior) (char *program, char **args);
@@ -48,18 +67,17 @@ struct target_ops
 
   void (*kill) (void);
 
-  /* Return 1 iff the thread with process ID PID is alive.  */
+  /* Detach from all inferiors.  */
 
-  int (*thread_alive) (int pid);
+  void (*detach) (void);
 
-  /* Resume the inferior process.
+  /* Return 1 iff the thread with process ID PID is alive.  */
 
-     If STEP is non-zero, we want to single-step.
+  int (*thread_alive) (int pid);
 
-     If SIGNAL is nonzero, send the process that signal as we resume it.
-   */
+  /* Resume the inferior process.  */
 
-  void (*resume) (int step, int signo);
+  void (*resume) (struct thread_resume *resume_info);
 
   /* Wait for the inferior process to change state.
 
@@ -81,19 +99,32 @@ struct target_ops
 
   void (*store_registers) (int regno);
 
-  /* Read memory from the inferior process.
+  /* Read memory from the inferior process.  This should generally be
+     called through read_inferior_memory, which handles breakpoint shadowing.
 
      Read LEN bytes at MEMADDR into a buffer at MYADDR.  */
 
   void (*read_memory) (CORE_ADDR memaddr, char *myaddr, int len);
 
-  /* Write memory to the inferior process.
+  /* Write memory to the inferior process.  This should generally be
+     called through write_inferior_memory, which handles breakpoint shadowing.
 
      Write LEN bytes from the buffer at MYADDR to MEMADDR.
 
      Returns 0 on success and errno on failure.  */
 
-  int (*write_memory) (CORE_ADDR memaddr, char *myaddr, int len);
+  int (*write_memory) (CORE_ADDR memaddr, const char *myaddr, int len);
+
+  /* Query GDB for the values of any symbols we're interested in.
+     This function is called whenever we receive a "qSymbols::"
+     query, which corresponds to every time more symbols (might)
+     become available.  NULL if we aren't interested in any
+     symbols.  */
+
+  void (*look_up_symbols) (void);
+
+  /* Send a signal to the inferior process, however is appropriate.  */
+  void (*send_signal) (int);
 };
 
 extern struct target_ops *the_target;
@@ -109,25 +140,24 @@ void set_target_ops (struct target_ops *);
 #define kill_inferior() \
   (*the_target->kill) ()
 
+#define detach_inferior() \
+  (*the_target->detach) ()
+
 #define mythread_alive(pid) \
   (*the_target->thread_alive) (pid)
 
-#define myresume(step,signo) \
-  (*the_target->resume) (step, signo)
-
-#define mywait(statusp) \
-  (*the_target->wait) (statusp)
-
 #define fetch_inferior_registers(regno) \
   (*the_target->fetch_registers) (regno)
 
 #define store_inferior_registers(regno) \
   (*the_target->store_registers) (regno)
 
-#define read_inferior_memory(memaddr,myaddr,len) \
-  (*the_target->read_memory) (memaddr, myaddr, len)
+unsigned char mywait (char *statusp, int connected_wait);
+
+void read_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len);
+
+int write_inferior_memory (CORE_ADDR memaddr, const char *myaddr, int len);
 
-#define write_inferior_memory(memaddr,myaddr,len) \
-  (*the_target->write_memory) (memaddr, myaddr, len)
+void set_desired_inferior (int id);
 
 #endif /* TARGET_H */
This page took 0.029422 seconds and 4 git commands to generate.