From 310afa2c6b6233f9d052692f20a900e5f3916440 Mon Sep 17 00:00:00 2001 From: Mikhail Khodjaiants Date: Wed, 12 Apr 2006 19:06:40 +0000 Subject: [PATCH] Bug 136206: Suppress Resumed events when processing solib events. --- debug/org.eclipse.cdt.debug.mi.core/ChangeLog | 7 +++++++ .../org/eclipse/cdt/debug/mi/core/cdi/EventManager.java | 8 ++++++-- .../mi/org/eclipse/cdt/debug/mi/core/RxThread.java | 2 ++ .../org/eclipse/cdt/debug/mi/core/command/Command.java | 8 ++++++++ .../mi/org/eclipse/cdt/debug/mi/core/event/MIEvent.java | 9 +++++++++ 5 files changed, 32 insertions(+), 2 deletions(-) diff --git a/debug/org.eclipse.cdt.debug.mi.core/ChangeLog b/debug/org.eclipse.cdt.debug.mi.core/ChangeLog index ef987df3fd4..b843b03a00c 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/ChangeLog +++ b/debug/org.eclipse.cdt.debug.mi.core/ChangeLog @@ -1,3 +1,10 @@ +2006-04-12 Mikhail Khodjaiants + Bug 136206: Suppress Resumed events when processing solib events. + * EventManager.java + * RxThread.java + * Command.java + * MIEvent.java + 2006-04-12 Mikhail Khodjaiants Bug 119740: allow to specify only a subset of shared objects that we want symbols to be loaded for. Support for deferred breakpoints. diff --git a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/EventManager.java b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/EventManager.java index 54f8a6715c9..e71f2668753 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/EventManager.java +++ b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/EventManager.java @@ -399,9 +399,10 @@ public class EventManager extends SessionObject implements ICDIEventManager, Obs break; case MIRunningEvent.RETURN: lastUserCommand = factory.createMIExecReturn(); - break; + break; case MIRunningEvent.CONTINUE: { MIExecContinue cont = factory.createMIExecContinue(); + cont.setQuiet(true); try { miSession.postCommand(cont); MIInfo info = cont.getMIInfo(); @@ -462,6 +463,7 @@ public class EventManager extends SessionObject implements ICDIEventManager, Obs if (miLevel >= 0) { MIStackSelectFrame selectFrame = factory.createMIStackSelectFrame(miLevel); MIExecFinish finish = factory.createMIExecFinish(); + finish.setQuiet(true); try { miSession.postCommand(selectFrame); miSession.postCommand(finish); @@ -473,6 +475,7 @@ public class EventManager extends SessionObject implements ICDIEventManager, Obs // for example the StopEventLib was on a different thread // redo the last command. Command cmd = lastUserCommand; + cmd.setQuiet(true); lastUserCommand = null; try { miSession.postCommand(cmd); @@ -483,6 +486,7 @@ public class EventManager extends SessionObject implements ICDIEventManager, Obs return true; } else if (lastUserCommand != null) { Command cmd = lastUserCommand; + cmd.setQuiet(true); lastUserCommand = null; try { miSession.postCommand(cmd); @@ -516,7 +520,7 @@ public class EventManager extends SessionObject implements ICDIEventManager, Obs currentTarget.setSupended(false); // Bailout early if we do not want to process any events. - if (!isAllowingProcessingEvents()) { + if (!isAllowingProcessingEvents() || !running.propagate()) { return false; } diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/RxThread.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/RxThread.java index 1212418290a..45e1fb8cc56 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/RxThread.java +++ b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/RxThread.java @@ -201,6 +201,8 @@ public class RxThread extends Thread { } session.getMIInferior().setRunning(); MIEvent event = new MIRunningEvent(session, id, type); + if (cmd.isQuiet()) + event.setPropagate(false); list.add(event); } else if ("exit".equals(state)) { //$NON-NLS-1$ // No need to do anything, terminate() will. diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/Command.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/Command.java index c6724487217..b7bd0891817 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/Command.java +++ b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/Command.java @@ -27,6 +27,7 @@ public abstract class Command int token = 0; MIOutput output; + boolean quiet = false; /** * A global counter for all command, the token @@ -104,4 +105,11 @@ public abstract class Command throw new MIException(mesg, details); } + public boolean isQuiet() { + return this.quiet; + } + + public void setQuiet( boolean quiet ) { + this.quiet = quiet; + } } diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIEvent.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIEvent.java index 686dfc04d88..238e1cf3054 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIEvent.java +++ b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MIEvent.java @@ -19,6 +19,7 @@ import org.eclipse.cdt.debug.mi.core.MISession; public abstract class MIEvent extends EventObject { int token; + boolean propagate = true; public MIEvent(MISession session, int token) { super(session); @@ -32,4 +33,12 @@ public abstract class MIEvent extends EventObject { public MISession getMISession() { return (MISession)getSource(); } + + public boolean propagate() { + return propagate; + } + + public void setPropagate( boolean propagate ) { + this.propagate = propagate; + } }