* target.h (target_waitstatus_to_string): Declare.

* target.c (target_waitstatus_to_string): New function.  Copied from
	debug_to_wait.  Add missing entries for TARGET_WAITKIND_SYSCALL_ENTRY,
	TARGET_WAITKIND_SYSCALL_RETURN, TARGET_WAITKIND_IGNORE,
	TARGET_WAITKIND_NO_HISTORY.
	(debug_to_wait): Call it.
	* infrun.c (wait_for_inferior): If debug_infrun, print result of
	target_wait.
	(fetch_inferior_event): Ditto.
This commit is contained in:
Doug Evans
2009-02-01 23:31:03 +00:00
parent 273f4430f8
commit f00150c95d
4 changed files with 83 additions and 34 deletions

View File

@ -1789,6 +1789,16 @@ wait_for_inferior (int treat_exec_as_sigtrap)
else
ecs->ptid = target_wait (waiton_ptid, &ecs->ws);
if (debug_infrun)
{
char *status_string = target_waitstatus_to_string (&ecs->ws);
fprintf_unfiltered (gdb_stdlog,
"infrun: target_wait (%d, status) = %d, %s\n",
PIDGET (waiton_ptid), PIDGET (ecs->ptid),
status_string);
xfree (status_string);
}
if (treat_exec_as_sigtrap && ecs->ws.kind == TARGET_WAITKIND_EXECD)
{
xfree (ecs->ws.value.execd_pathname);
@ -1864,6 +1874,16 @@ fetch_inferior_event (void *client_data)
else
ecs->ptid = target_wait (waiton_ptid, &ecs->ws);
if (debug_infrun)
{
char *status_string = target_waitstatus_to_string (&ecs->ws);
fprintf_unfiltered (gdb_stdlog,
"infrun: target_wait (%d, status) = %d, %s\n",
PIDGET (waiton_ptid), PIDGET (ecs->ptid),
status_string);
xfree (status_string);
}
if (non_stop
&& ecs->ws.kind != TARGET_WAITKIND_IGNORE
&& ecs->ws.kind != TARGET_WAITKIND_EXITED