From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27765 invoked by alias); 19 Dec 2013 07:00:39 -0000 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 Received: (qmail 27748 invoked by uid 89); 19 Dec 2013 07:00:38 -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-pb0-f44.google.com Received: from mail-pb0-f44.google.com (HELO mail-pb0-f44.google.com) (209.85.160.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 19 Dec 2013 07:00:37 +0000 Received: by mail-pb0-f44.google.com with SMTP id rq2so748537pbb.31 for ; Wed, 18 Dec 2013 23:00:36 -0800 (PST) X-Received: by 10.68.170.225 with SMTP id ap1mr38776559pbc.117.1387436435947; Wed, 18 Dec 2013 23:00:35 -0800 (PST) Received: from [192.168.1.51] (76-253-2-104.lightspeed.sntcca.sbcglobal.net. [76.253.2.104]) by mx.google.com with ESMTPSA id ef10sm6390162pac.1.2013.12.18.23.00.33 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 18 Dec 2013 23:00:34 -0800 (PST) References: <52B1C84F.4000102@arm.com> In-Reply-To: <52B1C84F.4000102@arm.com> Mime-Version: 1.0 (1.0) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Message-Id: <430CEAB7-7F7B-430D-9C37-75F87D1F65AC@gmail.com> Cc: "gdb-patches@sourceware.org" , Marcus Shawcroft From: pinskia@gmail.com Subject: Re: [PATCH, AArch64] Fix bug in hardware watchpoint/breakpoint handling Date: Thu, 19 Dec 2013 07:00:00 -0000 To: Yufeng Zhang X-IsSubscribed: yes X-SW-Source: 2013-12/txt/msg00738.txt.bz2 > On Dec 18, 2013, at 8:07 AM, Yufeng Zhang wrote: >=20 > Hi, >=20 > This patch fixes an AArch64 GDB bug in handling the hardware debug regist= ers. GDB calls ptrace to set hardware debug registers and it passes a full= -length "struct user_hwdebug_state" variable regardless of the number of ha= rdware debug registers available on a target. When there are fewer than 16= (the maximum number) hardware breakpoint/watchpoint registers on a target,= the kernel will complain about the gdb's request to set non-existing hardw= are debug registers. There will be an warning of "Unexpected error setting = hardware debug registers" when the inferior starts to run. >=20 > This patch fixes the issue by setting iov.iov_len with a value reflecting= the exact size in use. >=20 > OK for the mainline? I think this patch is wrong as the size that is passed is always just one e= lement as sizeof (regs.dbg_regs [count - 1]) is the same as sizeof (regs.db= g_regs [0]). This should have been sizeof (regs.dbg_regs [0])*count instead= .=20 Thanks, Andrew Pinski >=20 > Thanks. > Yufeng >=20 >=20 > gdb/ >=20 > * aarch64-linux-nat.c (aarch64_linux_set_debug_regs): Set > iov.iov_len with the real length in use. >=20 > gdb/gdbserver/ >=20 > * linux-aarch64-low.c (aarch64_linux_set_debug_regs): Set > iov.iov_len with the real length in use. >