This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
Re: Is ``break main if(1)'' legal?
- To: Fernando Nasser <fnasser at cygnus dot com>
- Subject: Re: Is ``break main if(1)'' legal?
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Fri, 24 Dec 1999 09:05:25 +1100
- CC: GDB Patches <gdb-patches at sourceware dot cygnus dot com>
- Organization: Cygnus Solutions
- References: <38572456.8C003027@cygnus.com> <3857CC59.35545D0C@cygnus.com>
Fernando Nasser wrote:
>
> Andrew Cagney wrote:
> >
> > (vs ``break main if (1)'')
> > Some parts of the code (decode_line_1()) think it is legal but other
> > parts (break_command_1()) don't.
> >
>
> (1) is a perfectly valid logical expression of "true". It makes no
> sense setting a conditional breakpoint to always true, but rejecting the
> expression as not valid is wrong.
>
> What is break_command_1() complaining about?
As Elena noted, it complains if I leave a space out. If you look at the
code you'll notice that some code requires a space yet other considers
it optional.
Andrew