From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28678 invoked by alias); 16 Sep 2013 12:53:15 -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 28667 invoked by uid 89); 16 Sep 2013 12:53:14 -0000 Received: from mail-ie0-f180.google.com (HELO mail-ie0-f180.google.com) (209.85.223.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 16 Sep 2013 12:53:14 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,NO_RELAYS autolearn=ham version=3.3.2 X-HELO: mail-ie0-f180.google.com Received: by mail-ie0-f180.google.com with SMTP id u16so7298497iet.11 for ; Mon, 16 Sep 2013 05:53:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=xchYv86jqLxiwlL78/Zwnn/oXnBtzB7Uu9LQnQAkkMw=; b=Sv7Rf4jGMspX91QJum3p2Wehzo85Yx4EIUkjxxGqBNA7z7izJanaXCN7LxHGV0xm+1 WUpROFpCPb0OofNbYtcEidjZUpRNMyTFtvWKiuUJOTf27YCJihj2Oh9sDsub889RD0eF 5CSdFZ70KbakBxCUjHN55rUHDjZL9ryTGbWng3n8UZpjtklsUNBHzatoXeysRdsxsWQw /EojaSkn2JCS53E7Mz1Z0qQGQpXsJJxHzTFfPUsW6K5lwtzZadpwgeThg17TAPTQsodt +0n/pH7uLS+mzfBjYovi2OYlekWoqn2W3omlnGP+646BiPq1FlGYxE8XbJ1Wwn9xkQG0 jmtw== X-Gm-Message-State: ALoCoQm2n+Eh0twAnfE+xyq/bxZdYjRaFi1oH2wT1ZKsy/w2FC2kfB/cxwWvwiATpACKND9pBwhq MIME-Version: 1.0 X-Received: by 10.50.127.197 with SMTP id ni5mr6137228igb.54.1379335992246; Mon, 16 Sep 2013 05:53:12 -0700 (PDT) Received: by 10.64.235.65 with HTTP; Mon, 16 Sep 2013 05:53:12 -0700 (PDT) In-Reply-To: <5236FD06.9070807@redhat.com> References: <87k3kbbsbz.fsf@igel.home> <5236FD06.9070807@redhat.com> Date: Mon, 16 Sep 2013 12:53:00 -0000 Message-ID: Subject: Re: [PATCH/AARCH64] Fix hardware break points From: Will Newton To: Pedro Alves Cc: Andrew Pinski , Andreas Schwab , "gdb-patches@sourceware.org" Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes X-SW-Source: 2013-09/txt/msg00441.txt.bz2 On 16 September 2013 13:43, Pedro Alves wrote: > On 09/12/2013 08:15 AM, Andrew Pinski wrote: >> On Tue, Sep 10, 2013 at 7:37 AM, Will Newton wrote: >>> On 27 July 2013 23:42, Andrew Pinski wrote: >>> >>> Hi Andrew, >>> >>>> On Sat, Jul 27, 2013 at 2:34 PM, Andreas Schwab wrote: >>>>> Andrew Pinski writes: >>>>> >>>>>> OK? Built and tested on aarch64-linux-gnu with no regressions. >>>>> >>>>> Did you? >>>>> >>>>>> + memset (®s, 0, size(regs)); >>>> >>>> This is what I get for copying and pasting from one source file to another. >>>> >>>> Here is the fixed one which was definitely tested. >>> >>> What's the status of this patch? It seems like it fixes real problems >>> people are seeing in the field. > >> After not much thought, I decided this was an obvious patch as regs is >> used uninitialized otherwise when passed to ptrace. > > Leaves me wondering what field of regs other than regs.dbg_regs is > the kernel actually looking at then for NT_ARM_HW_WATCH/NT_ARM_HW_BREAK, > given regs.dbg_regs _is_ initialized: The dbg_info field is probably the important one, so it may be possible to optimize the clearing slightly but I'm not sure if it's worth it. > for (i = 0; i < count; i++) > { > regs.dbg_regs[i].addr = addr[i]; > regs.dbg_regs[i].ctrl = ctrl[i]; > } > > if (ptrace (PTRACE_SETREGSET, tid, > watchpoint ? NT_ARM_HW_WATCH : NT_ARM_HW_BREAK, > (void *) &iov)) > > Makes me wonder whether the issue is that "count" isn't right for > the running kernel. > > Was a patch for gdbserver ever posted/committed? AFAICS, > gdbserver's aarch64_linux_set_debug_regs is an exact copy of gdb's. I posted a patch for that here: https://sourceware.org/ml/gdb-patches/2013-09/msg00381.html -- Will Newton Toolchain Working Group, Linaro