public final class DebugException extends RuntimeException
DebugException.getDebugStackTrace()
to find out the guest language stack trace.
Debugger methods that run guest language code may throw this exception.
Modifier and Type | Class and Description |
---|---|
static class |
DebugException.CatchLocation
Represents an exception catch location.
|
Modifier and Type | Method and Description |
---|---|
Throwable |
fillInStackTrace()
Unsupported,
DebugException instances are not writable therefore filling the stack
trace has no effect for them. |
DebugException.CatchLocation |
getCatchLocation()
Get source code location where this exception is to be caught.
|
List<List<DebugStackTraceElement>> |
getDebugAsynchronousStacks()
Get a list of asynchronous stack traces that led to scheduling of the exception's execution.
|
List<DebugStackTraceElement> |
getDebugStackTrace()
Gets stack trace elements of guest languages.
|
DebugValue |
getExceptionObject()
Get a guest language object representing the exception, if any.
|
Throwable |
getRawException(Class<? extends TruffleLanguage<?>> languageClass)
Returns the guest language representation of the exception, or
null if the
requesting language class does not match the root node language at the throw location. |
StackTraceElement[] |
getStackTrace()
Gets stack trace elements of guest languages.
|
SourceSection |
getThrowLocation()
Get source code location where this exception was thrown from.
|
boolean |
isInternalError()
Returns
true if this exception indicates an internal error. |
void |
printStackTrace() |
void |
printStackTrace(PrintStream s) |
void |
printStackTrace(PrintWriter s) |
void |
setStackTrace(StackTraceElement[] stackTrace)
Unsupported,
DebugException instances are not writable therefore setting the stack
trace has no effect for them. |
addSuppressed, getCause, getLocalizedMessage, getMessage, getSuppressed, initCause, toString
public Throwable fillInStackTrace()
DebugException
instances are not writable therefore filling the stack
trace has no effect for them.fillInStackTrace
in class Throwable
public void setStackTrace(StackTraceElement[] stackTrace)
DebugException
instances are not writable therefore setting the stack
trace has no effect for them.setStackTrace
in class Throwable
public StackTraceElement[] getStackTrace()
DebugException.getDebugStackTrace()
as the guest language stack elements do not always fit the Java
format for stack trace elements.getStackTrace
in class Throwable
public List<DebugStackTraceElement> getDebugStackTrace()
public List<List<DebugStackTraceElement>> getDebugAsynchronousStacks()
Languages might not provide asynchronous stack traces by default for performance reasons.
Call DebuggerSession.setAsynchronousStackDepth(int)
to request asynchronous stacks.
Languages may provide asynchronous stacks if it's of no performance penalty, or if requested
by other options.
DebuggerSession.setAsynchronousStackDepth(int)
public void printStackTrace()
printStackTrace
in class Throwable
public void printStackTrace(PrintStream s)
printStackTrace
in class Throwable
public void printStackTrace(PrintWriter s)
printStackTrace
in class Throwable
public boolean isInternalError()
true
if this exception indicates an internal error.public DebugValue getExceptionObject()
null
public SourceSection getThrowLocation()
null
when the thrown location is not known.public DebugException.CatchLocation getCatchLocation()
null
is returned for uncaught exceptions.null
in case of uncaught exceptions.public Throwable getRawException(Class<? extends TruffleLanguage<?>> languageClass)
null
if the
requesting language class does not match the root node language at the throw location.
This method is permitted only if the guest language class is available. This is the case if
you want to utilize the Debugger API directly from within a guest language, or if you are an
instrument bound/dependent on a specific language.languageClass
- the Truffle language class for a given guest language