From patchwork Thu May 28 14:20:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 6955 Received: (qmail 106450 invoked by alias); 28 May 2015 14:20:40 -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 106172 invoked by uid 89); 28 May 2015 14:20:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 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-f177.google.com Received: from mail-pd0-f177.google.com (HELO mail-pd0-f177.google.com) (209.85.192.177) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 28 May 2015 14:20:26 +0000 Received: by pdfh10 with SMTP id h10so42805084pdf.3 for ; Thu, 28 May 2015 07:20:24 -0700 (PDT) X-Received: by 10.66.136.170 with SMTP id qb10mr5995126pab.56.1432822824892; Thu, 28 May 2015 07:20:24 -0700 (PDT) Received: from E107787-LIN.cambridge.arm.com (gcc1-power7.osuosl.org. [140.211.15.137]) by mx.google.com with ESMTPSA id dd3sm2587101pad.45.2015.05.28.07.20.23 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 28 May 2015 07:20:24 -0700 (PDT) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH 2/6] Move have_ptrace_getregset to linux-nat.c Date: Thu, 28 May 2015 15:20:12 +0100 Message-Id: <1432822816-32327-3-git-send-email-yao.qi@linaro.org> In-Reply-To: <1432822816-32327-1-git-send-email-yao.qi@linaro.org> References: <1432822816-32327-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes I'll let arm-linux-nat.c to use PTRACE_GETREGSET if kernel supports, so this patch is to move have_ptrace_getregset from x86-linux-nat.c to linux-nat.c. gdb: 2015-05-28 Yao Qi * x86-linux-nat.c (have_ptrace_getregset): Move it to ... * linux-nat.c: ... here. * x86-linux-nat.h (have_ptrace_getregset): Move the declaration to ... * linux-nat.h: ... here. --- gdb/linux-nat.c | 3 +++ gdb/linux-nat.h | 3 +++ gdb/x86-linux-nat.c | 2 -- gdb/x86-linux-nat.h | 2 -- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index f95e76c..febee84 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -163,6 +163,9 @@ blocked. */ #define O_LARGEFILE 0 #endif +/* Does the current host support PTRACE_GETREGSET? */ +int have_ptrace_getregset = -1; + /* The single-threaded native GNU/Linux target_ops. We save a pointer for the use of the multi-threaded target. */ static struct target_ops *linux_ops; diff --git a/gdb/linux-nat.h b/gdb/linux-nat.h index d935270..3d766b5 100644 --- a/gdb/linux-nat.h +++ b/gdb/linux-nat.h @@ -115,6 +115,9 @@ struct lwp_info native target is active. */ extern struct lwp_info *lwp_list; +/* Does the current host support PTRACE_GETREGSET? */ +extern int have_ptrace_getregset; + /* Iterate over each active thread (light-weight process). */ #define ALL_LWPS(LP) \ for ((LP) = lwp_list; \ diff --git a/gdb/x86-linux-nat.c b/gdb/x86-linux-nat.c index 0026d26..5d8f7c7 100644 --- a/gdb/x86-linux-nat.c +++ b/gdb/x86-linux-nat.c @@ -51,8 +51,6 @@ struct arch_lwp_info int debug_registers_changed; }; -/* Does the current host support PTRACE_GETREGSET? */ -int have_ptrace_getregset = -1; /* linux_nat_new_fork hook. */ diff --git a/gdb/x86-linux-nat.h b/gdb/x86-linux-nat.h index 7c4d87c..70c207a 100644 --- a/gdb/x86-linux-nat.h +++ b/gdb/x86-linux-nat.h @@ -20,8 +20,6 @@ #ifndef X86_LINUX_NAT_H #define X86_LINUX_NAT_H 1 -/* Does the current host support PTRACE_GETREGSET? */ -extern int have_ptrace_getregset; /* Helper for ps_get_thread_area. Sets BASE_ADDR to a pointer to