From patchwork Tue Jul 7 16:24:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 7571 Received: (qmail 2995 invoked by alias); 7 Jul 2015 16:24:52 -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 2983 invoked by uid 89); 7 Jul 2015 16:24:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pd0-f170.google.com Received: from mail-pd0-f170.google.com (HELO mail-pd0-f170.google.com) (209.85.192.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 07 Jul 2015 16:24:49 +0000 Received: by pdbci14 with SMTP id ci14so128417527pdb.2 for ; Tue, 07 Jul 2015 09:24:47 -0700 (PDT) X-Received: by 10.66.141.109 with SMTP id rn13mr10316164pab.127.1436286287832; Tue, 07 Jul 2015 09:24:47 -0700 (PDT) Received: from E107787-LIN.cambridge.arm.com (gcc1-power7.osuosl.org. [140.211.15.137]) by mx.google.com with ESMTPSA id f4sm22427256pdc.95.2015.07.07.09.24.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 07 Jul 2015 09:24:46 -0700 (PDT) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH] Pass ptid to aarch64_linux_get_debug_reg_capacity Date: Tue, 7 Jul 2015 17:24:43 +0100 Message-Id: <1436286283-23021-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes This patch is to pass ptid to aarch64_linux_get_debug_reg_capacity, and stop using global variable inferior_ptid. gdb: 2015-07-07 Yao Qi * aarch64-linux-nat.c (aarch64_linux_get_debug_reg_capacity): Add argument ptid. Update comments. Caller update. --- gdb/aarch64-linux-nat.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c index d9b2665..bffb199 100644 --- a/gdb/aarch64-linux-nat.c +++ b/gdb/aarch64-linux-nat.c @@ -838,16 +838,17 @@ ps_get_thread_area (const struct ps_prochandle *ph, } -/* Get the hardware debug register capacity information. */ +/* Get the hardware debug register capacity information from the + inferior represented by PTID. */ static void -aarch64_linux_get_debug_reg_capacity (void) +aarch64_linux_get_debug_reg_capacity (ptid_t ptid) { int tid; struct iovec iov; struct user_hwdebug_state dreg_state; - tid = get_thread_id (inferior_ptid); + tid = get_thread_id (ptid); iov.iov_base = &dreg_state; iov.iov_len = sizeof (dreg_state); @@ -902,7 +903,7 @@ aarch64_linux_child_post_startup_inferior (struct target_ops *self, ptid_t ptid) { aarch64_forget_process (ptid_get_pid (ptid)); - aarch64_linux_get_debug_reg_capacity (); + aarch64_linux_get_debug_reg_capacity (ptid); super_post_startup_inferior (self, ptid); }