aboutsummaryrefslogtreecommitdiff
path: root/gdb/infcall.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2011-06-06 12:47:07 +0000
committerPedro Alves <palves@redhat.com>2011-06-06 12:47:07 +0000
commit3dd5b83d5bd7977bb5b98c9ef9bd8345c0f26d80 (patch)
tree5c5c72e79b6fd9a6041dd55e2dad4adf3c77704d /gdb/infcall.c
parent3c0013bf3bcaaf29176017ef8667ce591ad969c5 (diff)
downloadgdb-3dd5b83d5bd7977bb5b98c9ef9bd8345c0f26d80.zip
gdb-3dd5b83d5bd7977bb5b98c9ef9bd8345c0f26d80.tar.gz
gdb-3dd5b83d5bd7977bb5b98c9ef9bd8345c0f26d80.tar.bz2
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.
Diffstat (limited to 'gdb/infcall.c')
-rw-r--r--gdb/infcall.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/gdb/infcall.c b/gdb/infcall.c
index 6553e2a..b8b7ff5 100644
--- a/gdb/infcall.c
+++ b/gdb/infcall.c
@@ -387,10 +387,8 @@ static struct gdb_exception
run_inferior_call (struct thread_info *call_thread, CORE_ADDR real_pc)
{
volatile struct gdb_exception e;
- int saved_async = 0;
int saved_in_infcall = call_thread->control.in_infcall;
ptid_t call_thread_ptid = call_thread->ptid;
- char *saved_target_shortname = xstrdup (target_shortname);
call_thread->control.in_infcall = 1;
@@ -401,22 +399,24 @@ run_inferior_call (struct thread_info *call_thread, CORE_ADDR real_pc)
/* We want stop_registers, please... */
call_thread->control.proceed_to_finish = 1;
- if (target_can_async_p ())
- saved_async = target_async_mask (0);
-
TRY_CATCH (e, RETURN_MASK_ALL)
- proceed (real_pc, TARGET_SIGNAL_0, 0);
+ {
+ proceed (real_pc, TARGET_SIGNAL_0, 0);
+
+ /* Inferior function calls are always synchronous, even if the
+ target supports asynchronous execution. Do here what
+ `proceed' itself does in sync mode. */
+ if (target_can_async_p () && is_running (inferior_ptid))
+ {
+ wait_for_inferior ();
+ normal_stop ();
+ }
+ }
/* At this point the current thread may have changed. Refresh
CALL_THREAD as it could be invalid if its thread has exited. */
call_thread = find_thread_ptid (call_thread_ptid);
- /* Don't restore the async mask if the target has changed,
- saved_async is for the original target. */
- if (saved_async
- && strcmp (saved_target_shortname, target_shortname) == 0)
- target_async_mask (saved_async);
-
enable_watchpoints_after_interactive_call_stop ();
/* Call breakpoint_auto_delete on the current contents of the bpstat
@@ -433,8 +433,6 @@ run_inferior_call (struct thread_info *call_thread, CORE_ADDR real_pc)
if (call_thread != NULL)
call_thread->control.in_infcall = saved_in_infcall;
- xfree (saved_target_shortname);
-
return e;
}