Package org.eclipse.epsilon.eol.dap
Class EpsilonDebugAdapter
java.lang.Object
org.eclipse.epsilon.eol.dap.EpsilonDebugAdapter
- All Implemented Interfaces:
org.eclipse.lsp4j.debug.services.IDebugProtocolServer
public class EpsilonDebugAdapter
extends Object
implements org.eclipse.lsp4j.debug.services.IDebugProtocolServer
Implements the Debug Adapter Protocol for Epsilon scripts. Only supports attaching to existing modules.
For details about DAP, see Microsoft's website.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classAdditional options that we keep for a breakpoint.protected classprotected classKeeps track of the modules that start and complete execution.protected classRepresents the debugger and other state needed to debug an execution thread. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final StringIf this key is set to "true" upon attaching, line breakpoints (without an explicit column) will stop at each statement instead of just the first one.Fields inherited from interface org.eclipse.lsp4j.debug.services.IDebugProtocolServer
SCHEMA_VERSION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected EpsilonDebugAdapter.ThreadStateattachTo(IEolModule module) voidconnect(org.eclipse.lsp4j.debug.services.IDebugProtocolClient client) CompletableFuture<org.eclipse.lsp4j.debug.ContinueResponse>continue_(org.eclipse.lsp4j.debug.ContinueArguments args) protected org.eclipse.lsp4j.debug.SourcecreateSource(ModuleElement resolvedModule) Creates a DAP Source object from a module element.protected org.eclipse.lsp4j.debug.SourcecreateSource(BreakpointResult result, String sourcePath) protected PrintStreamcreateStream(IEolContext context, String category) disconnect(org.eclipse.lsp4j.debug.DisconnectArguments args) CompletableFuture<org.eclipse.lsp4j.debug.EvaluateResponse>evaluate(org.eclipse.lsp4j.debug.EvaluateArguments args) Mappings from module URIs to filesystem paths.CompletableFuture<org.eclipse.lsp4j.debug.Capabilities>initialize(org.eclipse.lsp4j.debug.InitializeRequestArguments args) protected voidmapUriToSourcePath(String uri, org.eclipse.lsp4j.debug.Source bpSource) next(org.eclipse.lsp4j.debug.NextArguments args) protected voidpopulateSourceFromMappings(org.eclipse.lsp4j.debug.Source bpSource, URI moduleURI, Path path) protected voidremoveAllBreakpoints(String sourcePath) protected org.eclipse.lsp4j.jsonrpc.messages.Tuple.Two<ModuleElement,org.eclipse.lsp4j.debug.Source> resolveStackFrameLocation(IModule module, Frame sf) protected voidCompletableFuture<org.eclipse.lsp4j.debug.ScopesResponse>scopes(org.eclipse.lsp4j.debug.ScopesArguments args) protected voidsendExited(int exitCode) protected voidsendOutput(IEolContext context, String category, String output) protected voidsendStopped(int threadId, String reason) protected voidprotected voidsendThreadEvent(int threadId, String reason) CompletableFuture<org.eclipse.lsp4j.debug.SetBreakpointsResponse>setBreakpoints(org.eclipse.lsp4j.debug.SetBreakpointsArguments args) CompletableFuture<org.eclipse.lsp4j.debug.SetExceptionBreakpointsResponse>setExceptionBreakpoints(org.eclipse.lsp4j.debug.SetExceptionBreakpointsArguments args) voidsetModule(IEolModule module) voidsetOnAttach(Runnable onAttach) protected voidsetSourceFile(org.eclipse.lsp4j.debug.Source bpSource, File mappedFile) CompletableFuture<org.eclipse.lsp4j.debug.StackTraceResponse>stackTrace(org.eclipse.lsp4j.debug.StackTraceArguments args) stepIn(org.eclipse.lsp4j.debug.StepInArguments args) stepOut(org.eclipse.lsp4j.debug.StepOutArguments args) protected voidsuspend(int threadId, ModuleElement ast, SuspendReason reason) terminate(org.eclipse.lsp4j.debug.TerminateArguments args) CompletableFuture<org.eclipse.lsp4j.debug.ThreadsResponse>threads()protected voidupdateResponseBreakpointFromResult(String sourcePath, org.eclipse.lsp4j.debug.Breakpoint bp, BreakpointResult result) CompletableFuture<org.eclipse.lsp4j.debug.VariablesResponse>variables(org.eclipse.lsp4j.debug.VariablesArguments args) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.lsp4j.debug.services.IDebugProtocolServer
breakpointLocations, cancel, completions, configurationDone, dataBreakpointInfo, disassemble, exceptionInfo, goto_, gotoTargets, launch, loadedSources, locations, modules, pause, readMemory, restart, restartFrame, reverseContinue, setDataBreakpoints, setExpression, setFunctionBreakpoints, setInstructionBreakpoints, setVariable, source, stepBack, stepInTargets, terminateThreads, writeMemory
-
Field Details
-
STOP_AT_EVERY_STATEMENT
If this key is set to "true" upon attaching, line breakpoints (without an explicit column) will stop at each statement instead of just the first one.- See Also:
-
FIRST_THREAD_ID
public static final int FIRST_THREAD_ID- See Also:
-
-
Constructor Details
-
EpsilonDebugAdapter
public EpsilonDebugAdapter()
-
-
Method Details
-
createStream
-
attachTo
-
connect
public void connect(org.eclipse.lsp4j.debug.services.IDebugProtocolClient client) -
initialize
public CompletableFuture<org.eclipse.lsp4j.debug.Capabilities> initialize(org.eclipse.lsp4j.debug.InitializeRequestArguments args) - Specified by:
initializein interfaceorg.eclipse.lsp4j.debug.services.IDebugProtocolServer
-
attach
- Specified by:
attachin interfaceorg.eclipse.lsp4j.debug.services.IDebugProtocolServer
-
threads
- Specified by:
threadsin interfaceorg.eclipse.lsp4j.debug.services.IDebugProtocolServer
-
evaluate
public CompletableFuture<org.eclipse.lsp4j.debug.EvaluateResponse> evaluate(org.eclipse.lsp4j.debug.EvaluateArguments args) - Specified by:
evaluatein interfaceorg.eclipse.lsp4j.debug.services.IDebugProtocolServer
-
stackTrace
public CompletableFuture<org.eclipse.lsp4j.debug.StackTraceResponse> stackTrace(org.eclipse.lsp4j.debug.StackTraceArguments args) - Specified by:
stackTracein interfaceorg.eclipse.lsp4j.debug.services.IDebugProtocolServer
-
resolveStackFrameLocation
protected org.eclipse.lsp4j.jsonrpc.messages.Tuple.Two<ModuleElement,org.eclipse.lsp4j.debug.Source> resolveStackFrameLocation(IModule module, Frame sf) -
scopes
public CompletableFuture<org.eclipse.lsp4j.debug.ScopesResponse> scopes(org.eclipse.lsp4j.debug.ScopesArguments args) - Specified by:
scopesin interfaceorg.eclipse.lsp4j.debug.services.IDebugProtocolServer
-
variables
public CompletableFuture<org.eclipse.lsp4j.debug.VariablesResponse> variables(org.eclipse.lsp4j.debug.VariablesArguments args) - Specified by:
variablesin interfaceorg.eclipse.lsp4j.debug.services.IDebugProtocolServer
-
terminate
- Specified by:
terminatein interfaceorg.eclipse.lsp4j.debug.services.IDebugProtocolServer
-
disconnect
- Specified by:
disconnectin interfaceorg.eclipse.lsp4j.debug.services.IDebugProtocolServer
-
setExceptionBreakpoints
public CompletableFuture<org.eclipse.lsp4j.debug.SetExceptionBreakpointsResponse> setExceptionBreakpoints(org.eclipse.lsp4j.debug.SetExceptionBreakpointsArguments args) - Specified by:
setExceptionBreakpointsin interfaceorg.eclipse.lsp4j.debug.services.IDebugProtocolServer
-
setBreakpoints
public CompletableFuture<org.eclipse.lsp4j.debug.SetBreakpointsResponse> setBreakpoints(org.eclipse.lsp4j.debug.SetBreakpointsArguments args) - Specified by:
setBreakpointsin interfaceorg.eclipse.lsp4j.debug.services.IDebugProtocolServer
-
updateResponseBreakpointFromResult
protected void updateResponseBreakpointFromResult(String sourcePath, org.eclipse.lsp4j.debug.Breakpoint bp, BreakpointResult result) -
removeAllBreakpoints
-
continue_
public CompletableFuture<org.eclipse.lsp4j.debug.ContinueResponse> continue_(org.eclipse.lsp4j.debug.ContinueArguments args) - Specified by:
continue_in interfaceorg.eclipse.lsp4j.debug.services.IDebugProtocolServer
-
stepIn
- Specified by:
stepInin interfaceorg.eclipse.lsp4j.debug.services.IDebugProtocolServer
-
next
- Specified by:
nextin interfaceorg.eclipse.lsp4j.debug.services.IDebugProtocolServer
-
stepOut
- Specified by:
stepOutin interfaceorg.eclipse.lsp4j.debug.services.IDebugProtocolServer
-
createSource
-
createSource
Creates a DAP Source object from a module element. It will prefer using files if available (as they will probably be the same as those in the IDE), but it will fall back to URIs if there is no file to refer back to. -
populateSourceFromMappings
-
mapUriToSourcePath
-
setSourceFile
-
sendExited
protected void sendExited(int exitCode) -
sendTerminated
protected void sendTerminated() -
sendOutput
-
sendStopped
-
sendThreadEvent
-
getModule
-
setModule
-
setOnAttach
-
getUriToPathMappings
Mappings from module URIs to filesystem paths. Useful when debugging code that is loaded from a non-file URI. -
suspend
protected void suspend(int threadId, ModuleElement ast, SuspendReason reason) throws InterruptedException - Throws:
InterruptedException
-
resumeAllThreads
protected void resumeAllThreads()
-