Top Inners Fields Constructors Methods
org.jruby.runtime.backtrace

public Class TraceType

extends Object
Class Inheritance
Imports
java.io.ByteArrayOutputStream, .FileDescriptor, .PrintStream, java.util.HashSet, .Set, java.util.stream.Stream, com.headius.backport9.stack.StackWalker, org.jruby.Ruby, .RubyArray, .RubyClass, .RubyException, .RubyHash, .RubyInstanceConfig, .RubyString, .RubySymbol, org.jruby.api.Convert, org.jruby.ast.util.ArgsUtil, org.jruby.runtime.ThreadContext, org.jruby.runtime.builtin.IRubyObject, org.jruby.util.log.Logger, .LoggerFactory, org.jruby.util.TypeConverter

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
public static enum

Field Summary

Modifier and TypeField and Description
private static final String
private static final String
private static final String
private static final String
private final TraceType.Format
private final TraceType.Gather
private static final String
private static final Logger
private static final String
private static final String
private static final StackWalker

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static IRubyObject
checkHighlightKeyword(ThreadContext context, IRubyObject optArg, boolean autoTTYDetect)

private static boolean
private static boolean
public static void
public static void
dumpCaller(RubyArray<T extends IRubyObject> trace)
Deprecated since 9.4-. use logCaller(org.jruby.RubyArray)

public static void
public static void
public static void
private static StringBuilder
public static IRubyObject
public BacktraceData
getBacktrace(ThreadContext context)

Get a normal Ruby backtrace, using the current Gather type.

public RubyStackTraceElement
getBacktraceElement(ThreadContext context, int uplevel)
Deprecated

public TraceType.Format
public TraceType.Gather
public BacktraceData
getIntegratedBacktrace(ThreadContext context, StackTraceElement[] javaTrace)

Get an integrated Ruby/Java backtrace if the current Gather type is NORMAL

public static boolean
public static boolean
public static boolean
public static void
public static void
logCaller(RubyArray<T extends IRubyObject> trace)

public static void
public static void
public static void
public static String
public String
printBacktrace(RubyException exception, boolean console)

public static String
printBacktraceJRuby(Ruby runtime, RubyStackTraceElement[] frames, String type, String message, boolean color)

protected static String
printBacktraceJRuby(RubyException exception, boolean console)

private static void
printBacktraceJRubyToStream(RubyException exception, PrintStream errorStream, boolean console)

private static RubyString
printBacktraceMRI(IRubyObject exception, IRubyObject opts, boolean highlight, boolean reverse)

public static void
printBacktraceToStream(ThreadContext context, IRubyObject backtrace, RubyString errorStream, int skip)

public static void
printBacktraceToStream(ThreadContext context, IRubyObject backtrace, RubyString errorStream, boolean reverse, int skip)

private static void
printCauseToStream(ThreadContext context, IRubyObject exception, RubyString errorStream, IRubyObject opts, boolean highlight, boolean reverse, Set<Object> shownCauses)

public static IRubyObject
private static void
printErrInfoToStream(IRubyObject exception, IRubyObject backtrace, RubyString errorStream, IRubyObject opts, boolean highlight)

private static void
printErrMessageToStream(ThreadContext context, IRubyObject exception, RubyString errorStream, boolean highlight)

private static void
printErrorPos(ThreadContext context, RubyString errorStream)

private static void
printExceptionToStream(IRubyObject exception, RubyString errorStream, IRubyObject opts, boolean highlight, boolean reverse, Set<Object> shownCauses)

public static RubyString
private static void
renderBacktraceJRuby(Ruby runtime, RubyStackTraceElement[] frames, StringBuilder buffer, boolean color)

private static void
renderBacktraceMRI(RubyStackTraceElement[] trace, String linePrefix, StringBuilder buffer, boolean color)

public static TraceType
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BOLDback to summary
private static final String BOLD
CLEAR_COLORback to summary
private static final String CLEAR_COLOR
EVAL_COLORback to summary
private static final String EVAL_COLOR
FIRST_COLORback to summary
private static final String FIRST_COLOR
formatback to summary
private final TraceType.Format format
gatherback to summary
private final TraceType.Gather gather
KERNEL_COLORback to summary
private static final String KERNEL_COLOR
LOGback to summary
private static final Logger LOG
RESETback to summary
private static final String RESET
UNDERLINEback to summary
private static final String UNDERLINE
WALKERback to summary
private static final StackWalker WALKER

Constructor Detail

TraceTypeback to summary
public TraceType(TraceType.Gather gather, TraceType.Format format)

Method Detail

