diff options
Diffstat (limited to 'debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SourceManager.java')
-rw-r--r-- | debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SourceManager.java | 198 |
1 files changed, 0 insertions, 198 deletions
diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SourceManager.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SourceManager.java deleted file mode 100644 index 26ccc014098..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SourceManager.java +++ /dev/null @@ -1,198 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.cdi; - -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.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.MISession; -import org.eclipse.cdt.debug.mi.core.cdi.model.Instruction; -import org.eclipse.cdt.debug.mi.core.cdi.model.MixedInstruction; -import org.eclipse.cdt.debug.mi.core.command.CommandFactory; -import org.eclipse.cdt.debug.mi.core.command.MIDataDisassemble; -import org.eclipse.cdt.debug.mi.core.command.MIEnvironmentDirectory; -import org.eclipse.cdt.debug.mi.core.command.MIGDBShowDirectories; -import org.eclipse.cdt.debug.mi.core.output.MIAsm; -import org.eclipse.cdt.debug.mi.core.output.MIDataDisassembleInfo; -import org.eclipse.cdt.debug.mi.core.output.MIGDBShowDirectoriesInfo; -import org.eclipse.cdt.debug.mi.core.output.MISrcAsm; - - -/** - */ -public class SourceManager extends SessionObject implements ICDISourceManager { - - boolean autoupdate; - - public SourceManager(Session session) { - super(session); - autoupdate = false; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISourceManager#addSourcePaths(String[]) - */ - public void addSourcePaths(String[] dirs) throws CDIException { - Session session = (Session)getSession(); - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIEnvironmentDirectory dir = factory.createMIEnvironmentDirectory(dirs); - try { - mi.postCommand(dir); - dir.getMIInfo(); - } catch (MIException e) { - throw new MI2CDIException(e); - } - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISourceManager#getSourcePaths() - */ - public String[] getSourcePaths() throws CDIException { - Session session = (Session)getSession(); - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIGDBShowDirectories dir = factory.createMIGDBShowDirectories(); - try { - mi.postCommand(dir); - MIGDBShowDirectoriesInfo info = dir.getMIGDBShowDirectoriesInfo(); - return info.getDirectories(); - } catch (MIException e) { - throw new MI2CDIException(e); - } - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISourceManager#getInstructions(String, int, int) - */ - public ICDIInstruction[] getInstructions(String filename, int linenum, int lines) throws CDIException { - Session session = (Session)getSession(); - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIDataDisassemble dis = factory.createMIDataDisassemble(filename, linenum, lines, false); - try { - mi.postCommand(dis); - MIDataDisassembleInfo info = dis.getMIDataDisassembleInfo(); - MIAsm[] asm = info.getMIAsms(); - Instruction[] instructions = new Instruction[asm.length]; - for (int i = 0; i < instructions.length; i++) { - instructions[i] = new Instruction(session.getCurrentTarget(), asm[i]); - } - return instructions; - } catch (MIException e) { - throw new MI2CDIException(e); - } - } - - /** - * @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); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISourceManager#getInstructions(long, long) - */ - public ICDIInstruction[] getInstructions(long start, long end) throws CDIException { - Session session = (Session)getSession(); - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - String hex = "0x"; - String sa = hex + Long.toHexString(start); - String ea = hex + Long.toHexString(end); - MIDataDisassemble dis = factory.createMIDataDisassemble(sa, ea, false); - try { - mi.postCommand(dis); - MIDataDisassembleInfo info = dis.getMIDataDisassembleInfo(); - MIAsm[] asm = info.getMIAsms(); - Instruction[] instructions = new Instruction[asm.length]; - for (int i = 0; i < instructions.length; i++) { - instructions[i] = new Instruction(session.getCurrentTarget(), asm[i]); - } - return instructions; - } catch (MIException e) { - throw new MI2CDIException(e); - } - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISourceManager#getMixedInstructions(String, int, int) - */ - public ICDIMixedInstruction[] getMixedInstructions(String filename, int linenum, int lines) throws CDIException { - Session session = (Session)getSession(); - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIDataDisassemble dis = factory.createMIDataDisassemble(filename, linenum, lines, true); - try { - mi.postCommand(dis); - MIDataDisassembleInfo info = dis.getMIDataDisassembleInfo(); - MISrcAsm[] srcAsm = info.getMISrcAsms(); - ICDIMixedInstruction[] mixed = new ICDIMixedInstruction[srcAsm.length]; - for (int i = 0; i < mixed.length; i++) { - mixed[i] = new MixedInstruction(session.getCurrentTarget(), srcAsm[i]); - } - return mixed; - } catch (MIException e) { - throw new MI2CDIException(e); - } - } - - /** - * @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); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISourceManager#getMixedInstructions(long, long) - */ - public ICDIMixedInstruction[] getMixedInstructions(long start, long end) throws CDIException { - Session session = (Session)getSession(); - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - String hex = "0x"; - String sa = hex + Long.toHexString(start); - String ea = hex + Long.toHexString(end); - MIDataDisassemble dis = factory.createMIDataDisassemble(sa, ea, true); - try { - mi.postCommand(dis); - MIDataDisassembleInfo info = dis.getMIDataDisassembleInfo(); - MISrcAsm[] srcAsm = info.getMISrcAsms(); - ICDIMixedInstruction[] mixed = new ICDIMixedInstruction[srcAsm.length]; - for (int i = 0; i < mixed.length; i++) { - mixed[i] = new MixedInstruction(session.getCurrentTarget(), srcAsm[i]); - } - return mixed; - } catch (MIException e) { - throw new MI2CDIException(e); - } - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISourceManager#isAutoUpdate() - */ - public boolean isAutoUpdate() { - return autoupdate; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISourceManager#setAutoUpdate(boolean) - */ - public void setAutoUpdate(boolean update) { - autoupdate = update; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISourceManager#update() - */ - public void update() throws CDIException { - } - -} |