From 3374f172f094a7c90924f4e47f23da964bd37a51 Mon Sep 17 00:00:00 2001 From: Alain Magloire Date: Tue, 26 Oct 2004 19:43:39 +0000 Subject: [PATCH] 2004-10-26 Alain Magloire Remove of ICDISourceManager in CDI * cdi/org/eclipse/cdt/debug/mi/core/cdi/Session.java * cdi/org/eclipse/cdt/debug/mi/core/cdi/SourceManager.java * cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java * mi/org/eclipse/cdt/debug/mi/core/cdi/command/MIDataDsassemble.java --- debug/org.eclipse.cdt.debug.mi.core/ChangeLog | 8 +++ .../cdt/debug/mi/core/cdi/Session.java | 6 +- .../cdt/debug/mi/core/cdi/SourceManager.java | 69 ++----------------- .../cdt/debug/mi/core/cdi/model/Target.java | 67 ++++++++++++++++++ .../mi/core/command/MIDataDisassemble.java | 12 ++++ 5 files changed, 95 insertions(+), 67 deletions(-) diff --git a/debug/org.eclipse.cdt.debug.mi.core/ChangeLog b/debug/org.eclipse.cdt.debug.mi.core/ChangeLog index 463af2842e1..12906632ea2 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/ChangeLog +++ b/debug/org.eclipse.cdt.debug.mi.core/ChangeLog @@ -1,3 +1,11 @@ +2004-10-26 Alain Magloire + Remove of ICDISourceManager in CDI + * cdi/org/eclipse/cdt/debug/mi/core/cdi/Session.java + * cdi/org/eclipse/cdt/debug/mi/core/cdi/SourceManager.java + * cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java + + * mi/org/eclipse/cdt/debug/mi/core/cdi/command/MIDataDsassemble.java + 2004-10-26 Alain Magloire Remove of ICDISignalManager in CDI * cdi/org/eclipse/cdt/debug/mi/core/cdi/Session.java 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 28f0ff2a88a..ff7dda7eb55 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 @@ -21,7 +21,6 @@ import org.eclipse.cdt.debug.core.cdi.ICDIRegisterManager; import org.eclipse.cdt.debug.core.cdi.ICDISession; import org.eclipse.cdt.debug.core.cdi.ICDISessionObject; import org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager; -import org.eclipse.cdt.debug.core.cdi.ICDISourceManager; import org.eclipse.cdt.debug.core.cdi.ICDIVariableManager; import org.eclipse.cdt.debug.core.cdi.event.ICDIEvent; import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; @@ -175,10 +174,7 @@ public class Session implements ICDISession, ICDISessionObject { return signalManager; } - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISession#getSourceManager() - */ - public ICDISourceManager getSourceManager() { + public SourceManager getSourceManager() { return sourceManager; } 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 7735a66cc77..bec317b5702 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 @@ -14,7 +14,6 @@ import java.math.BigInteger; import java.util.StringTokenizer; import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDISourceManager; import org.eclipse.cdt.debug.core.cdi.model.ICDIInstruction; import org.eclipse.cdt.debug.core.cdi.model.ICDIMixedInstruction; import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame; @@ -62,7 +61,7 @@ import org.eclipse.cdt.debug.mi.core.output.MIWhatisInfo; /** */ -public class SourceManager extends Manager implements ICDISourceManager { +public class SourceManager extends Manager { GDBTypeParser gdbTypeParser; @@ -71,14 +70,6 @@ public class SourceManager extends Manager implements ICDISourceManager { gdbTypeParser = new GDBTypeParser(); } - /** - * @deprecated - * @see org.eclipse.cdt.debug.core.cdi.ICDISourceManager#addSourcePaths(String[]) - */ - public void addSourcePaths(String[] dirs) throws CDIException { - Target target = ((Session)getSession()).getCurrentTarget(); - addSourcePaths(target, dirs); - } public void addSourcePaths(Target target, String[] dirs) throws CDIException { Session session = (Session)getSession(); MISession mi = target.getMISession(); @@ -92,14 +83,6 @@ public class SourceManager extends Manager implements ICDISourceManager { } } - /** - * @deprecated - * @see org.eclipse.cdt.debug.core.cdi.ICDISourceManager#getSourcePaths() - */ - public String[] getSourcePaths() throws CDIException { - Target target = ((Session)getSession()).getCurrentTarget(); - return getSourcePaths(target); - } public String[] getSourcePaths(Target target) throws CDIException { MISession mi = target.getMISession(); CommandFactory factory = mi.getCommandFactory(); @@ -113,14 +96,10 @@ 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 = ((Session)getSession()).getCurrentTarget(); - return getInstructions(target, filename, linenum, lines); + public ICDIInstruction[] getInstructions(Target target, String filename, int linenum) throws CDIException { + return getInstructions(target, filename, linenum, -1); } + public ICDIInstruction[] getInstructions(Target target, String filename, int linenum, int lines) throws CDIException { MISession mi = target.getMISession(); CommandFactory factory = mi.getCommandFactory(); @@ -139,21 +118,6 @@ public class SourceManager extends Manager implements ICDISourceManager { } } - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISourceManager#getInstructions(String, int) - */ - public ICDIInstruction[] getInstructions(String filename, int linenum) throws CDIException { - return getInstructions(filename, linenum, -1); - } - - /** - * @deprecated - * @see org.eclipse.cdt.debug.core.cdi.ICDISourceManager#getInstructions(long, long) - */ - public ICDIInstruction[] getInstructions(BigInteger start, BigInteger end) throws CDIException { - Target target = ((Session)getSession()).getCurrentTarget(); - return getInstructions(target, start, end); - } public ICDIInstruction[] getInstructions(Target target, BigInteger start, BigInteger end) throws CDIException { MISession mi = target.getMISession(); CommandFactory factory = mi.getCommandFactory(); @@ -175,14 +139,10 @@ 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 = ((Session)getSession()).getCurrentTarget(); - return getMixedInstructions(target, filename, linenum, lines); + public ICDIMixedInstruction[] getMixedInstructions(Target target, String filename, int linenum) throws CDIException { + return getMixedInstructions(target, filename, linenum, -1); } + public ICDIMixedInstruction[] getMixedInstructions(Target target, String filename, int linenum, int lines) throws CDIException { MISession mi = target.getMISession(); CommandFactory factory = mi.getCommandFactory(); @@ -201,21 +161,6 @@ 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 = ((Session)getSession()).getCurrentTarget(); - return getMixedInstructions(target, start, end); - } public ICDIMixedInstruction[] getMixedInstructions(Target target, BigInteger start, BigInteger end) 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/model/Target.java b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java index 6ff637f557c..6de6ae5a3b1 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 @@ -20,7 +20,9 @@ import org.eclipse.cdt.debug.core.cdi.ICDILocation; import org.eclipse.cdt.debug.core.cdi.ICDISession; import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint; import org.eclipse.cdt.debug.core.cdi.model.ICDIExpression; +import org.eclipse.cdt.debug.core.cdi.model.ICDIInstruction; import org.eclipse.cdt.debug.core.cdi.model.ICDILocationBreakpoint; +import org.eclipse.cdt.debug.core.cdi.model.ICDIMixedInstruction; import org.eclipse.cdt.debug.core.cdi.model.ICDIRuntimeOptions; import org.eclipse.cdt.debug.core.cdi.model.ICDISignal; import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame; @@ -37,6 +39,7 @@ 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.Session; import org.eclipse.cdt.debug.mi.core.cdi.SignalManager; +import org.eclipse.cdt.debug.mi.core.cdi.SourceManager; import org.eclipse.cdt.debug.mi.core.cdi.VariableManager; import org.eclipse.cdt.debug.mi.core.command.CommandFactory; import org.eclipse.cdt.debug.mi.core.command.MIDataEvaluateExpression; @@ -814,4 +817,68 @@ public class Target implements ICDITarget { return sigMgr.getSignals(this); } + /* (non-Javadoc) + * @see org.eclipse.cdt.debug.core.cdi.model.ICDISourceManagement#addSourcePaths(java.lang.String[]) + */ + public void addSourcePaths(String[] srcPaths) throws CDIException { + SourceManager srcMgr = ((Session)getSession()).getSourceManager(); + srcMgr.addSourcePaths(this, srcPaths); + } + + /* (non-Javadoc) + * @see org.eclipse.cdt.debug.core.cdi.model.ICDISourceManagement#getSourcePaths() + */ + public String[] getSourcePaths() throws CDIException { + SourceManager srcMgr = ((Session)getSession()).getSourceManager(); + return srcMgr.getSourcePaths(this); + } + + /* (non-Javadoc) + * @see org.eclipse.cdt.debug.core.cdi.model.ICDISourceManagement#getInstructions(java.math.BigInteger, java.math.BigInteger) + */ + public ICDIInstruction[] getInstructions(BigInteger startAddress, BigInteger endAddress) throws CDIException { + SourceManager srcMgr = ((Session)getSession()).getSourceManager(); + return srcMgr.getInstructions(this, startAddress, endAddress); + } + + /* (non-Javadoc) + * @see org.eclipse.cdt.debug.core.cdi.model.ICDISourceManagement#getInstructions(java.lang.String, int) + */ + public ICDIInstruction[] getInstructions(String filename, int linenum) throws CDIException { + SourceManager srcMgr = ((Session)getSession()).getSourceManager(); + return srcMgr.getInstructions(this, filename, linenum); + } + + /* (non-Javadoc) + * @see org.eclipse.cdt.debug.core.cdi.model.ICDISourceManagement#getInstructions(java.lang.String, int, int) + */ + public ICDIInstruction[] getInstructions(String filename, int linenum, int lines) throws CDIException { + SourceManager srcMgr = ((Session)getSession()).getSourceManager(); + return srcMgr.getInstructions(this, filename, linenum, lines); + } + + /* (non-Javadoc) + * @see org.eclipse.cdt.debug.core.cdi.model.ICDISourceManagement#getMixedInstructions(java.math.BigInteger, java.math.BigInteger) + */ + public ICDIMixedInstruction[] getMixedInstructions(BigInteger startAddress, BigInteger endAddress) throws CDIException { + SourceManager srcMgr = ((Session)getSession()).getSourceManager(); + return srcMgr.getMixedInstructions(this, startAddress, endAddress); + } + + /* (non-Javadoc) + * @see org.eclipse.cdt.debug.core.cdi.model.ICDISourceManagement#getMixedInstructions(java.lang.String, int) + */ + public ICDIMixedInstruction[] getMixedInstructions(String filename, int linenum) throws CDIException { + SourceManager srcMgr = ((Session)getSession()).getSourceManager(); + return srcMgr.getMixedInstructions(this, filename, linenum); + } + + /* (non-Javadoc) + * @see org.eclipse.cdt.debug.core.cdi.model.ICDISourceManagement#getMixedInstructions(java.lang.String, int, int) + */ + public ICDIMixedInstruction[] getMixedInstructions(String filename, int linenum, int lines) throws CDIException { + SourceManager srcMgr = ((Session)getSession()).getSourceManager(); + return srcMgr.getMixedInstructions(this, filename, linenum, lines); + } + } diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIDataDisassemble.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIDataDisassemble.java index e4250be30f6..ef2f91fbdbf 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIDataDisassemble.java +++ b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIDataDisassemble.java @@ -107,4 +107,16 @@ public class MIDataDisassemble extends MICommand } return info; } + + /* + * GDB the -data-disassemble uses "--" as a separator wit only the MODE + * So override the MICommand + */ + protected String parametersToString() { + if (parameters != null && parameters.length > 0) { + return "-- " + parameters[0]; //$NON-NLS-1$ + } + return new String(); + } + }