Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-dev] Why does DebugPlugin need eventlisteners in order to schedule runnables?

Hi Anton,

That code was written a long time ago (2004) - - so it may be difficult to get any first hand knowledge of the answer. 

When the code was first written that job (EventDispatchJob) would have nothing to do if there were no listeners as the job was only dispatching events to listeners.

Then in 2007 - see comment in - the same job was used to handle the event queue and asyncExec queue.

My best guess is that no one noticed until now as in (almost!) all debug sessions there will be at least one listener.

I recommend you submit a bug & gerrit that simply removes the optimization in shouldSchedule. And as a workaround in the meantime, you could add a dummy listener (DebugPlugin.addDebugEventListener) in your TCF session.

I hope that helps and let us know if the above solves your problem.

Jonah Graham
Kichwa Coders

On Thu, 20 May 2021 at 14:40, Anton Bäckström <anton.backstrom@xxxxxxxxxxx> wrote:


I have a question about  the scheduling mechanism in org.eclipse.debug.core.DebugPlugin.
This code in particular:
public boolean shouldSchedule() {
            return !(isShuttingDown() || fEventListeners.isEmpty());

Why does the DebugPlugin need to have EventListeners registered in order to schedule runnables?

Our use case is a debugger based on TCF. It uses the RunToLineAdaper from CDT, with an adapter from TCF, in order to perform a Run To Line action.

In CDT, this code will, through a few steps, end up calling the shouldSchedule() above:

private void runInBackground(Runnable r) {

There are no EventListeners related to the DebugPlugin regarding Run To Line in TCF, which makes me confused.

Run To Line just so happens to work if, and only if, I have the Memory View open, since it has EventListeners registered on the DebugPlugin. But those listeners are unrelated to Run To Line.

Perhaps I need to reach out to the TCF or CDT mailing list, but for starters I would be happy if someone could explain why the shouldSchedule() function looks like it does.

Best regards,

Anton Bäckström
Cobham Gaisler

Cobham Gaisler AB, Kungsgatan 12, SE-411 19, GÖTEBORG, Sweden.
+46 (0) 31 775 8650,

Please consider the environment before printing this email

platform-dev mailing list
To unsubscribe from this list, visit

Back to the top