This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] breakpoints / tracepoints and setting variables


* 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]