[PATCH] Re: bug in mi when setting breakpoint

Vladimir Prus ghost@cs.msu.su
Mon Jan 21 07:28:00 GMT 2008


On Sunday 20 January 2008 23:32:22 Nick Roberts wrote:
>  > > Running GDB in "non-stop mode" sounds highly ambitious and may happen a
>  > > long time in the future, if at all.
>  > 
>  > I'm not sure if you saw an announcement about non-stop mode project. It's
>  > rather near future.
> 
> You probably know more than me, it didn't give any timescales.

We expect that basic non-stop mode will be available in about three months
from now.

>  > > I'm talking about implementing a simple solution, for now.  Even if
>  > > non-stop mode does become a reality, it presumably won't be the default
>  > > behaviour, so it won't break existing front ends.
>  > 
>  > This does not mean that all MI commands should behave differently in
>  > non-stop mode.
> 
> They wouldn't.  I don't see why we should design MI commands around a feature
> that doesn't exist yet and will presumably be optional.

As I've mentioned, in non-stop mode, adding all breakpoint and then removing
undesired ones won't work. So, we need MI support for adding only needed
breakpoints. And once we implement such support, and use it in non-stop mode,
it won't make much sense to use some different mechanism in all-stop mode -- that
will only complicate logic without much benefit.

> 
>  > >  > I think it's more clear to set only those breakpoints that user want to
>  > >  > set, as opposed to setting all of them, and then removing undesired
>  > >  > ones.
>  > > 
>  > > Yes, but I still haven't see how you propose to do this.
>  > 
>  > -break-insert, in case when there are several overloaded functions, should
>  > return this:
>  > 
>  >    ^error,msg="Several overloaded functions found",
>  > 	functions=["int f(int)", "int f(double)"]
> 
> In Emacs, multiple breakpoints for overloaded functions would be specified
> from the GUD buffer.  How do you specify them graphically?

You present a list of overloaded function, with checkboxes next to each
name, that user would check and uncheck as he see fit.

>  > then, break-insert should have an -o parameter that specifies a list of
>  > overloaded functions to set breakpoints on:
>  > 
>  >   -break-insert -o 0 f
> 
> It all seems rather elaborate, but I don't feel that strongly about it as I'm
> not yet in a position to fully migrate Emacs to GDB/MI.

BTW, insert-all-and-remove-undesired would be as complex. First, you need to
detect that several breakpoints were inserted (-break-insert will return several
breakpoint ids in that case). Then, you better tell the user about this fact,
as he might not be looking at gdb console. And ideally, you'll actually pop up
a list of just inserted breakpoints and let the user delete those he does not
want -- which is just as complex for frontend as the scheme I've suggested.

- Volodya





More information about the Gdb-patches mailing list