From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31938 invoked by alias); 13 Feb 2013 18:57:00 -0000 Received: (qmail 31929 invoked by uid 22791); 13 Feb 2013 18:56:59 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_SPAMHAUS_DROP,KHOP_THREADED,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, 13 Feb 2013 18:56:51 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Wed, 13 Feb 2013 18:56:49 +0000 Received: from [10.1.69.62] ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.0); Wed, 13 Feb 2013 18:56:48 +0000 Message-ID: <511BE1EF.3020408@arm.com> Date: Wed, 13 Feb 2013 18:57:00 -0000 From: Yufeng Zhang User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: Pedro Alves CC: Marcus Shawcroft , GDB Patches Subject: Re: [native AAarch64 GNU/Linux] Access debug register mirror from the corresponding process. References: <20130207163339.19427.73350.stgit@brno.lan> <20130207165907.GB15297@host2.jankratochvil.net> <51195E18.1010008@redhat.com> <511A372F.80006@redhat.com> <511BA106.8030103@arm.com> <511BADDB.3030703@redhat.com> <511BB8DE.3060704@redhat.com> In-Reply-To: <511BB8DE.3060704@redhat.com> X-MC-Unique: 113021318564900401 Content-Type: multipart/mixed; boundary="------------080606040102090201090602" X-IsSubscribed: yes 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/msg00324.txt.bz2 This is a multi-part message in MIME format. --------------080606040102090201090602 Content-Type: text/plain; charset=WINDOWS-1252; format=flowed Content-Transfer-Encoding: quoted-printable Content-length: 575 On 02/13/13 16:01, Pedro Alves wrote: > On 02/13/2013 03:21 PM, Marcus Shawcroft wrote: >>> I'll send you an aarch64 version of this patch, unless you've >>> already started porting the necessary bits over. >> >> We were just about to get started... but if you have a patch in hand >> that would be great! > > Here it is. Completely untested, of course. But hopefully not > too far off. Not far off at all; thanks! I have tested your patch and made some=20 further changes; please find the attached patch. The two patches=20 together seem to be working. Thanks, Yufeng --------------080606040102090201090602 Content-Type: text/x-patch; name=aarch64-fix.diff Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="aarch64-fix.diff" Content-length: 2039 diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c index 89055f4..846f156 100644 --- a/gdb/aarch64-linux-nat.c +++ b/gdb/aarch64-linux-nat.c @@ -336,7 +336,7 @@ struct aarch64_dr_update_callback_param unsigned int idx; }; =20 -/* Callback for linux_nat_iterate_watchpoint_lwps. Records the +/* Callback for iterate_over_lwps. Records the information about the change of one hardware breakpoint/watchpoint setting for the thread LWP. The information is passed in via PTR. @@ -410,12 +410,12 @@ aarch64_notify_debug_reg_change (const struct aarch64= _debug_reg_state *state, int is_watchpoint, unsigned int idx) { struct aarch64_dr_update_callback_param param; + ptid_t pid_ptid =3D pid_to_ptid (ptid_get_pid (inferior_ptid)); =20 param.is_watchpoint =3D is_watchpoint; param.idx =3D idx; =20 - linux_nat_iterate_watchpoint_lwps (debug_reg_change_callback, - (void *) ¶m); + iterate_over_lwps (pid_ptid, debug_reg_change_callback, (void *) ¶m); } =20 /* Print the values of the cached breakpoint/watchpoint registers. */ @@ -739,8 +739,8 @@ aarch64_linux_new_fork (struct lwp_info *parent, pid_t = child_pid) removed together. */ =20 parent_pid =3D ptid_get_pid (parent->ptid); - parent_state =3D i386_debug_reg_state (parent_pid); - child_state =3D i386_debug_reg_state (child_pid); + parent_state =3D aarch64_get_debug_reg_state (parent_pid); + child_state =3D aarch64_get_debug_reg_state (child_pid); *child_state =3D *parent_state; } =0C @@ -1540,10 +1540,6 @@ _initialize_aarch64_linux_nat (void) t->to_stopped_data_address =3D aarch64_linux_stopped_data_address; t->to_watchpoint_addr_within_range =3D aarch64_linux_watchpoint_addr_within_range; - if (aarch64_inferior_data =3D=3D NULL) - aarch64_inferior_data - =3D register_inferior_data_with_cleanup (NULL, - aarch64_inferior_data_cleanup); =20 /* Override the GNU/Linux inferior startup hook. */ super_post_startup_inferior =3D t->to_post_startup_inferior;= --------------080606040102090201090602--