From patchwork Fri Jul 17 13:04:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 7736 Received: (qmail 67404 invoked by alias); 17 Jul 2015 13:05:08 -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 67391 invoked by uid 89); 17 Jul 2015 13:05:07 -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-pa0-f43.google.com Received: from mail-pa0-f43.google.com (HELO mail-pa0-f43.google.com) (209.85.220.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 17 Jul 2015 13:05:06 +0000 Received: by pachj5 with SMTP id hj5so60846370pac.3 for ; Fri, 17 Jul 2015 06:05:04 -0700 (PDT) X-Received: by 10.70.32.66 with SMTP id g2mr29837734pdi.82.1437138304609; Fri, 17 Jul 2015 06:05:04 -0700 (PDT) Received: from E107787-LIN.cambridge.arm.com (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id da2sm11210152pbb.57.2015.07.17.06.05.03 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 17 Jul 2015 06:05:04 -0700 (PDT) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH] Call ptid_get_pid instead of get_thread_id in aarch64_linux_get_debug_reg_capacity Date: Fri, 17 Jul 2015 14:04:53 +0100 Message-Id: <1437138293-19993-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes aarch64_linux_get_debug_reg_capacity is called by aarch64_linux_child_post_startup_inferior, and argument ptid is created in inf-ptrace.c:inf_ptrace_create_inferior, /* On some targets, there must be some explicit actions taken after the inferior has been started up. */ target_post_startup_inferior (pid_to_ptid (pid)); so in aarch64_linux_get_debug_reg_capacity, we can get pid by ptid_get_pid, and don't need to use get_thread_id. Regression tested on aarch64-linux. I'll pushed it in. gdb: 2015-07-17 Yao Qi * aarch64-linux-nat.c (aarch64_linux_get_debug_reg_capacity): Call ptid_get_pid instead of get_thread_id. --- gdb/aarch64-linux-nat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c index 6c95e05..a2247c3 100644 --- a/gdb/aarch64-linux-nat.c +++ b/gdb/aarch64-linux-nat.c @@ -644,7 +644,7 @@ aarch64_linux_get_debug_reg_capacity (ptid_t ptid) struct iovec iov; struct user_hwdebug_state dreg_state; - tid = get_thread_id (ptid); + tid = ptid_get_pid (ptid); iov.iov_base = &dreg_state; iov.iov_len = sizeof (dreg_state);