From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32406 invoked by alias); 3 May 2012 13:13:03 -0000 Received: (qmail 32220 invoked by uid 22791); 3 May 2012 13:13:00 -0000 X-SWARE-Spam-Status: No, hits=-4.0 required=5.0 tests=AWL,BAYES_00,FROM_12LTRDOM,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 03 May 2012 13:12:47 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1SPvpu-0005Li-7F from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Thu, 03 May 2012 06:12:46 -0700 Received: from SVR-ORW-FEM-02.mgc.mentorg.com ([147.34.96.206]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Thu, 3 May 2012 06:12:45 -0700 Received: from localhost.localdomain (147.34.91.1) by svr-orw-fem-02.mgc.mentorg.com (147.34.96.168) with Microsoft SMTP Server id 14.1.289.1; Thu, 3 May 2012 06:12:36 -0700 From: Yao Qi To: Subject: [PATCH 07/14] Support in remote target. Date: Thu, 03 May 2012 13:13:00 -0000 Message-ID: <1336050869-29605-8-git-send-email-yao@codesourcery.com> In-Reply-To: <1336050869-29605-1-git-send-email-yao@codesourcery.com> References: <1336050869-29605-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain 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: 2012-05/txt/msg00066.txt.bz2 This patch is to support remote target. gdb: 2012-04-12 Yao Qi * remote.c (remote_is_non_stop_p): New. (init_remote_ops): Install remote_is_non_stop_p. (remote_add_inferior): Set tp->control.resumed to 1. (add_current_inferior_and_thread): Likewise. (extended_remote_attach_1): Likewise. --- gdb/remote.c | 19 ++++++++++++++++--- 1 files changed, 16 insertions(+), 3 deletions(-) diff --git a/gdb/remote.c b/gdb/remote.c index 68864d1..6d58aca 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -1506,8 +1506,9 @@ remote_add_inferior (int fake_pid_p, int pid, int attached) static void remote_add_thread (ptid_t ptid, int running) { - add_thread (ptid); + struct thread_info *tp = add_thread (ptid); + tp->control.resumed = 1; set_executing (ptid, running); set_running (ptid, running); } @@ -3227,6 +3228,7 @@ add_current_inferior_and_thread (void) struct remote_state *rs = get_remote_state (); int fake_pid_p = 0; ptid_t ptid; + struct thread_info *tp; inferior_ptid = null_ptid; @@ -3252,7 +3254,8 @@ add_current_inferior_and_thread (void) remote_add_inferior (fake_pid_p, ptid_get_pid (inferior_ptid), -1); /* Add the main thread. */ - add_thread_silent (inferior_ptid); + tp = add_thread_silent (inferior_ptid); + tp->control.resumed = 1; } static void @@ -4441,11 +4444,14 @@ extended_remote_attach_1 (struct target_ops *target, char *args, int from_tty) } else { + struct thread_info *tp; + /* Now, if we have thread information, update inferior_ptid. */ inferior_ptid = remote_current_thread (inferior_ptid); /* Add the main thread to the thread list. */ - add_thread_silent (inferior_ptid); + tp = add_thread_silent (inferior_ptid); + tp->control.resumed = 1; } /* Next, if the target can specify a description, read it. We do @@ -10900,6 +10906,12 @@ remote_can_use_agent (void) return (remote_protocol_packets[PACKET_QAgent].support != PACKET_DISABLE); } +static int +remote_is_non_stop_p (void) +{ + return non_stop; +} + static void init_remote_ops (void) { @@ -10965,6 +10977,7 @@ Specify the serial device it is connected to\n\ remote_ops.to_can_async_p = remote_can_async_p; remote_ops.to_is_async_p = remote_is_async_p; remote_ops.to_async = remote_async; + remote_ops.to_is_non_stop_p = remote_is_non_stop_p; remote_ops.to_terminal_inferior = remote_terminal_inferior; remote_ops.to_terminal_ours = remote_terminal_ours; remote_ops.to_supports_non_stop = remote_supports_non_stop; -- 1.7.0.4