Skip to content

Commit

Permalink
Add backtrace.mask flag to mask .java lines in backtrace.
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Feb 14, 2012
1 parent 4a59c65 commit 9f4d431
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
24 changes: 24 additions & 0 deletions src/org/jruby/RubyInstanceConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,8 @@ public enum ProfilingMode {
private TraceType traceType =
TraceType.traceTypeFor(SafePropertyAccessor.getProperty("jruby.backtrace.style", "ruby_framed"));

private boolean backtraceMask = SafePropertyAccessor.getBoolean("jruby.backtrace.mask");

public static final boolean ERRNO_BACKTRACE
= SafePropertyAccessor.getBoolean("jruby.errno.backtrace", false);

Expand Down Expand Up @@ -642,6 +644,10 @@ public String getPropertyHelp() {
.append(" Log errors during reification (reify.classes=true). Default is false. \n")
.append(" reflected.handles=true|false\n")
.append(" Use reflection for binding methods, not generated bytecode. Default is false.\n")
.append(" backtrace.style=normal|raw|full|mri\n")
.append(" Set the style of exception backtraces. Default is normal.\n")
.append(" backtrace.mask=true|false\n")
.append(" Mask .java lines in Ruby backtraces. Default is false.\n")
.append("\nDEBUGGING/LOGGING:\n")
.append(" debug.loadService=true|false\n")
.append(" LoadService logging\n")
Expand Down Expand Up @@ -1826,6 +1832,24 @@ public TraceType getTraceType() {
public void setTraceType(TraceType traceType) {
this.traceType = traceType;
}

/**
* Whether to mask .java lines in the Ruby backtrace, as MRI does for C calls.
*
* @return true if masking; false otherwise
*/
public boolean getBacktraceMask() {
return backtraceMask;
}

/**
* Set whether to mask .java lines in the Ruby backtrace.
*
* @param backtraceMask true to mask; false otherwise
*/
public void setBacktraceMask(boolean backtraceMask) {
this.backtraceMask = backtraceMask;
}

public static boolean hasLoadedNativeExtensions() {
return loadedNativeExtensions;
Expand Down
2 changes: 1 addition & 1 deletion src/org/jruby/runtime/backtrace/TraceType.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public BacktraceData getBacktraceData(ThreadContext context, Thread thread, bool
thread.getStackTrace(),
context.createBacktrace2(0, nativeException),
false,
false,
context.runtime.getInstanceConfig().getBacktraceMask(),
this);
}
},
Expand Down

0 comments on commit 9f4d431

Please sign in to comment.