From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20950 invoked by alias); 13 Feb 2014 18:40:14 -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 20939 invoked by uid 89); 13 Feb 2014 18:40:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 13 Feb 2014 18:40:12 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s1DIdwIp030890 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 13 Feb 2014 13:39:58 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s1DIduQC011098; Thu, 13 Feb 2014 13:39:56 -0500 Message-ID: <52FD117B.8060401@redhat.com> Date: Thu, 13 Feb 2014 18:40:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Omair Javaid CC: Yao Qi , gdb-patches@sourceware.org Subject: Re: [PATCH] Support for HWbreak/watchpoint accross fork/vfork on arm-native References: <1391119790-6580-1-git-send-email-omair.javaid@linaro.org> <52EAD0DC.506@linaro.org> <52F57EA2.20908@codesourcery.com> <52FB95D3.5000207@linaro.org> In-Reply-To: <52FB95D3.5000207@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-02/txt/msg00479.txt.bz2 > +static int > +update_registers_callback (struct lwp_info *lwp, void *arg) > +{ > + struct update_registers_data *data = (struct update_registers_data *) arg; > + > + /* Force iterate_over_lwps to return matched lwp_info*. */ > + if (arg == NULL) > + return 1; > + You don't seem to have addressed my comment here? It was: "I don't understand this. It seems nothing passes a NULL arg." > if (watchpoint) > { > count = arm_linux_get_hw_watchpoint_count (); > - bpts = t->wpts; > - dir = -1; > + bpts = arm_linux_get_debug_reg_state (pid)->wpts; > + if (count > MAX_WPTS) > + warning (_("arm-linux-gdb supports %d hardware watchpoints but target \ > + supports %d"), MAX_WPTS, count); Like in the Aarch64 port, add a 'count = MAX_WPTS' as well, otherwise GDB would access the arrays out of bounds when that happens. > } > else > { > count = arm_linux_get_hw_breakpoint_count (); > - bpts = t->bpts; > - dir = 1; > + bpts = arm_linux_get_debug_reg_state (pid)->bpts; > + if (count > MAX_BPTS) > + warning (_("arm-linux-gdb supports %d hardware breakpoints but target \ > + supports %d"), MAX_BPTS, count); Likewise. > } > > for (i = 0; i < count; ++i) > if (!arm_hwbp_control_is_enabled (bpts[i].control)) -- Pedro Alves