This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: RFA: Support ARM BKPT instruction without an argument.
- From: John Marshall <johnm at falch dot net>
- To: Nick Clifton <nickc at redhat dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Thu, 28 Nov 2002 12:46:09 +0100
- Subject: Re: RFA: Support ARM BKPT instruction without an argument.
- Organization: Falch.net
- References: <m34ra26ky2.fsf@north-pole.nickc.cambridge.redhat.com>
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