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.


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?"? :-)

> 	* config/tc-arm.c (do_t_bkpt): If no operand is specified,
> 	assume a value of zero.
[...]
>     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...

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

Ditto do_bkpt().

    John


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