RFA: Support ARM BKPT instruction without an argument.

John Marshall johnm@falch.net
Thu Nov 28 03:47:00 GMT 2002


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



More information about the Binutils mailing list