From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18935 invoked by alias); 5 Aug 2016 19:46:22 -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 18914 invoked by uid 89); 5 Aug 2016 19:46:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy=H*RU:sk:host86-, Hx-spam-relays-external:sk:host86-, H*r:sk:host86-, pseudo X-HELO: mail-wm0-f53.google.com Received: from mail-wm0-f53.google.com (HELO mail-wm0-f53.google.com) (74.125.82.53) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 05 Aug 2016 19:46:11 +0000 Received: by mail-wm0-f53.google.com with SMTP id q128so42941429wma.1 for ; Fri, 05 Aug 2016 12:46:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=mxndUz7TctM4kSmdIQX9zCPgxJjR+CS/YGyKBfExXt0=; b=ZhxDNi1QXUh6j/2go2O+eybodvMV/YSlWC9arDOY+3f/srbui4ZU9AsggpwvFf1q9E JqZ/k0TXZzV6OjQYUJ33qjI2Aoa+I9+IohBNX+b9RodMG4hEK8Vr7kXmvi1eV3eKY5KK 0TISVIH3ys/ZDUbSbiOrN6+MK8sXHGsaqr7yrBc67KkNbPSDYfhgvl7mE1FQ3X82OaKA M2VY4YAY1DoROpSo+OuBhV+745kOMA33B8GVDZToZGoomMliRc9UnmOTLV3V/YPXBhsB 9PrGjHTqHzRae0LX6w/0CJZ0uVVepaODiLoZrDZqRM6w8ZC+R9272BkokXFWH7geYIdR r+ow== X-Gm-Message-State: AEkooutcE0ZryopMaN5RU8xEERYOGRlk8IDckjJnWg9AdqI+84bfedQTc+FunvWR/QvoIQ== X-Received: by 10.28.169.82 with SMTP id s79mr5060523wme.87.1470426368494; Fri, 05 Aug 2016 12:46:08 -0700 (PDT) Received: from localhost (host86-165-30-37.range86-165.btcentralplus.com. [86.165.30.37]) by smtp.gmail.com with ESMTPSA id kc6sm19305045wjb.3.2016.08.05.12.46.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Aug 2016 12:46:07 -0700 (PDT) Date: Fri, 05 Aug 2016 19:46:00 -0000 From: Andrew Burgess To: "taylor, david" Cc: "gdb-patches@sourceware.org" Subject: Re: [PATCH] breakpoints / tracepoints and setting variables Message-ID: <20160805194600.GM17743@embecosm.com> References: <14037.1468597161@usendtaylorx2l> <20160802113324.GF17743@embecosm.com> <63F1AEE13FAE864586D589C671A6E18B06B3CE@MX203CL03.corp.emc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <63F1AEE13FAE864586D589C671A6E18B06B3CE@MX203CL03.corp.emc.com> X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] User-Agent: Mutt/1.6.1 (2016-04-27) X-IsSubscribed: yes X-SW-Source: 2016-08/txt/msg00096.txt.bz2 * taylor, david [2016-08-02 20:28:58 +0000]: > > > From: Andrew Burgess [mailto:andrew.burgess@embecosm.com] > > Sent: Tuesday, August 02, 2016 7:33 AM > > > I'm not a maintainer, so can't approve your patch, however, I made a > > few comments inline. > > Thanks. > > I am testing an updated patch that I believe addresses your issues > with one exception --- see below. Assuming it passes with no regressions, > Ill rebase it as one commit and post it. > > > Thanks, > > Andrew > > > > > > * David Taylor [2016-07-15 11:39:21 -0400]: > > > > diff --git a/gdb/ax-general.c b/gdb/ax-general.c > > > index 7f27a45..5406ab8 100644 > > > --- a/gdb/ax-general.c > > > +++ b/gdb/ax-general.c > > > @@ -323,6 +323,28 @@ ax_reg (struct agent_expr *x, int reg) > > > } > > > } > > > > > > +/* Assemble code to pop the top of stack and set register number REG > > > + to its value. */ > > > + > > > +void > > > +ax_setreg (struct agent_expr *x, int reg) > > > +{ > > > + if (reg >= gdbarch_num_regs (x->gdbarch)) > > > + error (_("register number '%d' is a pseudo register or is out of range"), > > reg); > > > + else > > > + { > > > + /* Make sure the register number is in range. */ > > > + if (reg < 0 || reg > 0xffff) > > > + error (_("GDB bug: ax-general.c (ax_reg): " > > > + "register number out of range")); > > > > If this indicates a GDB bug then you should switch to either > > internal_error or gdb_assert. If you choose internal_error then you > > can drop the 'GDB bug' prefix. > > If I counted correctly, there are 9 other, pre-existing, instances of > error (_("GDB bug: ..." in the file ax-general -- which is why I chose > to do this one that way. I can use internal_error if people feel that > is better than consistency with rest of the file. All of those occurrences of "GDB bug:... " date from the original commit of GDB, back in 1999, which predated internal_error. As I said, I'm not a maintainer, so they might disagree, but I think new commits should probably use internal_error. Obviously there's no obligation to fix older code that you're not touching Thanks, Andrew