Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 14129df46f76
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 7792a12df4db
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Nov 22, 2016

  1. Copy the full SHA
    d4449bb View commit details
  2. 4
    Copy the full SHA
    7792a12 View commit details
Showing with 30 additions and 17 deletions.
  1. +29 −16 truffle/src/main/java/org/jruby/truffle/language/methods/ExceptionTranslatingNode.java
  2. +1 −1 truffle/src/main/ruby/core/rbconfig.rb
Original file line number Diff line number Diff line change
@@ -20,6 +20,7 @@
import org.jruby.truffle.RubyContext;
import org.jruby.truffle.language.RubyGuards;
import org.jruby.truffle.language.RubyNode;
import org.jruby.truffle.language.control.JavaException;
import org.jruby.truffle.language.control.RaiseException;
import org.jruby.truffle.language.control.TruffleFatalException;

@@ -179,29 +180,41 @@ public DynamicObject translate(Throwable throwable) {
throwable.printStackTrace();
}

final String message = throwable.getMessage();
final String reportedMessage;
Throwable t = throwable;
if (t instanceof JavaException) {
t = t.getCause();
}

final StringBuilder messageBuilder = new StringBuilder();
messageBuilder.append('\n');

while (t != null) {
final String message = t.getMessage();

if (message != null && message.startsWith("LLVM error")) {
reportedMessage = message;
} else {
final StringBuilder messageBuilder = new StringBuilder();
messageBuilder.append(throwable.getClass().getSimpleName());
messageBuilder.append(" ");
if (message != null) {
if (message != null && message.startsWith("LLVM error")) {
messageBuilder.append(message);
} else {
messageBuilder.append("<no message>");
}

if (throwable.getStackTrace().length > 0) {
messageBuilder.append(t.getClass().getSimpleName());
messageBuilder.append(" ");
messageBuilder.append(throwable.getStackTrace()[0].toString());
if (message != null) {
messageBuilder.append(message);
} else {
messageBuilder.append("<no message>");
}

if (t.getStackTrace().length > 0) {
messageBuilder.append(" ");
messageBuilder.append(t.getStackTrace()[0].toString());
}

t = t.getCause();
if (t != null) {
messageBuilder.append("\nCaused by: ");
}
}
reportedMessage = messageBuilder.toString();
}

return coreExceptions().internalError(reportedMessage, this, throwable);
return coreExceptions().internalError(messageBuilder.toString(), this, throwable);
}

}
2 changes: 1 addition & 1 deletion truffle/src/main/ruby/core/rbconfig.rb
Original file line number Diff line number Diff line change
@@ -105,7 +105,7 @@ module RbConfig
'CPP' => cpp,
'COMPILE_C' => "$(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$< -o $@ && #{opt} -S -always-inline -mem2reg $@ -o $@",
'CFLAGS' => " -emit-llvm -I#{ENV['OPENSSL_HOME']}/include -DHAVE_OPENSSL_110_THREADING_API -DHAVE_HMAC_CTX_COPY -DHAVE_EVP_CIPHER_CTX_COPY -DHAVE_BN_RAND_RANGE -DHAVE_BN_PSEUDO_RAND_RANGE -DHAVE_X509V3_EXT_NCONF_NID -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens ",
'LINK_SO' => "mx -v -p #{ENV['SULONG_HOME']} su-link -o $@ -l #{ENV['OPENSSL_HOME']}/lib/libssl.dylib $(OBJS)",
'LINK_SO' => "mx -v -p #{ENV['SULONG_HOME']} su-link -o $@ -l #{ENV['OPENSSL_LIB']} $(OBJS)",
'TRY_LINK' => "#{clang} $(src) $(INCFLAGS) $(CFLAGS) -I#{ENV['SULONG_HOME']}/include $(LIBS)"
})