2011-06-06 Pedro Alves <pedro@codesourcery.com>

gdb/
	* infcall.c (run_inferior_call): Don't mask async.  Instead force
	a synchronous wait, if the target can async.

	* target.h (struct target_ops): Delete to_async_mask.
	(target_async_mask): Delete.
	* target.c (update_current_target): Delete references to to_async_mask.
	* linux-nat.c (linux_nat_async_mask_value): Delete.
	(linux_nat_is_async_p, linux_nat_can_async_p): Remove references
	to linux_nat_async_mask_value.
	(linux_nat_async_mask): Delete.
	(linux_nat_async, linux_nat_close): Remove references to
	linux_nat_async_mask_value.
	* record.c (record_async_mask_value): Delete.
	(record_async): Remove references to record_async_mask_value.
	(record_async_mask): Delete.
	(record_can_async_p, record_is_async_p): Remove references to
	record_async_mask_value.
	(init_record_ops, init_record_core_ops): Remove references to
	record_async_mask.
	* remote.c (remote_async_mask_value): Delete.
	(init_remote_ops): Remove reference to remote_async_mask.
	(remote_can_async_p, remote_is_async_p): Remove references to
	remote_async_mask_value.
	(remote_async): Remove references to remote_async_mask_value.
	(remote_async_mask): Delete.

	* infrun.c (fetch_inferior_event): Don't claim registers changed
	if the current thread is already not executing.
This commit is contained in:
Pedro Alves
2011-06-06 12:47:07 +00:00
parent 3c0013bf3b
commit 3dd5b83d5b
8 changed files with 61 additions and 138 deletions

View File

@ -250,15 +250,11 @@ static int linux_supports_tracesysgood_flag = -1;
static int linux_supports_tracevforkdone_flag = -1;
/* Async mode support. */
/* Zero if the async mode, although enabled, is masked, which means
linux_nat_wait should behave as if async mode was off. */
static int linux_nat_async_mask_value = 1;
/* Stores the current used ptrace() options. */
static int current_ptrace_options = 0;
/* Async mode support. */
/* The read/write ends of the pipe registered as waitable file in the
event loop. */
static int linux_nat_event_pipe[2] = { -1, -1 };
@ -306,7 +302,6 @@ static void linux_nat_async (void (*callback)
(enum inferior_event_type event_type,
void *context),
void *context);
static int linux_nat_async_mask (int mask);
static int kill_lwp (int lwpid, int signo);
static int stop_callback (struct lwp_info *lp, void *data);
@ -5359,11 +5354,7 @@ linux_nat_is_async_p (void)
/* NOTE: palves 2008-03-21: We're only async when the user requests
it explicitly with the "set target-async" command.
Someday, linux will always be async. */
if (!target_async_permitted)
return 0;
/* See target.h/target_async_mask. */
return linux_nat_async_mask_value;
return target_async_permitted;
}
/* target_can_async_p implementation. */
@ -5374,11 +5365,7 @@ linux_nat_can_async_p (void)
/* NOTE: palves 2008-03-21: We're only async when the user requests
it explicitly with the "set target-async" command.
Someday, linux will always be async. */
if (!target_async_permitted)
return 0;
/* See target.h/target_async_mask. */
return linux_nat_async_mask_value;
return target_async_permitted;
}
static int
@ -5398,37 +5385,6 @@ linux_nat_supports_multi_process (void)
return linux_multi_process;
}
/* target_async_mask implementation. */
static int
linux_nat_async_mask (int new_mask)
{
int curr_mask = linux_nat_async_mask_value;
if (curr_mask != new_mask)
{
if (new_mask == 0)
{
linux_nat_async (NULL, 0);
linux_nat_async_mask_value = new_mask;
}
else
{
linux_nat_async_mask_value = new_mask;
/* If we're going out of async-mask in all-stop, then the
inferior is stopped. The next resume will call
target_async. In non-stop, the target event source
should be always registered in the event loop. Do so
now. */
if (non_stop)
linux_nat_async (inferior_event_handler, 0);
}
}
return curr_mask;
}
static int async_terminal_is_ours = 1;
/* target_terminal_inferior implementation. */
@ -5555,10 +5511,6 @@ static void
linux_nat_async (void (*callback) (enum inferior_event_type event_type,
void *context), void *context)
{
if (linux_nat_async_mask_value == 0 || !target_async_permitted)
internal_error (__FILE__, __LINE__,
"Calling target_async when async is masked");
if (callback != NULL)
{
async_client_callback = callback;
@ -5651,9 +5603,6 @@ linux_nat_close (int quitting)
if (target_is_async_p ())
target_async (NULL, 0);
/* Reset the async_masking. */
linux_nat_async_mask_value = 1;
if (linux_ops->to_close)
linux_ops->to_close (quitting);
}
@ -5800,7 +5749,6 @@ linux_nat_add_target (struct target_ops *t)
t->to_is_async_p = linux_nat_is_async_p;
t->to_supports_non_stop = linux_nat_supports_non_stop;
t->to_async = linux_nat_async;
t->to_async_mask = linux_nat_async_mask;
t->to_terminal_inferior = linux_nat_terminal_inferior;
t->to_terminal_ours = linux_nat_terminal_ours;
t->to_close = linux_nat_close;