From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5398 invoked by alias); 22 Oct 2013 19:00:34 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 5377 invoked by uid 89); 22 Oct 2013 19:00:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.6 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 22 Oct 2013 19:00:32 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r9MHxePT018231 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 22 Oct 2013 13:59:40 -0400 Received: from barimba.redhat.com (ovpn-113-54.phx2.redhat.com [10.3.113.54]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r9MHxZvl011450; Tue, 22 Oct 2013 13:59:40 -0400 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH v4 7/9] make dprintf.exp pass in always-async mode Date: Tue, 22 Oct 2013 19:00:00 -0000 Message-Id: <1382464769-2465-8-git-send-email-tromey@redhat.com> In-Reply-To: <1382464769-2465-1-git-send-email-tromey@redhat.com> References: <1382464769-2465-1-git-send-email-tromey@redhat.com> X-SW-Source: 2013-10/txt/msg00705.txt.bz2 When target-async is enabled, dprintf.exp fails. This happens because run_inferior_call causes gdb to forget that it is running in sync_execution mode, so something like a breakpoint condition that makes an inferior call causes gdb to enter fully async mode. This patch fixes the problem by noticing when gdb was in sync_execution mode in run_inferior_call, and taking care to restore this state afterward. Built and regtested on x86-64 Fedora 18. PR cli/15718: * infcall.c: Include event-top.h. (run_inferior_call): Call async_disable_stdin if needed. --- gdb/infcall.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gdb/infcall.c b/gdb/infcall.c index 19af044..7398913 100644 --- a/gdb/infcall.c +++ b/gdb/infcall.c @@ -36,6 +36,7 @@ #include "ada-lang.h" #include "gdbthread.h" #include "exceptions.h" +#include "event-top.h" /* If we can't find a function's name from its address, we print this instead. */ @@ -398,6 +399,8 @@ run_inferior_call (struct thread_info *call_thread, CORE_ADDR real_pc) TRY_CATCH (e, RETURN_MASK_ALL) { + int was_sync = sync_execution; + proceed (real_pc, GDB_SIGNAL_0, 0); /* Inferior function calls are always synchronous, even if the @@ -407,6 +410,11 @@ run_inferior_call (struct thread_info *call_thread, CORE_ADDR real_pc) { wait_for_inferior (); normal_stop (); + /* If gdb was previously in sync execution mode, then ensure + that it remains so. normal_stop calls + async_enable_stdin, so reset it again here. */ + if (was_sync) + async_disable_stdin (); } } -- 1.8.1.4