This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils 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: RFA: Support ARM BKPT instruction without an argument.


Hi John,

> On Thu, Nov 28, 2002 at 10:35:33AM +0000, Nick Clifton wrote:
> >   Any objections to the following patch ?
> 
> Besides "sheesh, why's it so hard to type a zero?"? :-)

Indeed :-)

> >     if (my_get_expression (& expr, & str) || (expr.X_op != O_constant))
> >       {
> > +       if (expr.X_op == O_absent)
> > + 	/* As a convenience we allow 'bkpt' without an operand.  */
> > + 	end_of_line (str);
> > +       else
> >   	inst.error = _("bad or missing expression");
> >         return;
> >       }
> 
> Why does this want to return early from do_t_bkpt()? Allegedly
> expression() puts X_add_number=0 for O_absent, so wouldn't the rest of
> the function do the right thing if you just change the if condition to
> "my_get_expression(...) || !(expr.X_op==O_constant || expr.X_op==O_absent)"
> instead?  Seems cleaner...

Well personally I find that kind of boolean expression harder to read
than the original one, which is why I went for a separate test inside
the 'if' statement.  Plus with my way, the needless testing and
insertion of the number returned in exp.X_add_number is avoided.

> And the error message should perhaps change to just "bad expression".

Good point.  I will fix that.

Cheers
        Nick


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