checkHighlightKeywordback to summary
private static IRubyObject checkHighlightKeyword(ThreadContext context, IRubyObject optArg, boolean autoTTYDetect)
checkOrderKeywordback to summary
private static boolean checkOrderKeyword(ThreadContext context, IRubyObject optArg)
determineDirectionback to summary
private static boolean determineDirection(ThreadContext context, IRubyObject vOrder)
dumpBacktraceback to summary
public static void dumpBacktrace(RubyException exception)
dumpCallerback to summary
public static void dumpCaller(RubyArray<T extends IRubyObject> trace)

Deprecated

since 9.4-.

use logCaller(org.jruby.RubyArray)

Annotations
@Deprecated
since:9.4-
dumpCallerback to summary
public static void dumpCaller(RubyStackTraceElement[] trace)
Annotations
@Deprecated
since:9.4-
dumpExceptionback to summary
public static void dumpException(RubyException exception)

Deprecated

since 9.4-.

use logException(org.jruby.RubyException)

Annotations
@Deprecated
since:9.4-
dumpWarningback to summary
public static void dumpWarning(RubyStackTraceElement[] trace)
Annotations
@Deprecated
since:9.4-
formatWithMRIBacktraceback to summary
private static StringBuilder formatWithMRIBacktrace(final String message, RubyStackTraceElement[] trace)
generateMRIBacktraceback to summary
public static IRubyObject generateMRIBacktrace(Ruby runtime, RubyStackTraceElement[] trace)
getBacktraceback to summary
public BacktraceData getBacktrace(ThreadContext context)

Get a normal Ruby backtrace, using the current Gather type.

getBacktraceElementback to summary
public RubyStackTraceElement getBacktraceElement(ThreadContext context, int uplevel)

Deprecated

Annotations
@Deprecated
getFormatback to summary
public TraceType.Format getFormat()
getGatherback to summary
public TraceType.Gather getGather()
getIntegratedBacktraceback to summary
public BacktraceData getIntegratedBacktrace(ThreadContext context, StackTraceElement[] javaTrace)

Get an integrated Ruby/Java backtrace if the current Gather type is NORMAL

hasInternalMarkerback to summary
public static boolean hasInternalMarker(String filename)
isExcludedInternalback to summary
public static boolean isExcludedInternal(String filename)
isInternalFileback to summary
public static boolean isInternalFile(String filename)
logBacktraceback to summary
public static void logBacktrace(Ruby runtime, RubyStackTraceElement[] trace)
logCallerback to summary
public static void logCaller(RubyArray<T extends IRubyObject> trace)
logCallerback to summary
public static void logCaller(RubyStackTraceElement[] trace)
logExceptionback to summary
public static void logException(RubyException exception)
logWarningback to summary
public static void logWarning(RubyStackTraceElement[] trace)
maskInternalFilesback to summary
public static String maskInternalFiles(String filename)
printBacktraceback to summary
public String printBacktrace(RubyException exception, boolean console)
printBacktraceJRubyback to summary
public static String printBacktraceJRuby(Ruby runtime, RubyStackTraceElement[] frames, String type, String message, boolean color)
printBacktraceJRubyback to summary
protected static String printBacktraceJRuby(RubyException exception, boolean console)
printBacktraceJRubyToStreamback to summary
private static void printBacktraceJRubyToStream(RubyException exception, PrintStream errorStream, boolean console)
printBacktraceMRIback to summary
private static RubyString printBacktraceMRI(IRubyObject exception, IRubyObject opts, boolean highlight, boolean reverse)
printBacktraceToStreamback to summary
public static void printBacktraceToStream(ThreadContext context, IRubyObject backtrace, RubyString errorStream, int skip)
printBacktraceToStreamback to summary
public static void printBacktraceToStream(ThreadContext context, IRubyObject backtrace, RubyString errorStream, boolean reverse, int skip)
printCauseToStreamback to summary
private static void printCauseToStream(ThreadContext context, IRubyObject exception, RubyString errorStream, IRubyObject opts, boolean highlight, boolean reverse, Set<Object> shownCauses)
printDetailedMessageback to summary
public static IRubyObject printDetailedMessage(ThreadContext context, IRubyObject exception, IRubyObject opts)
printErrInfoToStreamback to summary
private static void printErrInfoToStream(IRubyObject exception, IRubyObject backtrace, RubyString errorStream, IRubyObject opts, boolean highlight)
printErrMessageToStreamback to summary
private static void printErrMessageToStream(ThreadContext context, IRubyObject exception, RubyString errorStream, boolean highlight)
printErrorPosback to summary
private static void printErrorPos(ThreadContext context, RubyString errorStream)
printExceptionToStreamback to summary
private static void printExceptionToStream(IRubyObject exception, RubyString errorStream, IRubyObject opts, boolean highlight, boolean reverse, Set<Object> shownCauses)
printFullMessageback to summary
public static RubyString printFullMessage(ThreadContext context, IRubyObject exception, IRubyObject opts)
renderBacktraceJRubyback to summary
private static void renderBacktraceJRuby(Ruby runtime, RubyStackTraceElement[] frames, StringBuilder buffer, boolean color)
renderBacktraceMRIback to summary
private static void renderBacktraceMRI(RubyStackTraceElement[] trace, String linePrefix, StringBuilder buffer, boolean color)
traceTypeForback to summary
public static TraceType traceTypeFor(String style)
org.jruby.runtime.backtrace back to summary

