aboutsummaryrefslogtreecommitdiff
path: root/gdb/infcall.c
diff options
context:
space:
mode:
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;
}