From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26346 invoked by alias); 14 Feb 2014 00:06:31 -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 26335 invoked by uid 89); 14 Feb 2014 00:06:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ee0-f44.google.com Received: from mail-ee0-f44.google.com (HELO mail-ee0-f44.google.com) (74.125.83.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 14 Feb 2014 00:06:29 +0000 Received: by mail-ee0-f44.google.com with SMTP id c13so5378171eek.3 for ; Thu, 13 Feb 2014 16:06:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=H32/UWg0wjduQVyNS4DfHjP6MeOZFQj7gN5KIAf4S4o=; b=foOs491nLGiUAWnInQgRXKPMKoWDddfBZIo1Hu055ekq5jQSqE7VM8nX8YQZyrm4Gs Q4wNJvyM7yvckhOVviQUPOUE4wp1Khl3SqBdLtut0TU6jFkzAAMa+LgU0KnQwfgOniSv wC+Lzk7yZw617ytkPf6RVJLPviT8BOWicW+12EoWdTC+FYRHp689Vf/dvfUS75nX2EBK QJgPzveGI8yhvyhJ4rnLdbIpSY3KgDhS/5nBuEhlX3YxLyfp0OqmX4Gu/bODLo4mCPtK 9ds9rjdH0VEDWrhW/Ct3Iex7iWgJTkisTsCUpRmSAzqc9S5kmD97GQpH1pW+jG9GO51q jXbw== X-Gm-Message-State: ALoCoQlKsdYpCPHWdKrHd/X8VS0A6kn8+4fVFZPjca1sKY4uVwHVA3G/9ycs2TGnci2xukgvWMEL X-Received: by 10.15.94.135 with SMTP id bb7mr5102985eeb.48.1392336386565; Thu, 13 Feb 2014 16:06:26 -0800 (PST) Received: from [192.168.1.102] ([182.185.165.140]) by mx.google.com with ESMTPSA id d9sm12878863eei.9.2014.02.13.16.06.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Feb 2014 16:06:25 -0800 (PST) Message-ID: <52FD5E06.6010900@linaro.org> Date: Fri, 14 Feb 2014 00:06:00 -0000 From: Omair Javaid User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Pedro Alves 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> <52FD117B.8060401@redhat.com> In-Reply-To: <52FD117B.8060401@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2014-02/txt/msg00482.txt.bz2 On 13/02/2014 23:39, Pedro Alves wrote: >> +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." I was using iterate_over_lwps to return matching lwp_info struct and that happens only when if update_registers_callback returns 1. Its not being used anywhere now and can be removed. > > >> 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. OK will update and repost. > >> } >> 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. OK will update and repost. > >> } >> >> for (i = 0; i < count; ++i) >> if (!arm_hwbp_control_is_enabled (bpts[i].control))