Home » Language IDEs » C / C++ IDE (CDT) » how eclipse synchronizes its views?
how eclipse synchronizes its views? [message #995653] |
Sun, 30 December 2012 14:47  |
Eclipse User |
|
|
|
hello, i have a general question about how eclipse synchronizes all its views.
when i debug c code in eclipse it is done with the gdb debugger, it means that the Variables view ,for example, is using the gdb as it's resource.
eclipse has many more views like 'registersView','DisassemblyView', 'BreakpointsView' etc.
my question is: if all the views are open and each on of them is using the gdb as its resource, how does eclipse synchronize each of the view's commands that are sent to the gdb?
how each of the views know when to send it's commands or wait till the other finishes it's own commands sending?
i have posted it in JDT, and have been told to post it here.
any help is appreciated.
thanks.
|
|
| |
Re: how eclipse synchronizes its views? [message #997120 is a reply to message #997085] |
Thu, 03 January 2013 14:45   |
Eclipse User |
|
|
|
hi, thank you so much for your reply.
i have read the source code of the variablesView, breakPointsView etc, and correct me if im wrong, but it seems that eclipse's views are using the IDebugContextListener interface to be noted that something has happened, which means the views receive a debugContextEvent, right?.
i have looked about the implemention of the fire function at the AbstractDebugContextProvider class, and i saw that for each listener that the function calls it's debugContextChanged(event) method it uses a SafeRunner which ,if i'm not wrong is like a thread, and if it works like a thread how can the views be synchronized?.
i thought that if there are ,for example, 5 views registered as debugContextListener, as long as the first view's debugContextChanged(event) method is'nt over the next view's debugContextChanged(event) method wo'nt be called, is'nt that how it works?
pleas correct me if im wrong about any of my assumptions.
thank you so much for your help.
|
|
| |
Re: how eclipse synchronizes its views? [message #997493 is a reply to message #997120] |
Mon, 07 January 2013 14:15   |
Eclipse User |
|
|
|
> i have read the source code of the variablesView, breakPointsView etc,
> and correct me if im wrong, but it seems that eclipse's views are using
> the IDebugContextListener interface to be noted that something has
> happened, which means the views receive a debugContextEvent, right?.
Yes, although that is not the only trigger.
The actual mechanism used in CDT is pretty complicated and I'm not familiar enough with it that I can explain well.
> i have looked about the implemention of the fire function at the
> AbstractDebugContextProvider class, and i saw that for each listener that
> the function calls it's debugContextChanged(event) method it uses a
> SafeRunner which ,if i'm not wrong is like a thread, and if it works
> like a thread how can the views be synchronized?.
I don't think it works like a thread. If you look at the implementation of SafeRunning.run, you will see all it does is catch exceptions, but runs the code in the current thread.
> i thought that if there are ,for example, 5 views registered as
> debugContextListener, as long as the first view's
> debugContextChanged(event) method is'nt over the next view's
> debugContextChanged(event) method wo'nt be called, is'nt that how it works?
Looks like it, yes.
Marc
|
|
| | | | | | |
Re: how eclipse synchronizes its views? [message #997808 is a reply to message #997734] |
Tue, 08 January 2013 14:35  |
Eclipse User |
|
|
|
thanks, marc.
i have searched about the plug-ins you gave me, but for some reason did'nt find information that explains the use or how to use the plug-ins to talk with the gdb.
i have lookd at the ICommandControl interface which seems to control the commands that are sent to the gdb, and control their result.
the problem is that there are many classes implementing this interface:
AbstractMIControl, BufferedCommandControl, GDBControl, GDBControl_7_0, MIVariableManager, PDACommandControl.
and i dont know which one i need, or how to send commands to the gdb through any of them.
can you help me on that matter?
thanks in advance, ben.
|
|
|
Goto Forum:
Current Time: Tue Jul 22 19:29:22 EDT 2025
Powered by FUDForum. Page generated in 0.04942 seconds
|