From fea4e251847fb1d60ecdd190879e69e899124cf7 Mon Sep 17 00:00:00 2001 From: Alain Magloire Date: Sun, 17 Oct 2004 21:26:11 +0000 Subject: [PATCH] 2004-10-17 Alain Magloire Remove deprecated method in CDI adjust the implementation. --- debug/org.eclipse.cdt.debug.mi.core/ChangeLog | 3 ++ .../debug/mi/core/cdi/BreakpointManager.java | 10 ---- .../cdt/debug/mi/core/cdi/EventManager.java | 3 +- .../debug/mi/core/cdi/ExpressionManager.java | 42 +++++++++++------ .../cdt/debug/mi/core/cdi/Manager.java | 13 +++++- .../cdt/debug/mi/core/cdi/MemoryManager.java | 25 ++-------- .../cdt/debug/mi/core/cdi/ProcessManager.java | 10 +--- .../debug/mi/core/cdi/RegisterManager.java | 18 ++------ .../cdt/debug/mi/core/cdi/Session.java | 17 +++---- .../mi/core/cdi/SharedLibraryManager.java | 46 +++++++++++-------- .../cdt/debug/mi/core/cdi/SignalManager.java | 12 ++--- .../cdt/debug/mi/core/cdi/SourceManager.java | 37 +++++++++------ .../cdt/debug/mi/core/cdi/ThreadManager.java | 6 +-- .../debug/mi/core/cdi/VariableManager.java | 21 ++++++--- .../debug/mi/core/cdi/model/Breakpoint.java | 2 +- .../mi/core/cdi/model/Exceptionpoint.java | 1 - .../cdt/debug/mi/core/cdi/model/Target.java | 3 -- .../cdt/debug/mi/core/cdi/model/Variable.java | 18 ++++---- 18 files changed, 138 insertions(+), 149 deletions(-) diff --git a/debug/org.eclipse.cdt.debug.mi.core/ChangeLog b/debug/org.eclipse.cdt.debug.mi.core/ChangeLog index 61683d16825..ab20941f7fb 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/ChangeLog +++ b/debug/org.eclipse.cdt.debug.mi.core/ChangeLog @@ -1,3 +1,6 @@ +2004-10-17 Alain Magloire + Remove deprecated method in CDI adjust the implementation. + 2004-10-15 Alain Magloire The way we do breakpoints is changing. gdb does not have diff --git a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java index 458d9bfbdba..2d2128f113d 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java +++ b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java @@ -317,16 +317,6 @@ public class BreakpointManager extends Manager { } /** - * @deprecated - * @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpointManager#update() - */ - public void update() throws CDIException { - Target target = (Target)getSession().getCurrentTarget(); - update(target); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpointManager#update() */ public void update(Target target) throws CDIException { MISession miSession = target.getMISession(); 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 db39964660d..9f7ab27f563 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 @@ -150,7 +150,8 @@ public class EventManager extends SessionObject implements ICDIEventManager, Obs // Something change we do not know what // Let the signal manager handle it with an update(). try { - session.getSignalManager().update(); + SignalManager sMgr = (SignalManager)session.getSignalManager(); + sMgr.update(currentTarget); } catch (CDIException e) { } } else { diff --git a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/ExpressionManager.java b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/ExpressionManager.java index dd36f9e6cc8..8a8bd435789 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/ExpressionManager.java +++ b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/ExpressionManager.java @@ -11,6 +11,7 @@ package org.eclipse.cdt.debug.mi.core.cdi; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.Hashtable; import java.util.List; @@ -94,16 +95,26 @@ public class ExpressionManager extends Manager implements ICDIExpressionManager{ } /** + * This should bo remove to evaluate an expression we nee a context. + * + * @deprecated * @see org.eclipse.cdt.debug.core.cdi.ICDIExpressionManager#createExpression(String) */ public ICDIExpression createExpression(String name) throws CDIException { - Target target = (Target)getSession().getCurrentTarget(); + Target target = ((Session)getSession()).getCurrentTarget(); return createExpression(target, name); } + /** + * This should bo remove to evaluate an expression we nee a context. + * + * @deprecated + * @see org.eclipse.cdt.debug.core.cdi.ICDIExpressionManager#createExpression(String) + */ public ICDIExpression createExpression(Target target, String name) throws CDIException { Expression expression = null; - ICDITarget currentTarget = getSession().getCurrentTarget(); - getSession().setCurrentTarget(target); + Session session = (Session)getSession(); + Target currentTarget = session.getCurrentTarget(); + session.setCurrentTarget(target); try { MISession mi = target.getMISession(); CommandFactory factory = mi.getCommandFactory(); @@ -120,7 +131,7 @@ public class ExpressionManager extends Manager implements ICDIExpressionManager{ } catch (MIException e) { throw new MI2CDIException(e); } finally { - getSession().setCurrentTarget(currentTarget); + session.setCurrentTarget(currentTarget); } return expression; } @@ -132,8 +143,10 @@ public class ExpressionManager extends Manager implements ICDIExpressionManager{ Expression expression = null; Session session = (Session)getSession(); Target target = (Target)frame.getTarget(); + Target currentTarget = session.getCurrentTarget(); ICDIThread currentThread = target.getCurrentThread(); ICDIStackFrame currentFrame = currentThread.getCurrentStackFrame(); + session.setCurrentTarget(target); target.setCurrentThread(frame.getThread(), false); frame.getThread().setCurrentStackFrame(frame, false); try { @@ -152,6 +165,7 @@ public class ExpressionManager extends Manager implements ICDIExpressionManager{ } catch (MIException e) { throw new MI2CDIException(e); } finally { + session.setCurrentTarget(currentTarget); target.setCurrentThread(currentThread, false); currentThread.setCurrentStackFrame(currentFrame, false); } @@ -159,11 +173,19 @@ public class ExpressionManager extends Manager implements ICDIExpressionManager{ } /** + * @deprecated * @see org.eclipse.cdt.debug.core.cdi.ICDIExpressionManager#getExpressions() */ public ICDIExpression[] getExpressions() throws CDIException { - Target target = (Target)getSession().getCurrentTarget(); - return getExpressions(target); + ICDITarget[] targets = getSession().getTargets(); + List list = new ArrayList(targets.length); + for (int i = 0; i < targets.length; i++) { + if (targets[i] instanceof Target) { + ICDIExpression[] exprs = getExpressions((Target)targets[i]); + list.addAll(Arrays.asList(exprs)); + } + } + return (ICDIExpression[]) list.toArray(new ICDIExpression[list.size()]); } public ICDIExpression[] getExpressions(Target target) throws CDIException { @@ -209,14 +231,6 @@ public class ExpressionManager extends Manager implements ICDIExpressionManager{ return null; } - /** - * @deprecated - * @see org.eclipse.cdt.debug.core.cdi.ICDIExpressionManager#update() - */ - public void update() throws CDIException { - Target target = (Target)getSession().getCurrentTarget(); - update(target); - } public void update(Target target) throws CDIException { List eventList = new ArrayList(); MISession mi = target.getMISession(); diff --git a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/Manager.java b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/Manager.java index 93c5a497646..1616ddd1dae 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/Manager.java +++ b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/Manager.java @@ -14,6 +14,8 @@ package org.eclipse.cdt.debug.mi.core.cdi; import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.ICDIManager; import org.eclipse.cdt.debug.core.cdi.event.ICDIEvent; +import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; +import org.eclipse.cdt.debug.mi.core.cdi.model.Target; /** * Manager @@ -42,10 +44,19 @@ public abstract class Manager extends SessionObject implements ICDIManager { return autoUpdate; } + protected abstract void update (Target target) throws CDIException; + /* (non-Javadoc) * @see org.eclipse.cdt.debug.core.cdi.impl.Manager#update() */ - public abstract void update() throws CDIException; + public void update() throws CDIException { + ICDITarget[] targets = getSession().getTargets(); + for (int i = 0; i < targets.length; ++i) { + if (targets[i] instanceof Target) { + update((Target)targets[i]); + } + } + } /* (non-Javadoc) * @see org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener#handleDebugEvents(org.eclipse.cdt.debug.core.cdi.event.ICDIEvent[]) diff --git a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/MemoryManager.java b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/MemoryManager.java index a79a53faf48..cb168e4518b 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/MemoryManager.java +++ b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/MemoryManager.java @@ -21,7 +21,6 @@ import java.util.Map; import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.ICDIMemoryManager; import org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock; -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; import org.eclipse.cdt.debug.mi.core.MIException; import org.eclipse.cdt.debug.mi.core.MIFormat; import org.eclipse.cdt.debug.mi.core.MISession; @@ -62,24 +61,6 @@ public class MemoryManager extends Manager implements ICDIMemoryManager { * are registered and fired any event if changed. * Note: Frozen blocks are not updated. * - * @deprecated use update(Target) - * @see org.eclipse.cdt.debug.core.cdi.ICDIMemoryManager#createMemoryBlock(long, int) - */ - public void update() { - Session session = (Session)getSession(); - ICDITarget[] targets = session.getTargets(); - for (int i = 0; i < targets.length; ++i) { - update((Target)targets[i]); - } - } - - /** - * This method will be call by the eventManager.processSuspended() every time the - * inferior comes to a Stop/Suspended. It will allow to look at the blocks that - * are registered and fired any event if changed. - * Note: Frozen blocks are not updated. - * - * @see org.eclipse.cdt.debug.core.cdi.ICDIMemoryManager#createMemoryBlock(long, int) */ public void update(Target target) { MISession miSession = target.getMISession(); @@ -189,7 +170,7 @@ public class MemoryManager extends Manager implements ICDIMemoryManager { */ public ICDIMemoryBlock createMemoryBlock(String address, int length) throws CDIException { Session session = (Session)getSession(); - return createMemoryBlock((Target)session.getCurrentTarget(), address, length); + return createMemoryBlock(session.getCurrentTarget(), address, length); } public ICDIMemoryBlock createMemoryBlock(Target target, String address, int length) throws CDIException { MIDataReadMemoryInfo info = createMIDataReadMemoryInfo(target.getMISession(), address, length); @@ -205,7 +186,7 @@ public class MemoryManager extends Manager implements ICDIMemoryManager { * @see org.eclipse.cdt.debug.core.cdi.ICDIMemoryManager#getBlocks() */ public ICDIMemoryBlock[] getMemoryBlocks() throws CDIException { - Target target = (Target)getSession().getCurrentTarget(); + Target target = ((Session)getSession()).getCurrentTarget(); return getMemoryBlocks(target); } public MemoryBlock[] getMemoryBlocks(MISession miSession) { @@ -223,7 +204,7 @@ public class MemoryManager extends Manager implements ICDIMemoryManager { * @see org.eclipse.cdt.debug.core.cdi.ICDIMemoryManager#removeAllBlocks() */ public void removeAllBlocks() throws CDIException { - Target target = (Target)getSession().getCurrentTarget(); + Target target = ((Session)getSession()).getCurrentTarget(); removeAllBlocks(target); } diff --git a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/ProcessManager.java b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/ProcessManager.java index 7ad78295373..77e175c245e 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/ProcessManager.java +++ b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/ProcessManager.java @@ -12,7 +12,6 @@ import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; import org.eclipse.cdt.debug.mi.core.MISession; import org.eclipse.cdt.debug.mi.core.cdi.model.Target; import org.eclipse.cdt.debug.mi.core.event.MIInferiorCreatedEvent; -import org.eclipse.cdt.debug.mi.core.event.MIInferiorExitEvent; /** */ @@ -88,7 +87,6 @@ public class ProcessManager extends Manager { } /** - * @deprecated * @return */ public Target getCurrentTarget() { @@ -96,17 +94,13 @@ public class ProcessManager extends Manager { } /** - * @deprecated * @param current */ public void setCurrentTarget(Target current) { currentTarget = current; } - /** - * @deprecated - * @see org.eclipse.cdt.derug.core.cdi.ICDIManager#update() - */ - public void update() throws CDIException { + + public void update(Target target) throws CDIException { } } diff --git a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/RegisterManager.java b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/RegisterManager.java index eddf5cbd759..4feea8ca077 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/RegisterManager.java +++ b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/RegisterManager.java @@ -20,7 +20,6 @@ import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.ICDIRegisterManager; import org.eclipse.cdt.debug.core.cdi.model.ICDIRegister; import org.eclipse.cdt.debug.core.cdi.model.ICDIRegisterObject; -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; import org.eclipse.cdt.debug.mi.core.MIException; import org.eclipse.cdt.debug.mi.core.MISession; import org.eclipse.cdt.debug.mi.core.cdi.model.Register; @@ -65,12 +64,13 @@ public class RegisterManager extends Manager implements ICDIRegisterManager { * @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#getRegisterObjects() */ public ICDIRegisterObject[] getRegisterObjects() throws CDIException { - Target target = (Target)getSession().getCurrentTarget(); + Target target = ((Session)getSession()).getCurrentTarget(); return getRegisterObjects(target); } public ICDIRegisterObject[] getRegisterObjects(Target target) throws CDIException { - ICDITarget currentTarget = getSession().getCurrentTarget(); - getSession().setCurrentTarget(target); + Session session = (Session)getSession(); + Target currentTarget = session.getCurrentTarget(); + session.setCurrentTarget(target); MISession mi = target.getMISession(); CommandFactory factory = mi.getCommandFactory(); MIDataListRegisterNames registers = factory.createMIDataListRegisterNames(); @@ -92,7 +92,7 @@ public class RegisterManager extends Manager implements ICDIRegisterManager { } catch (MIException e) { throw new MI2CDIException(e); } finally { - getSession().setCurrentTarget(currentTarget); + session.setCurrentTarget(currentTarget); } } @@ -191,14 +191,6 @@ public class RegisterManager extends Manager implements ICDIRegisterManager { return null; } - /** - * @deprecated - * Call the by the EventManager when the target is suspended. - */ - public void update() throws CDIException { - Target target = (Target)getSession().getCurrentTarget(); - update(target); - } public void update(Target target) throws CDIException { MISession mi = target.getMISession(); CommandFactory factory = mi.getCommandFactory(); diff --git a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/Session.java b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/Session.java index c295ec461f7..28d4f6456cb 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/Session.java +++ b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/Session.java @@ -105,11 +105,7 @@ public class Session implements ICDISession, ICDISessionObject { return pMgr.getTarget(miSession); } - /** - * @deprecated - * @see org.eclipse.cdt.debug.core.cdi.ICDISession#getCurrentTarget() - */ - public ICDITarget getCurrentTarget() { + public Target getCurrentTarget() { ProcessManager pMgr = getProcessManager(); return pMgr.getCurrentTarget(); } @@ -199,13 +195,12 @@ public class Session implements ICDISession, ICDISessionObject { /** * @see org.eclipse.cdt.debug.core.cdi.ICDISession#setCurrentTarget() */ - public void setCurrentTarget(ICDITarget target) throws CDIException { + public void setCurrentTarget(Target target) throws CDIException { ProcessManager pMgr = getProcessManager(); - if (target instanceof Target) { - pMgr.setCurrentTarget((Target)target); - } else { - throw new CDIException(CdiResources.getString("cdi.Session.Unknown_target")); //$NON-NLS-1$ - } + pMgr.setCurrentTarget((Target)target); +// } else { +// throw new CDIException(CdiResources.getString("cdi.Session.Unknown_target")); //$NON-NLS-1$ +// } } /** diff --git a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/SharedLibraryManager.java b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/SharedLibraryManager.java index c0cf8640e8f..efefcbf36d8 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/SharedLibraryManager.java +++ b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/SharedLibraryManager.java @@ -11,7 +11,6 @@ package org.eclipse.cdt.debug.mi.core.cdi; -import java.math.BigInteger; import java.util.ArrayList; import java.util.Collections; import java.util.Hashtable; @@ -85,14 +84,6 @@ public class SharedLibraryManager extends Manager implements ICDISharedLibraryMa return miLibs; } - /** - * @deprecated - * @see org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager#update() - */ - public void update() throws CDIException { - Target target = (Target)getSession().getCurrentTarget(); - update(target); - } public void update(Target target) throws CDIException { MISession mi = target.getMISession(); List eventList = updateState(target); @@ -190,10 +181,11 @@ public class SharedLibraryManager extends Manager implements ICDISharedLibraryMa } /** + * @deprecated * @see org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager#setSharedLibraryPaths(String[]) */ public void setAutoLoadSymbols(boolean set) throws CDIException { - Target target = (Target)getSession().getCurrentTarget(); + Target target = ((Session)getSession()).getCurrentTarget(); setAutoLoadSymbols(target, set); } public void setAutoLoadSymbols(Target target, boolean set) throws CDIException { @@ -209,9 +201,10 @@ public class SharedLibraryManager extends Manager implements ICDISharedLibraryMa } /** + * @deprecated */ public boolean isAutoLoadSymbols() throws CDIException { - Target target = (Target)getSession().getCurrentTarget(); + Target target = ((Session)getSession()).getCurrentTarget(); return isAutoLoadSymbols(target); } public boolean isAutoLoadSymbols(Target target) throws CDIException { @@ -231,8 +224,13 @@ public class SharedLibraryManager extends Manager implements ICDISharedLibraryMa return false; } + /** + * @deprecated + * @param set + * @throws CDIException + */ public void setStopOnSolibEvents(boolean set) throws CDIException { - Target target = (Target)getSession().getCurrentTarget(); + Target target = ((Session)getSession()).getCurrentTarget(); setStopOnSolibEvents(target, set); } public void setStopOnSolibEvents(Target target, boolean set) throws CDIException { @@ -247,8 +245,13 @@ public class SharedLibraryManager extends Manager implements ICDISharedLibraryMa } } + /** + * @deprecated + * @return + * @throws CDIException + */ public boolean isStopOnSolibEvents() throws CDIException { - Target target = (Target)getSession().getCurrentTarget(); + Target target = ((Session)getSession()).getCurrentTarget(); return isStopOnSolibEvents(target); } public boolean isStopOnSolibEvents(Target target) throws CDIException { @@ -269,10 +272,11 @@ public class SharedLibraryManager extends Manager implements ICDISharedLibraryMa } /** + * @deprecated * @see org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager#setSharedLibraryPaths(String[]) */ public void setSharedLibraryPaths(String[] libPaths) throws CDIException { - Target target = (Target)getSession().getCurrentTarget(); + Target target = ((Session)getSession()).getCurrentTarget(); setSharedLibraryPaths(target, libPaths); } public void setSharedLibraryPaths(Target target, String[] libPaths) throws CDIException { @@ -288,10 +292,11 @@ public class SharedLibraryManager extends Manager implements ICDISharedLibraryMa } /** + * @deprecated * @see org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager#getSharedLibraryPaths() */ public String[] getSharedLibraryPaths() throws CDIException { - Target target = (Target)getSession().getCurrentTarget(); + Target target = ((Session)getSession()).getCurrentTarget(); return getSharedLibraryPaths(target); } public String[] getSharedLibraryPaths(Target target) throws CDIException { @@ -308,10 +313,11 @@ public class SharedLibraryManager extends Manager implements ICDISharedLibraryMa } /** + * @deprecated * @see org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager#getSharedLibraries() */ public ICDISharedLibrary[] getSharedLibraries() throws CDIException { - Target target = (Target)getSession().getCurrentTarget(); + Target target = ((Session)getSession()).getCurrentTarget(); return getSharedLibraries(target); } public ICDISharedLibrary[] getSharedLibraries(Target target) throws CDIException { @@ -323,10 +329,11 @@ public class SharedLibraryManager extends Manager implements ICDISharedLibraryMa } /** + * @deprecated * @see org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager#loadSymbols() */ public void loadSymbols() throws CDIException { - Target target = (Target)getSession().getCurrentTarget(); + Target target = ((Session)getSession()).getCurrentTarget(); loadSymbols(target); } public void loadSymbols(Target target) throws CDIException { @@ -342,14 +349,15 @@ public class SharedLibraryManager extends Manager implements ICDISharedLibraryMa } catch (MIException e) { throw new MI2CDIException(e); } - update(); + update(target); } /** + * @deprecated * @see org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager#loadSymbols(ICDISharedLibrary[]) */ public void loadSymbols(ICDISharedLibrary[] libs) throws CDIException { - Target target = (Target)getSession().getCurrentTarget(); + Target target = ((Session)getSession()).getCurrentTarget(); loadSymbols(target, libs); } public void loadSymbols(Target target, ICDISharedLibrary[] libs) throws CDIException { diff --git a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/SignalManager.java b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/SignalManager.java index e0fd4e92b0c..3a99cf167f3 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/SignalManager.java +++ b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/SignalManager.java @@ -169,10 +169,11 @@ public class SignalManager extends Manager implements ICDISignalManager { } /** + * @deprecated * @see org.eclipse.cdt.debug.core.cdi.ICDISignalManager#getSignals() */ public ICDISignal[] getSignals() throws CDIException { - Target target = (Target)getSession().getCurrentTarget(); + Target target = ((Session)getSession()).getCurrentTarget(); return getSignals(target); } @@ -187,14 +188,7 @@ public class SignalManager extends Manager implements ICDISignalManager { } return EMPTY_SIGNALS; } - /** - * @deprecated - * @see org.eclipse.cdt.debug.core.cdi.ICDISignalManager#update() - */ - public void update() throws CDIException { - Target target = (Target)getSession().getCurrentTarget(); - update(target); - } + public void update(Target target) throws CDIException { MISession miSession = target.getMISession(); MISigHandle[] miSigs = getMISignals(miSession); diff --git a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/SourceManager.java b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/SourceManager.java index d329a6ee7d1..ee4cf6a4019 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/SourceManager.java +++ b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/SourceManager.java @@ -72,10 +72,11 @@ public class SourceManager extends Manager implements ICDISourceManager { } /** + * @deprecated * @see org.eclipse.cdt.debug.core.cdi.ICDISourceManager#addSourcePaths(String[]) */ public void addSourcePaths(String[] dirs) throws CDIException { - Target target = (Target)getSession().getCurrentTarget(); + Target target = ((Session)getSession()).getCurrentTarget(); addSourcePaths(target, dirs); } public void addSourcePaths(Target target, String[] dirs) throws CDIException { @@ -92,10 +93,11 @@ public class SourceManager extends Manager implements ICDISourceManager { } /** + * @deprecated * @see org.eclipse.cdt.debug.core.cdi.ICDISourceManager#getSourcePaths() */ public String[] getSourcePaths() throws CDIException { - Target target = (Target)getSession().getCurrentTarget(); + Target target = ((Session)getSession()).getCurrentTarget(); return getSourcePaths(target); } public String[] getSourcePaths(Target target) throws CDIException { @@ -112,10 +114,11 @@ public class SourceManager extends Manager implements ICDISourceManager { } /** + * @deprecated * @see org.eclipse.cdt.debug.core.cdi.ICDISourceManager#getInstructions(String, int, int) */ public ICDIInstruction[] getInstructions(String filename, int linenum, int lines) throws CDIException { - Target target = (Target)getSession().getCurrentTarget(); + Target target = ((Session)getSession()).getCurrentTarget(); return getInstructions(target, filename, linenum, lines); } public ICDIInstruction[] getInstructions(Target target, String filename, int linenum, int lines) throws CDIException { @@ -144,10 +147,11 @@ public class SourceManager extends Manager implements ICDISourceManager { } /** + * @deprecated * @see org.eclipse.cdt.debug.core.cdi.ICDISourceManager#getInstructions(long, long) */ public ICDIInstruction[] getInstructions(BigInteger start, BigInteger end) throws CDIException { - Target target = (Target)getSession().getCurrentTarget(); + Target target = ((Session)getSession()).getCurrentTarget(); return getInstructions(target, start, end); } public ICDIInstruction[] getInstructions(Target target, BigInteger start, BigInteger end) throws CDIException { @@ -172,10 +176,11 @@ public class SourceManager extends Manager implements ICDISourceManager { } /** + * @deprecated * @see org.eclipse.cdt.debug.core.cdi.ICDISourceManager#getMixedInstructions(String, int, int) */ public ICDIMixedInstruction[] getMixedInstructions(String filename, int linenum, int lines) throws CDIException { - Target target = (Target)getSession().getCurrentTarget(); + Target target = ((Session)getSession()).getCurrentTarget(); return getMixedInstructions(target, filename, linenum, lines); } public ICDIMixedInstruction[] getMixedInstructions(Target target, String filename, int linenum, int lines) throws CDIException { @@ -197,17 +202,18 @@ public class SourceManager extends Manager implements ICDISourceManager { } /** + * @deprecated * @see org.eclipse.cdt.debug.core.cdi.ICDISourceManager#getMixedInstructions(String, int) */ public ICDIMixedInstruction[] getMixedInstructions(String filename, int linenum) throws CDIException { return getMixedInstructions(filename, linenum, -1); } - /** + * @deprecated * @see org.eclipse.cdt.debug.core.cdi.ICDISourceManager#getMixedInstructions(long, long) */ public ICDIMixedInstruction[] getMixedInstructions(BigInteger start, BigInteger end) throws CDIException { - Target target = (Target)getSession().getCurrentTarget(); + Target target = ((Session)getSession()).getCurrentTarget(); return getMixedInstructions(target, start, end); } public ICDIMixedInstruction[] getMixedInstructions(Target target, BigInteger start, BigInteger end) throws CDIException { @@ -231,13 +237,6 @@ public class SourceManager extends Manager implements ICDISourceManager { } } - /** - * @deprecated - * @see org.eclipse.cdt.debug.core.cdi.ICDISourceManager#update() - */ - public void update() throws CDIException { - } - public void update(Target target) throws CDIException { } @@ -457,9 +456,12 @@ public class SourceManager extends Manager implements ICDISourceManager { } public String getDetailTypeName(ICDIStackFrame frame, String typename) throws CDIException { + Session session = (Session)getSession(); Target target = (Target)frame.getTarget(); + Target currentTarget = session.getCurrentTarget(); ICDIThread currentThread = target.getCurrentThread(); ICDIStackFrame currentFrame = currentThread.getCurrentStackFrame(); + session.setCurrentTarget(target); target.setCurrentThread(frame.getThread(), false); frame.getThread().setCurrentStackFrame(frame, false); try { @@ -475,16 +477,20 @@ public class SourceManager extends Manager implements ICDISourceManager { } catch (MIException e) { throw new MI2CDIException(e); } finally { + session.setCurrentTarget(currentTarget); target.setCurrentThread(currentThread, false); currentThread.setCurrentStackFrame(currentFrame, false); } } public String getTypeName(VariableObject vo, String variable) throws CDIException { - Target target = (Target)vo.getTarget(); + Session session = (Session)getSession(); ICDIStackFrame frame = vo.getStackFrame(); + Target target = (Target)vo.getTarget(); + Target currentTarget = session.getCurrentTarget(); ICDIThread currentThread = null; ICDIStackFrame currentFrame = null; + session.setCurrentTarget(target); if (frame != null) { currentThread = target.getCurrentThread(); currentFrame = currentThread.getCurrentStackFrame(); @@ -504,6 +510,7 @@ public class SourceManager extends Manager implements ICDISourceManager { } catch (MIException e) { throw new MI2CDIException(e); } finally { + session.setCurrentTarget(currentTarget); if (currentThread != null) { target.setCurrentThread(currentThread, false); } diff --git a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/ThreadManager.java b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/ThreadManager.java index 1af55a02742..8e844b8e1aa 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/ThreadManager.java +++ b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/ThreadManager.java @@ -106,11 +106,7 @@ public class ThreadManager extends Manager { //implements ICDIThreadManager { return new ThreadSet(cthreads, currentThreadId); } - /** - * @deprecated - * @see org.eclipse.cdt.derug.core.cdi.ICDIThreadManager#update() - */ - public void update() throws CDIException { + public void update(Target target) throws CDIException { } } diff --git a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/VariableManager.java b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/VariableManager.java index 07488b9c022..ccc430b3d50 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/VariableManager.java +++ b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/VariableManager.java @@ -150,9 +150,12 @@ public class VariableManager extends Manager implements ICDIVariableManager { */ public void checkType(StackFrame frame, String type) throws CDIException { if (type != null && type.length() > 0) { + Session session = (Session)getSession(); Target target = (Target)frame.getTarget(); + Target currentTarget = session.getCurrentTarget(); ICDIThread currentThread = target.getCurrentThread(); ICDIStackFrame currentFrame = currentThread.getCurrentStackFrame(); + session.setCurrentTarget(target); target.setCurrentThread(frame.getThread(), false); frame.getThread().setCurrentStackFrame(frame, false); try { @@ -167,6 +170,7 @@ public class VariableManager extends Manager implements ICDIVariableManager { } catch (MIException e) { throw new MI2CDIException(e); } finally { + session.setCurrentTarget(currentTarget); target.setCurrentThread(currentThread, false); currentThread.setCurrentStackFrame(currentFrame, false); } @@ -232,6 +236,7 @@ public class VariableManager extends Manager implements ICDIVariableManager { ICDIThread currentThread = null; ICDIStackFrame currentFrame = null; Target target = (Target)argObj.getTarget(); + Target currentTarget = session.getCurrentTarget(); if (stack != null) { currentThread = target.getCurrentThread(); currentFrame = currentThread.getCurrentStackFrame(); @@ -253,6 +258,7 @@ public class VariableManager extends Manager implements ICDIVariableManager { } catch (MIException e) { throw new MI2CDIException(e); } finally { + session.setCurrentTarget(currentTarget); if (currentThread != null) { target.setCurrentThread(currentThread, false); currentThread.setCurrentStackFrame(currentFrame, false); @@ -271,6 +277,7 @@ public class VariableManager extends Manager implements ICDIVariableManager { List argObjects = new ArrayList(); Session session = (Session) getSession(); Target target = (Target)frame.getTarget(); + Target currentTarget = session.getCurrentTarget(); ICDIThread currentThread = target.getCurrentThread(); ICDIStackFrame currentFrame = currentThread.getCurrentStackFrame(); target.setCurrentThread(frame.getThread(), false); @@ -302,6 +309,7 @@ public class VariableManager extends Manager implements ICDIVariableManager { } catch (MIException e) { throw new MI2CDIException(e); } finally { + session.setCurrentTarget(currentTarget); target.setCurrentThread(currentThread, false); currentThread.setCurrentStackFrame(currentFrame, false); } @@ -309,10 +317,11 @@ public class VariableManager extends Manager implements ICDIVariableManager { } /** + * @deprecated * @see org.eclipse.cdt.debug.core.cdi.ICDIVariableManager#getGlobalVariableObject(String, String, String) */ public ICDIVariableObject getGlobalVariableObject(String filename, String function, String name) throws CDIException { - Target target = (Target)getSession().getCurrentTarget(); + Target target = ((Session)getSession()).getCurrentTarget(); return getGlobalVariableObject(target, filename, function, name); } public ICDIVariableObject getGlobalVariableObject(Target target, String filename, String function, String name) throws CDIException { @@ -398,6 +407,7 @@ public class VariableManager extends Manager implements ICDIVariableManager { List varObjects = new ArrayList(); Session session = (Session) getSession(); Target target = (Target)frame.getTarget(); + Target currentTarget = session.getCurrentTarget(); ICDIThread currentThread = target.getCurrentThread(); ICDIStackFrame currentFrame = currentThread.getCurrentStackFrame(); target.setCurrentThread(frame.getThread(), false); @@ -423,6 +433,7 @@ public class VariableManager extends Manager implements ICDIVariableManager { } catch (MIException e) { throw new MI2CDIException(e); } finally { + session.setCurrentTarget(currentTarget); target.setCurrentThread(currentThread, false); currentThread.setCurrentStackFrame(currentFrame, false); } @@ -458,6 +469,7 @@ public class VariableManager extends Manager implements ICDIVariableManager { ICDIThread currentThread = null; ICDIStackFrame currentFrame = null; Target target = (Target)varObj.getTarget(); + Target currentTarget = session.getCurrentTarget(); if (stack != null) { currentThread = target.getCurrentThread(); currentFrame = currentThread.getCurrentStackFrame(); @@ -479,6 +491,7 @@ public class VariableManager extends Manager implements ICDIVariableManager { } catch (MIException e) { throw new MI2CDIException(e); } finally { + session.setCurrentTarget(currentTarget); if (currentThread != null) { target.setCurrentThread(currentThread, false); currentThread.setCurrentStackFrame(currentFrame, false); @@ -513,13 +526,7 @@ public class VariableManager extends Manager implements ICDIVariableManager { * the other locals in different frames. The downside if any side effects we loose, * This ok, since the IDE only a frame at a time. * - * @deprecated - * @see org.eclipse.cdt.debug.core.cdi.ICDIVariableManager#createArgument(ICDIArgumentObject) */ - public void update() throws CDIException { - Target target = (Target)getSession().getCurrentTarget(); - update(target); - } public void update(Target target) throws CDIException { int high = 0; int low = 0; diff --git a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Breakpoint.java b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Breakpoint.java index c04fe314ff5..e35648988dd 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Breakpoint.java +++ b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Breakpoint.java @@ -72,7 +72,7 @@ public class Breakpoint extends CObject implements ICDILocationBreakpoint { String exp = miBreakpoints[0].getCondition(); condition = new Condition(icount, exp, tids); } else { - condition = new Condition(0, "", null); + condition = new Condition(0, new String(), null); } } return condition; diff --git a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Exceptionpoint.java b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Exceptionpoint.java index 86ab41e6552..6edaab0ce71 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Exceptionpoint.java +++ b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Exceptionpoint.java @@ -13,7 +13,6 @@ package org.eclipse.cdt.debug.mi.core.cdi.model; import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint; import org.eclipse.cdt.debug.core.cdi.model.ICDIExceptionpoint; -import org.eclipse.cdt.debug.mi.core.output.MIBreakpoint; /** * Exceptionpoint diff --git a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java index dab6d270c02..dca33ff371f 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java +++ b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java @@ -288,9 +288,6 @@ public class Target implements ICDITarget { return cthreads; } - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#getCurrentThread() - */ public ICDIThread getCurrentThread() throws CDIException { ICDIThread[] threads = getThreads(); for (int i = 0; i < threads.length; i++) { diff --git a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Variable.java b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Variable.java index 0f21fce64ab..d764d431f10 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Variable.java +++ b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Variable.java @@ -11,9 +11,6 @@ package org.eclipse.cdt.debug.mi.core.cdi.model; import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDIExpressionManager; -import org.eclipse.cdt.debug.core.cdi.ICDIRegisterManager; -import org.eclipse.cdt.debug.core.cdi.ICDIVariableManager; import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame; import org.eclipse.cdt.debug.core.cdi.model.ICDIValue; import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable; @@ -36,8 +33,11 @@ import org.eclipse.cdt.debug.core.cdi.model.type.ICDIWCharType; import org.eclipse.cdt.debug.mi.core.MIException; import org.eclipse.cdt.debug.mi.core.MISession; import org.eclipse.cdt.debug.mi.core.cdi.CdiResources; +import org.eclipse.cdt.debug.mi.core.cdi.ExpressionManager; import org.eclipse.cdt.debug.mi.core.cdi.Format; import org.eclipse.cdt.debug.mi.core.cdi.MI2CDIException; +import org.eclipse.cdt.debug.mi.core.cdi.RegisterManager; +import org.eclipse.cdt.debug.mi.core.cdi.VariableManager; import org.eclipse.cdt.debug.mi.core.cdi.model.type.ArrayValue; import org.eclipse.cdt.debug.mi.core.cdi.model.type.BoolValue; import org.eclipse.cdt.debug.mi.core.cdi.model.type.CharValue; @@ -316,22 +316,22 @@ public class Variable extends VariableObject implements ICDIVariable { if (this instanceof Register) { // If register was on autoupdate, update all the other registers // assigning may have side effects i.e. affecting other registers. - ICDIRegisterManager mgr = target.getSession().getRegisterManager(); + RegisterManager mgr = (RegisterManager)target.getSession().getRegisterManager(); if (mgr.isAutoUpdate()) { - mgr.update(); + mgr.update(target); } } else if (this instanceof Expression) { // If expression was on autoupdate, update all the other expression // assigning may have side effects i.e. affecting other expressions. - ICDIExpressionManager mgr = target.getSession().getExpressionManager(); + ExpressionManager mgr = (ExpressionManager)target.getSession().getExpressionManager(); if (mgr.isAutoUpdate()) { - mgr.update(); + mgr.update(target); } } else { // FIXME: Should we always call the Variable Manager ? - ICDIVariableManager mgr = target.getSession().getVariableManager(); + VariableManager mgr = (VariableManager)target.getSession().getVariableManager(); if (mgr.isAutoUpdate()) { - mgr.update(); + mgr.update(target); } } }