diff options
Diffstat (limited to 'gdb/gdbserver/target.h')
-rw-r--r-- | gdb/gdbserver/target.h | 51 |
1 files changed, 30 insertions, 21 deletions
diff --git a/gdb/gdbserver/target.h b/gdb/gdbserver/target.h index b7156fdd34d..7ff38493ea3 100644 --- a/gdb/gdbserver/target.h +++ b/gdb/gdbserver/target.h @@ -43,7 +43,7 @@ enum resume_kind struct thread_resume { - unsigned long thread; + ptid_t thread; /* How to "resume". */ enum resume_kind kind; @@ -96,7 +96,7 @@ struct target_waitstatus { int integer; enum target_signal sig; - unsigned long related_pid; + ptid_t related_pid; char *execd_pathname; } value; @@ -129,31 +129,38 @@ struct target_ops int (*attach) (unsigned long pid); - /* Kill all inferiors. */ + /* Kill inferior PID. Return -1 on failure, and 0 on success. */ - void (*kill) (void); + int (*kill) (int pid); - /* Detach from all inferiors. - Return -1 on failure, and 0 on success. */ + /* Detach from inferior PID. Return -1 on failure, and 0 on + success. */ - int (*detach) (void); + int (*detach) (int pid); - /* Wait for inferiors to end. */ - - void (*join) (void); + /* Wait for inferior PID to exit. */ + void (*join) (int pid); /* Return 1 iff the thread with process ID PID is alive. */ - int (*thread_alive) (unsigned long pid); + int (*thread_alive) (ptid_t pid); /* Resume the inferior process. */ void (*resume) (struct thread_resume *resume_info, size_t n); /* Wait for the inferior process or thread to change state. Store - status through argument pointer STATUS. */ + status through argument pointer STATUS. + + PTID = -1 to wait for any pid to do something, PTID(pid,0,0) to + wait for any thread of process pid to do something. Return ptid + of child, or -1 in case of error; store status through argument + pointer STATUS. OPTIONS is a bit set of options defined as + TARGET_W* above. If options contains TARGET_WNOHANG and there's + no child stop to report, return is + null_ptid/TARGET_WAITKIND_IGNORE. */ - unsigned long (*wait) (struct target_waitstatus *status, int options); + ptid_t (*wait) (ptid_t ptid, struct target_waitstatus *status, int options); /* Fetch registers from the inferior process. @@ -280,11 +287,11 @@ void set_target_ops (struct target_ops *); #define myattach(pid) \ (*the_target->attach) (pid) -#define kill_inferior() \ - (*the_target->kill) () +#define kill_inferior(pid) \ + (*the_target->kill) (pid) -#define detach_inferior() \ - (*the_target->detach) () +#define detach_inferior(pid) \ + (*the_target->detach) (pid) #define mythread_alive(pid) \ (*the_target->thread_alive) (pid) @@ -295,8 +302,8 @@ void set_target_ops (struct target_ops *); #define store_inferior_registers(regno) \ (*the_target->store_registers) (regno) -#define join_inferior() \ - (*the_target->join) () +#define join_inferior(pid) \ + (*the_target->join) (pid) #define target_supports_non_stop() \ (the_target->supports_non_stop ? (*the_target->supports_non_stop ) () : 0) @@ -308,8 +315,8 @@ void set_target_ops (struct target_ops *); int start_non_stop (int nonstop); -unsigned long mywait (struct target_waitstatus *ourstatus, int options, - int connected_wait); +ptid_t mywait (ptid_t ptid, struct target_waitstatus *ourstatus, int options, + int connected_wait); int read_inferior_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len); @@ -318,4 +325,6 @@ int write_inferior_memory (CORE_ADDR memaddr, const unsigned char *myaddr, void set_desired_inferior (int id); +const char *target_pid_to_str (ptid_t); + #endif /* TARGET_H */ |