[PATCH v2 4/4] gdb/mi: add a '--force-condition' flag to the '-break-insert' cmd

Aktemur, Tankut Baris tankut.baris.aktemur@intel.com
Wed Apr 21 12:06:08 GMT 2021


On Sunday, April 11, 2021 3:13 AM, Simon Marchi wrote:
> On 2021-04-10 9:06 p.m., Jonah Graham wrote:> On Thu, 8 Apr 2021 at 10:23, Tankut Baris
> Aktemur <
> > tankut.baris.aktemur@intel.com> wrote:
> >
> >> Add a '--force-condition' flag to the '-break-insert' command to be
> >> able to force conditions.  The '-break-condition' command directly
> >> uses the CLI's 'cond' command; hence, it already recognizes the
> >> '-force' flag.
> >>
> >> Because the '-dprintf-insert' command uses the same mechanism as the
> >> '-break-insert' command, it obtains the '--force-condition' flag, too.
> >>
> >
> > I don't know whether it matters, but in (MI) -break-condition, (CLI) break,
> > and (CLI) condition the force flag starts with one dash, but in (MI)
> > -break-insert/-dprintf-insert it starts with two dashes.
> >
> > I think there is a convention that the MI long option names start with two
> > dashes, so -break-condition should probably accept --force for consistency.
> > The CLI certainly doesn't seem to have such a consistency AFAIU.
> 
> Good point, I think we should make -break-condition use --force.  Since
> it wasn't released yet, we can still change it.

Thanks, Jonah, for testing the patches with Eclipse CDT.  In v3, I'll include the
change for --force vs. -force.

Simon, the MI's -break-condition command directly uses the CLI's cond command.
I chose the straightforward solution of skipping the first "-" if the
argument pointer starts with "--force".  This essentially makes both the CLI
and the MI command accept both "--force" and "-force".  I thought it'd be good
to have this flexibility.  The alternative is to parse the MI argument strictly
for "--".

Thanks.
-Baris


Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva  
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928


More information about the Gdb-patches mailing list