From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31422 invoked by alias); 22 Aug 2008 13:17:55 -0000 Received: (qmail 30651 invoked by uid 22791); 22 Aug 2008 13:17:47 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 22 Aug 2008 13:17:07 +0000 Received: (qmail 8291 invoked from network); 22 Aug 2008 13:17:05 -0000 Received: from unknown (HELO orlando.local) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 22 Aug 2008 13:17:05 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Don't output [Switching to ...] when connecting Date: Fri, 22 Aug 2008 13:17:00 -0000 User-Agent: KMail/1.9.9 MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_FyrrIge7ph9OvGu" Message-Id: <200808221417.57435.pedro@codesourcery.com> X-IsSubscribed: yes 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 X-SW-Source: 2008-08/txt/msg00580.txt.bz2 --Boundary-00=_FyrrIge7ph9OvGu Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Content-length: 607 This patch reverts to setting previous_inferior_ptid where it used to. I had moved this a while back, because I was using previous_inferior_ptid differently in non-stop, but that is no longer true, so we can just revert back. The effect is that we revert to the old behaviour of not outputting [Switching to Thread ...] message when connecting with target remote, or any other "target xxx", which can be confusing if the target doesn't support threads. Tested on x86_64-unknown-linux-gnu sync and async, and confirmed that the message is now gone when we connect to target remote. OK? -- Pedro Alves --Boundary-00=_FyrrIge7ph9OvGu Content-Type: text/x-diff; charset="utf-8"; name="no_message_start_remote.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="no_message_start_remote.diff" Content-length: 1781 2008-08-22 Pedro Alves * infrun.c (proceed): Move back setting previous_inferior_ptid from here ... (wait_for_inferior): ... to here. (fetch_inferior_event): ... and here. --- infrun.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) Index: gdb/infrun.c =================================================================== --- gdb.orig/infrun.c 2008-08-22 13:22:08.000000000 +0100 +++ gdb/infrun.c 2008-08-22 13:53:00.000000000 +0100 @@ -1353,9 +1353,6 @@ proceed (CORE_ADDR addr, enum target_sig /* Fill in with reasonable starting values. */ init_thread_stepping_state (tss); - /* We'll update this if & when we switch to a new thread. */ - previous_inferior_ptid = inferior_ptid; - /* Reset to normal state. */ init_infwait_state (); @@ -1536,6 +1533,9 @@ wait_for_inferior (int treat_exec_as_sig overlay_cache_invalid = 1; + /* We'll update this if & when we switch to a new thread. */ + previous_inferior_ptid = inferior_ptid; + /* We have to invalidate the registers BEFORE calling target_wait because they can be loaded from the target while in target_wait. This makes remote debugging a bit more efficient for those @@ -1588,6 +1588,13 @@ fetch_inferior_event (void *client_data) overlay_cache_invalid = 1; + /* We can only rely on wait_for_more being correct before handling + the event in all-stop, but previous_inferior_ptid isn't used in + non-stop. */ + if (!ecs->wait_some_more) + /* We'll update this if & when we switch to a new thread. */ + previous_inferior_ptid = inferior_ptid; + if (non_stop) /* In non-stop mode, the user/frontend should not notice a thread switch due to internal events. Make sure we reverse to the --Boundary-00=_FyrrIge7ph9OvGu--