From patchwork Tue Aug 18 15:53:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 8268 Received: (qmail 71021 invoked by alias); 18 Aug 2015 15:53:46 -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 70288 invoked by uid 89); 18 Aug 2015 15:53:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f44.google.com Received: from mail-pa0-f44.google.com (HELO mail-pa0-f44.google.com) (209.85.220.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 18 Aug 2015 15:53:39 +0000 Received: by paccq16 with SMTP id cq16so91842419pac.1 for ; Tue, 18 Aug 2015 08:53:36 -0700 (PDT) X-Received: by 10.66.218.135 with SMTP id pg7mr14661557pac.141.1439913216753; Tue, 18 Aug 2015 08:53:36 -0700 (PDT) Received: from E107787-LIN.cambridge.arm.com (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id fn15sm18590925pdb.50.2015.08.18.08.53.35 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 18 Aug 2015 08:53:36 -0700 (PDT) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH 11/13] Make aarch64_linux_prepare_to_resume the same on GDB and GDBserver Date: Tue, 18 Aug 2015 16:53:17 +0100 Message-Id: <1439913199-22882-12-git-send-email-yao.qi@linaro.org> In-Reply-To: <1439913199-22882-1-git-send-email-yao.qi@linaro.org> References: <1439913199-22882-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes gdb: 2015-08-18 Yao Qi * aarch64-linux-nat.c (aarch64_linux_prepare_to_resume): Use lwp_arch_private_info and ptid_of_lwp. gdb/gdbserver: 2015-08-18 Yao Qi * linux-aarch64-low.c (aarch64_linux_prepare_to_resume): Use lwp_arch_private_info and ptid_of_lwp. --- gdb/aarch64-linux-nat.c | 7 ++++--- gdb/gdbserver/linux-aarch64-low.c | 10 ++++------ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c index 1b3ed57..e3baae5 100644 --- a/gdb/aarch64-linux-nat.c +++ b/gdb/aarch64-linux-nat.c @@ -431,7 +431,7 @@ supply_fpregset (struct regcache *regcache, const gdb_fpregset_t *fpregsetp) static void aarch64_linux_prepare_to_resume (struct lwp_info *lwp) { - struct arch_lwp_info *info = lwp->arch_private; + struct arch_lwp_info *info = lwp_arch_private_info (lwp); /* NULL means this is the main thread still going through the shell, or, no watchpoint has been set yet. In that case, there's @@ -442,9 +442,10 @@ aarch64_linux_prepare_to_resume (struct lwp_info *lwp) if (DR_HAS_CHANGED (info->dr_changed_bp) || DR_HAS_CHANGED (info->dr_changed_wp)) { - int tid = ptid_get_lwp (lwp->ptid); + ptid_t ptid = ptid_of_lwp (lwp); + int tid = ptid_get_lwp (ptid); struct aarch64_debug_reg_state *state - = aarch64_get_debug_reg_state (ptid_get_pid (lwp->ptid)); + = aarch64_get_debug_reg_state (ptid_get_pid (ptid)); if (show_debug_regs) fprintf_unfiltered (gdb_stdlog, "prepare_to_resume thread %d\n", tid); diff --git a/gdb/gdbserver/linux-aarch64-low.c b/gdb/gdbserver/linux-aarch64-low.c index 421dcb9..4b1d7d5 100644 --- a/gdb/gdbserver/linux-aarch64-low.c +++ b/gdb/gdbserver/linux-aarch64-low.c @@ -489,20 +489,18 @@ aarch64_linux_new_fork (struct process_info *parent, static void aarch64_linux_prepare_to_resume (struct lwp_info *lwp) { - struct thread_info *thread = get_lwp_thread (lwp); - ptid_t ptid = ptid_of (thread); - struct arch_lwp_info *info = lwp->arch_private; + struct arch_lwp_info *info = lwp_arch_private_info (lwp); if (DR_HAS_CHANGED (info->dr_changed_bp) || DR_HAS_CHANGED (info->dr_changed_wp)) { + ptid_t ptid = ptid_of_lwp (lwp); int tid = ptid_get_lwp (ptid); - struct process_info *proc = find_process_pid (ptid_get_pid (ptid)); struct aarch64_debug_reg_state *state - = &proc->priv->arch_private->debug_reg_state; + = aarch64_get_debug_reg_state (ptid_get_pid (ptid)); if (show_debug_regs) - fprintf (stderr, "prepare_to_resume thread %ld\n", lwpid_of (thread)); + fprintf (stderr, "prepare_to_resume thread %d\n", tid); /* Watchpoints. */ if (DR_HAS_CHANGED (info->dr_changed_wp))