From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3964 invoked by alias); 6 Feb 2013 17:38:35 -0000 Received: (qmail 3836 invoked by uid 22791); 6 Feb 2013 17:38:33 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_SPAMHAUS_DROP,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from service87.mimecast.com (HELO service87.mimecast.com) (91.220.42.44) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 06 Feb 2013 17:38:27 +0000 Received: from cam-owa2.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Wed, 06 Feb 2013 17:38:26 +0000 Received: from [10.1.72.50] ([10.1.255.212]) by cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 6 Feb 2013 17:38:26 +0000 Message-ID: <51129511.7070601@arm.com> Date: Wed, 06 Feb 2013 17:38:00 -0000 From: Marcus Shawcroft User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 MIME-Version: 1.0 To: "gdb-patches@sourceware.org" Subject: [PATCH] gdbserver switch ps_get_thread_area to PTRACE_GETREGSET X-MC-Unique: 113020617382601701 Content-Type: multipart/mixed; boundary="------------090809070004090807020108" Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2013-02/txt/msg00151.txt.bz2 This is a multi-part message in MIME format. --------------090809070004090807020108 Content-Type: text/plain; charset=WINDOWS-1252; format=flowed Content-Transfer-Encoding: quoted-printable Content-length: 318 This patch switches the aarch64 gdbserver ps_get_thread_area()=20 implementation from PTRACE_GET_THREAD_AREA to PTRACE_GETREGSET. OK? /Marcus 2013-02-06 Marcus Shawcroft * linux-aarch64-low.c (ps_get_thread_area): Replace PTRACE_GET_THREAD_AREA with PTRACE_GETREGSET.= --------------090809070004090807020108 Content-Type: text/x-patch; name=0001-AArch64-GDBServer-switch-from-PTRACE_GET_THREAD_AREA.patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename*0="0001-AArch64-GDBServer-switch-from-PTRACE_GET_THREAD_AREA.pa"; filename*1="tch" Content-length: 1050 diff --git a/gdb/gdbserver/linux-aarch64-low.c b/gdb/gdbserver/linux-aarch6= 4-low.c index 7f99887..e56ea80 100644 --- a/gdb/gdbserver/linux-aarch64-low.c +++ b/gdb/gdbserver/linux-aarch64-low.c @@ -1089,16 +1089,22 @@ aarch64_stopped_by_watchpoint (void) /* Fetch the thread-local storage pointer for libthread_db. */ =20 ps_err_e -ps_get_thread_area (const struct ps_prochandle * ph, +ps_get_thread_area (const struct ps_prochandle *ph, lwpid_t lwpid, int idx, void **base) { - if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) !=3D 0) + struct iovec iovec; + CORE_ADDR reg; + + iovec.iov_base =3D ® + iovec.iov_len =3D sizeof (reg); + + if (ptrace (PTRACE_GETREGSET, lwpid, NT_ARM_TLS, &iovec) !=3D 0) return PS_ERR; =20 /* IDX is the bias from the thread pointer to the beginning of the thread descriptor. It has to be subtracted due to implementation quirks in libthread_db. */ - *base =3D (void *) ((char *) *base - idx); + *base =3D (void *) (reg - idx); =20 return PS_OK; } --=20 1.7.9.5 --------------090809070004090807020108--