* Makefile.in (SFILES): Add common/target-common.c.
	Add common/target-common.h to headers.
	(COMMON_OBS): Add target-common.o.
	(target-common.o): New target.
	* linux-nat.h (resume_kind): Move to common/target-common.h.
	* target.c (target_waitstatus_to_string): Move to
	common/target-common.c.
	* target.h: Include target-common.h.
	(target_waitkind): Move to common/target-common.h.
	(target_waitstatus): Likewise.
	(TARGET_WNOHANG): Likewise.
	* common/target-common.c: New file.
	* common/target-common.h: New file.

	gdb/gdbserver/
	* Makefile.in (SFILES): /common/target-common.c.
	(OBS): Add target-common.o.
	(server_h): Add $(srcdir)/../common/target-common.h.
	(target-common.o): New target.
	* server.c (queue_stop_reply_callback): Free
	status string after use.
	* target.c (target_waitstatus_to_string): Remove.
	* target.h: Include target-common.h.
	(resume_kind): Likewise.
	(target_waitkind): Likewise.
	(target_waitstatus): Likewise.
	(TARGET_WNOHANG): Likewise.
This commit is contained in:
Luis Machado
2013-07-24 16:20:12 +00:00
parent 7e8b059be6
commit 3360c0bf75
12 changed files with 290 additions and 284 deletions

View File

@@ -140,48 +140,6 @@ target_pid_to_str (ptid_t ptid)
return buf;
}
/* Return a pretty printed form of target_waitstatus. */
const char *
target_waitstatus_to_string (const struct target_waitstatus *ws)
{
static char buf[200];
const char *kind_str = "status->kind = ";
switch (ws->kind)
{
case TARGET_WAITKIND_EXITED:
sprintf (buf, "%sexited, status = %d",
kind_str, ws->value.integer);
break;
case TARGET_WAITKIND_STOPPED:
sprintf (buf, "%sstopped, signal = %s",
kind_str, gdb_signal_to_name (ws->value.sig));
break;
case TARGET_WAITKIND_SIGNALLED:
sprintf (buf, "%ssignalled, signal = %s",
kind_str, gdb_signal_to_name (ws->value.sig));
break;
case TARGET_WAITKIND_LOADED:
sprintf (buf, "%sloaded", kind_str);
break;
case TARGET_WAITKIND_EXECD:
sprintf (buf, "%sexecd", kind_str);
break;
case TARGET_WAITKIND_SPURIOUS:
sprintf (buf, "%sspurious", kind_str);
break;
case TARGET_WAITKIND_IGNORE:
sprintf (buf, "%signore", kind_str);
break;
default:
sprintf (buf, "%sunknown???", kind_str);
break;
}
return buf;
}
int
kill_inferior (int pid)
{