public sealed Enum TraceType.Format

extends Enum<TraceType.Format>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final TraceType.Format
JRUBY

New JRuby formatting

public static final TraceType.Format
MRI

Formatting like C Ruby

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public abstract String
printBacktrace(RubyException exception, boolean console)

public abstract void
renderBacktrace(RubyStackTraceElement[] elts, StringBuilder buffer, boolean color)

public static TraceType.Format
public static TraceType.Format[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

JRUBYback to summary
public static final TraceType.Format JRUBY

New JRuby formatting

MRIback to summary
public static final TraceType.Format MRI

Formatting like C Ruby

Constructor Detail

Formatback to summary
private Format()

Method Detail

printBacktraceback to summary
public abstract String printBacktrace(RubyException exception, boolean console)
renderBacktraceback to summary
public abstract void renderBacktrace(RubyStackTraceElement[] elts, StringBuilder buffer, boolean color)
valueOfback to summary
public static TraceType.Format valueOf(String name)
valuesback to summary
public static TraceType.Format[] values()
org.jruby.runtime.backtrace back to summary

public sealed Enum TraceType.Gather

extends Enum<TraceType.Gather>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final TraceType.Gather
CALLER

Normal Ruby-style backtrace, showing only Ruby and core class methods.

public static final TraceType.Gather
FULL

A backtrace with interpreted frames intact, but don't remove Java frames.

public static final TraceType.Gather
INTEGRATED

A normal Ruby-style backtrace, but which includes any non-org.jruby frames

public static final TraceType.Gather
NORMAL

Normal Ruby-style backtrace, showing only Ruby and core class methods.

public static final TraceType.Gather
RAW

Full raw backtraces with all Java frames included.

public static final TraceType.Gather
WARN

Warning traces, showing only Ruby and core class methods, excluding internal files.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public BacktraceData
getBacktraceData(ThreadContext context)

Gather current-stack backtrace data for a normal Ruby trace.

public abstract BacktraceData
public BacktraceData
getIntegratedBacktraceData(ThreadContext context, StackTraceElement[] javaTrace)

Gather backtrace data for an integrated trace if the current gather type is "NORMAL", otherwise use the current gather type.

public static TraceType.Gather
public static TraceType.Gather[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

CALLERback to summary
public static final TraceType.Gather CALLER

Normal Ruby-style backtrace, showing only Ruby and core class methods.

FULLback to summary
public static final TraceType.Gather FULL

A backtrace with interpreted frames intact, but don't remove Java frames.

INTEGRATEDback to summary
public static final TraceType.Gather INTEGRATED

A normal Ruby-style backtrace, but which includes any non-org.jruby frames

NORMALback to summary
public static final TraceType.Gather NORMAL

Normal Ruby-style backtrace, showing only Ruby and core class methods.

RAWback to summary
public static final TraceType.Gather RAW

Full raw backtraces with all Java frames included.

WARNback to summary
public static final TraceType.Gather WARN

Warning traces, showing only Ruby and core class methods, excluding internal files.

Constructor Detail

Gatherback to summary
private Gather()

Method Detail

getBacktraceDataback to summary
public BacktraceData getBacktraceData(ThreadContext context)

Gather current-stack backtrace data for a normal Ruby trace.

getBacktraceDataback to summary
public abstract BacktraceData getBacktraceData(ThreadContext context, Stream<StackWalker.StackFrame> javaTrace)
getIntegratedBacktraceDataback to summary
public BacktraceData getIntegratedBacktraceData(ThreadContext context, StackTraceElement[] javaTrace)

Gather backtrace data for an integrated trace if the current gather type is "NORMAL", otherwise use the current gather type.

valueOfback to summary
public static TraceType.Gather valueOf(String name)
valuesback to summary
public static TraceType.Gather[] values()