X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=plugins%2Fnet.mograsim.plugin.core%2Fsrc%2Fnet%2Fmograsim%2Fplugin%2Flaunch%2FMachineStackFrame.java;fp=plugins%2Fnet.mograsim.plugin.core%2Fsrc%2Fnet%2Fmograsim%2Fplugin%2Flaunch%2FMachineStackFrame.java;h=14f64206b5c3277deea1b274b3d62c29311069dc;hb=79fe4ef5f67bdf3b7a9d8002d1759ce87b3f90be;hp=0000000000000000000000000000000000000000;hpb=c59feb481f39dc2af89475a1ea53c1b234913cb7;p=Mograsim.git diff --git a/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/launch/MachineStackFrame.java b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/launch/MachineStackFrame.java new file mode 100644 index 00000000..14f64206 --- /dev/null +++ b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/launch/MachineStackFrame.java @@ -0,0 +1,193 @@ +package net.mograsim.plugin.launch; + +import org.eclipse.core.runtime.PlatformObject; +import org.eclipse.debug.core.DebugException; +import org.eclipse.debug.core.ILaunch; +import org.eclipse.debug.core.model.IDebugTarget; +import org.eclipse.debug.core.model.IRegisterGroup; +import org.eclipse.debug.core.model.IStackFrame; +import org.eclipse.debug.core.model.IThread; +import org.eclipse.debug.core.model.IVariable; + +import net.mograsim.machine.Machine; +import net.mograsim.plugin.MograsimActivator; + +public class MachineStackFrame extends PlatformObject implements IStackFrame +{ + private final MachineThread thread; + private final MachineRegisterGroup registerGroup; + + public MachineStackFrame(MachineThread thread) + { + this.thread = thread; + this.registerGroup = new MachineRegisterGroup(this); + } + + @Override + public String getModelIdentifier() + { + return MograsimActivator.PLUGIN_ID; + } + + public Machine getMachine() + { + return thread.getMachine(); + } + + @Override + public IDebugTarget getDebugTarget() + { + return thread.getDebugTarget(); + } + + @Override + public ILaunch getLaunch() + { + return thread.getLaunch(); + } + + @Override + public boolean canStepInto() + { + return thread.canStepInto(); + } + + @Override + public boolean canStepOver() + { + return thread.canStepOver(); + } + + @Override + public boolean canStepReturn() + { + return thread.canStepReturn(); + } + + @Override + public boolean isStepping() + { + return thread.isStepping(); + } + + @Override + public void stepInto() throws DebugException + { + thread.stepInto(); + } + + @Override + public void stepOver() throws DebugException + { + thread.stepOver(); + } + + @Override + public void stepReturn() throws DebugException + { + thread.stepReturn(); + } + + @Override + public boolean canResume() + { + return thread.canResume(); + } + + @Override + public boolean canSuspend() + { + return thread.canSuspend(); + } + + @Override + public boolean isSuspended() + { + return thread.isSuspended(); + } + + @Override + public void resume() throws DebugException + { + thread.resume(); + } + + @Override + public void suspend() throws DebugException + { + thread.suspend(); + } + + @Override + public boolean canTerminate() + { + return thread.canTerminate(); + } + + @Override + public boolean isTerminated() + { + return thread.isTerminated(); + } + + @Override + public void terminate() throws DebugException + { + thread.terminate(); + } + + @Override + public IThread getThread() + { + return thread; + } + + @Override + public IVariable[] getVariables() throws DebugException + { + return new IVariable[0]; + } + + @Override + public boolean hasVariables() throws DebugException + { + return false; + } + + @Override + public int getLineNumber() throws DebugException + { + // TODO could we transmit the active microinstruction address using this? + return -1; + } + + @Override + public int getCharStart() throws DebugException + { + return -1; + } + + @Override + public int getCharEnd() throws DebugException + { + return -1; + } + + @Override + public String getName() throws DebugException + { + return "pseudo stack frame"; + } + + @Override + public IRegisterGroup[] getRegisterGroups() throws DebugException + { + return new IRegisterGroup[] { registerGroup }; + } + + @Override + public boolean hasRegisterGroups() throws DebugException + { + return true; + } +} \ No newline at end of file