* target.h (target_ops): Change return type of detach to int.

Add join.
	(join_inferior): New.
	* server.c (main): Don't skip detach support on mingw32.
	If the inferior doesn't support detaching return error.
	Call join_inferior instead of using waitpid.
	* linux-low.c (linux_join): New.
	(linux_target_op): Add linux_join.
	* spu-low.c (spu_join): New.
	(spu_target_ops): Add spu_join.
	* win32-low.c (win32_detach): Adapt to new interface.
	Reopen current_process_handle before detaching.  Issue a child
	resume before detaching.
	(win32_join): New.
	(win32_target_op): Add win32_join.
This commit is contained in:
Pedro Alves
2007-05-10 21:05:15 +00:00
parent 1d5315fee9
commit 444d61395b
6 changed files with 120 additions and 29 deletions

View File

@@ -69,9 +69,14 @@ struct target_ops
void (*kill) (void);
/* Detach from all inferiors. */
/* Detach from all inferiors.
Return -1 on failure, and 0 on success. */
void (*detach) (void);
int (*detach) (void);
/* Wait for inferiors to end. */
void (*join) (void);
/* Return 1 iff the thread with process ID PID is alive. */
@@ -207,6 +212,9 @@ void set_target_ops (struct target_ops *);
#define store_inferior_registers(regno) \
(*the_target->store_registers) (regno)
#define join_inferior() \
(*the_target->join) ()
unsigned char mywait (char *statusp, int connected_wait);
int read_inferior_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len);