[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [cdt-debug-dev] First draft of CDI is posted.
|
>
> >>>>> "Mikhail" == Mikhail Khodjaiants <mikhailk@xxxxxxx> writes:
>
> Tom> It seems like there must also be an event indicating that a new
> Tom> breakpoint has been created. The user might create a breakpoint using
> Tom> "b main" in the console window, and this information must propagate to
> Tom> the UI.
>
> Mikhail> The result of "b main" can be used as a notification that a
> Mikhail> breakpoint is created.
>
> I don't understand.
>
> I thought what would happen is that `b main' would generate some
> output for the console window. It would also generate an MI event
> indicating that a new breakpoint has been made. I think this MI event
> has to propagate to the UI; I think we definitely want to avoid
> parsing whatever output goes to the console.
>
> Tom> Ok. But it is less useful to let the user set a breakpoint where
> Tom> it doesn't make sense to set one, for instance in the middle of a
> Tom> comment (or "#if 0" code). It seems to me that it would be more
> Tom> friendly, UI-wise, to present this information to the user when
> Tom> it is available.
>
> Mikhail> Agree. But this is a responsibility of the parser.
>
> The parser can't have the same information. At least, not unless it
> is fully integrated with the build. Some programs have big #ifdef
> regions -- and these are precisely the programs that benefit most from
> this feature.
>
Couple of points:
- When you set breakpoints, you may not have any debug session running.
The IDE/Eclipse will just register them as a marker/attribute on the
project. Once the debug session started the markers/attributes are
retreive and set. This has the advantage to give persistency across
sessions.
- Now, you are suggesting to provide also some validation when setting
the breakpoints, it can be done by using the
* parser/builder to see if the code is valid( for example setting
a breakpoint on empty line or a #if 0 block etc ...)
* If there is a debugging session running on the project some sort
of validation can be provided by asking the debugger.
etc ...
This a very interresting idea, we'll put it in the TODO/Feature list.
JDT(Java plugin) does something similar, for example when the breakpoint
are active it changes color.