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 class
Additional options that we keep for a breakpoint.protected class
protected class
Keeps track of the modules that start and complete execution.protected class
Represents the debugger and other state needed to debug an execution thread. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final String
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.Fields inherited from interface org.eclipse.lsp4j.debug.services.IDebugProtocolServer
SCHEMA_VERSION
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected EpsilonDebugAdapter.ThreadState
attachTo
(IEolModule module) void
connect
(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.Source
createSource
(ModuleElement resolvedModule) Creates a DAP Source object from a module element.protected org.eclipse.lsp4j.debug.Source
createSource
(BreakpointResult result, String sourcePath) protected PrintStream
createStream
(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 void
mapUriToSourcePath
(String uri, org.eclipse.lsp4j.debug.Source bpSource) next
(org.eclipse.lsp4j.debug.NextArguments args) protected void
populateSourceFromMappings
(org.eclipse.lsp4j.debug.Source bpSource, URI moduleURI, Path path) protected void
removeAllBreakpoints
(String sourcePath) protected org.eclipse.lsp4j.jsonrpc.messages.Tuple.Two<ModuleElement,
org.eclipse.lsp4j.debug.Source> resolveStackFrameLocation
(IModule module, Frame sf) protected void
CompletableFuture<org.eclipse.lsp4j.debug.ScopesResponse>
scopes
(org.eclipse.lsp4j.debug.ScopesArguments args) protected void
sendExited
(int exitCode) protected void
sendOutput
(IEolContext context, String category, String output) protected void
sendStopped
(int threadId, String reason) protected void
protected void
sendThreadEvent
(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) void
setModule
(IEolModule module) void
setOnAttach
(Runnable onAttach) 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 void
suspend
(int threadId, ModuleElement ast, SuspendReason reason) terminate
(org.eclipse.lsp4j.debug.TerminateArguments args) CompletableFuture<org.eclipse.lsp4j.debug.ThreadsResponse>
threads()
protected void
updateResponseBreakpointFromResult
(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, wait
Methods 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:
initialize
in interfaceorg.eclipse.lsp4j.debug.services.IDebugProtocolServer
-
attach
- Specified by:
attach
in interfaceorg.eclipse.lsp4j.debug.services.IDebugProtocolServer
-
threads
- Specified by:
threads
in interfaceorg.eclipse.lsp4j.debug.services.IDebugProtocolServer
-
evaluate
public CompletableFuture<org.eclipse.lsp4j.debug.EvaluateResponse> evaluate(org.eclipse.lsp4j.debug.EvaluateArguments args) - Specified by:
evaluate
in interfaceorg.eclipse.lsp4j.debug.services.IDebugProtocolServer
-
stackTrace
public CompletableFuture<org.eclipse.lsp4j.debug.StackTraceResponse> stackTrace(org.eclipse.lsp4j.debug.StackTraceArguments args) - Specified by:
stackTrace
in 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:
scopes
in interfaceorg.eclipse.lsp4j.debug.services.IDebugProtocolServer
-
variables
public CompletableFuture<org.eclipse.lsp4j.debug.VariablesResponse> variables(org.eclipse.lsp4j.debug.VariablesArguments args) - Specified by:
variables
in interfaceorg.eclipse.lsp4j.debug.services.IDebugProtocolServer
-
terminate
- Specified by:
terminate
in interfaceorg.eclipse.lsp4j.debug.services.IDebugProtocolServer
-
disconnect
- Specified by:
disconnect
in interfaceorg.eclipse.lsp4j.debug.services.IDebugProtocolServer
-
setExceptionBreakpoints
public CompletableFuture<org.eclipse.lsp4j.debug.SetExceptionBreakpointsResponse> setExceptionBreakpoints(org.eclipse.lsp4j.debug.SetExceptionBreakpointsArguments args) - Specified by:
setExceptionBreakpoints
in interfaceorg.eclipse.lsp4j.debug.services.IDebugProtocolServer
-
setBreakpoints
public CompletableFuture<org.eclipse.lsp4j.debug.SetBreakpointsResponse> setBreakpoints(org.eclipse.lsp4j.debug.SetBreakpointsArguments args) - Specified by:
setBreakpoints
in 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:
stepIn
in interfaceorg.eclipse.lsp4j.debug.services.IDebugProtocolServer
-
next
- Specified by:
next
in interfaceorg.eclipse.lsp4j.debug.services.IDebugProtocolServer
-
stepOut
- Specified by:
stepOut
in 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
-
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. When populating it, users must ensure that URIs referring to a folder have a trailing slash. -
suspend
protected void suspend(int threadId, ModuleElement ast, SuspendReason reason) throws InterruptedException - Throws:
InterruptedException
-
resumeAllThreads
protected void resumeAllThreads()
-