From patchwork Thu Feb 25 19:15:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 62906 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp328740lbc; Thu, 25 Feb 2016 11:15:59 -0800 (PST) X-Received: by 10.67.4.233 with SMTP id ch9mr5883605pad.29.1456427759220; Thu, 25 Feb 2016 11:15:59 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id qx12si14125080pab.169.2016.02.25.11.15.58 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Feb 2016 11:15:59 -0800 (PST) Received-SPF: pass (google.com: domain of gdb-patches-return-129940-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gdb-patches-return-129940-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gdb-patches-return-129940-patch=linaro.org@sourceware.org; dkim=pass header.i=@sourceware.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=iaxmxDRQqbcQTPyE2VYej1Nts8FeD2t GAGJQS5z8D1mF4JnK9YApxt5T+fy8XULYnHRFxaxvkY/HDEaFfK2CCdZI2kw2UB4 yk21sKzUh5wu2nFDQlSUZkT2qsbetbtvIV2Oi/tNnQDZS5sPLMWyWCH+2kSDlbNj ACQp5bQw0UtI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=4ujTsNSUggB4aFgRuQ6KWGB9whk=; b=yeXOs iyvH5g8ApWPc0MMaII9wki7x9ogmHS3jgsJulL3huI/PSSaayyQv4tuXWTxkbzHS sS3BLrf2enDRdTlTyHYn10PYDxYCiBk4w4ppm8iUPliZyPLpxg4sctT358rK72FT hV6pY2BbPWH3AWLoVkoDB2dAiydnSfPk4mFz1s= Received: (qmail 23734 invoked by alias); 25 Feb 2016 19:15:47 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 23406 invoked by uid 89); 25 Feb 2016 19:15:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, SPF_PASS autolearn=ham version=3.3.2 spammy=driven, notifications, 3028, 70716 X-HELO: mail-wm0-f48.google.com Received: from mail-wm0-f48.google.com (HELO mail-wm0-f48.google.com) (74.125.82.48) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 25 Feb 2016 19:15:35 +0000 Received: by mail-wm0-f48.google.com with SMTP id b205so44921886wmb.1 for ; Thu, 25 Feb 2016 11:15:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=EVO8NVb5H2q+jFnrb9NNsl42uQaPkOR+wv5vunWXWl0=; b=B606jnQS1L3IcA2uAiKS2KbP+f0taWslQL78+d0JW59oaMBbi1J3pxYC/zZMv+d4Cj mrxsiD/8Qo06rS/yKPKSD7LG1ES7/jBdzUeUIlHOvldl0vvm1jh5jmLLfrXgDlSq+KTZ UUi506mIk1Dc2jbkaAzcpLQHNqk5W0TNxBiTauaZaNOyhtV66uMBBHTCsvhAHYt004i0 gDPJiY0I9gyM4jbVZ0K25qKCnNuWhX4pnlFbNPX5FTQ0SP4UvxpRyn2dvJPtLmsAxSUI W09xttII6YN9izXEYwR58UmTT8lEbKrPksKfZX1CEHgCjmi4U1IMF8XmkzUxhmjvIX1M 2CDw== X-Gm-Message-State: AG10YOQMkAnUBT67cDCet/Ob4Js3VCVelkai+WWuADtNE33lJ/FbvW5hqcD57emCknKKnHtN X-Received: by 10.194.95.73 with SMTP id di9mr52142920wjb.152.1456427732447; Thu, 25 Feb 2016 11:15:32 -0800 (PST) Received: from localhost.localdomain (cpc87017-aztw30-2-0-cust65.18-1.cable.virginm.net. [92.232.232.66]) by smtp.gmail.com with ESMTPSA id i10sm4506874wmf.14.2016.02.25.11.15.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 25 Feb 2016 11:15:32 -0800 (PST) From: Kieran Bingham To: gdb-patches@sourceware.org Cc: arnez@linux.vnet.ibm.com, jeffm@suse.com, peter.griffin@linaro.org, lee.jones@linaro.org, yao.qi@linaro.org, russell.wayman@linaro.org, kernel@stlinux.com, Kieran Bingham Subject: [PATCH 1/4] gdb/observer: Provide target_thread_changed observer Date: Thu, 25 Feb 2016 19:15:03 +0000 Message-Id: <1456427706-30077-2-git-send-email-kieran.bingham@linaro.org> In-Reply-To: <1456427706-30077-1-git-send-email-kieran.bingham@linaro.org> References: <1456427706-30077-1-git-send-email-kieran.bingham@linaro.org> LKD utilises an extra observer to obtain notifications whenever the target_thread is changed. This keeps it's internal state aware of any changes that occur in an event driven manner --- gdb/doc/observer.texi | 5 +++++ gdb/remote.c | 4 ++++ 2 files changed, 9 insertions(+) -- 2.5.0 diff --git a/gdb/doc/observer.texi b/gdb/doc/observer.texi index f4049ad3292e..4a9665b374fc 100644 --- a/gdb/doc/observer.texi +++ b/gdb/doc/observer.texi @@ -302,3 +302,8 @@ This observer is used for internal testing. Do not use. See testsuite/gdb.gdb/observer.exp. @end deftypefun +@deftypefun void target_thread_changed (ptid_t @var{somearg}) +The target has changed its current thread to ptid_t. Used by LKD and called +by the shtdi and remote interfaces. +@end deftypefun + diff --git a/gdb/remote.c b/gdb/remote.c index f09a06e9dcc2..9d3bce690519 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -2162,6 +2162,8 @@ static void set_general_thread (struct ptid ptid) { set_thread (ptid, 1); + + observer_notify_target_thread_changed (ptid); } static void @@ -7071,6 +7073,8 @@ remote_wait (struct target_ops *ops, mark_async_event_handler (remote_async_inferior_event_token); } + observer_notify_target_thread_changed (event_ptid); + return event_ptid; }