Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Burgess <andrew.burgess@embecosm.com>
To: "taylor, david" <david.taylor@emc.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [PATCH] breakpoints / tracepoints and setting variables
Date: Fri, 05 Aug 2016 19:46:00 -0000	[thread overview]
Message-ID: <20160805194600.GM17743@embecosm.com> (raw)
In-Reply-To: <63F1AEE13FAE864586D589C671A6E18B06B3CE@MX203CL03.corp.emc.com>

* taylor, david <david.taylor@emc.com> [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 <dtaylor@emc.com> [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


      reply	other threads:[~2016-08-05 19:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-15 15:39 David Taylor
2016-07-15 16:56 ` taylor, david
2016-08-02 11:33 ` Andrew Burgess
2016-08-02 20:29   ` taylor, david
2016-08-05 19:46     ` Andrew Burgess [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160805194600.GM17743@embecosm.com \
    --to=andrew.burgess@embecosm.com \
    --cc=david.taylor@emc.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox