diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/class_linker.cc | 5 | ||||
| -rw-r--r-- | src/object.cc | 31 |
2 files changed, 21 insertions, 15 deletions
diff --git a/src/class_linker.cc b/src/class_linker.cc index 0e9e43a167..cccf0f65c5 100644 --- a/src/class_linker.cc +++ b/src/class_linker.cc @@ -1898,9 +1898,10 @@ void ClassLinker::VerifyClass(Class* klass) { // Sanity check that a verified class has GC maps on all methods CheckMethodsHaveGcMaps(klass); } else { - LOG(ERROR) << "Verification failed on class " << PrettyClass(klass); + LOG(ERROR) << "Verification failed on class " << PrettyDescriptor(klass) + << " in " << klass->GetDexCache()->GetLocation()->ToModifiedUtf8(); Thread* self = Thread::Current(); - CHECK(!self->IsExceptionPending()) << PrettyTypeOf(self->GetException()) << PrettyClass(klass); + CHECK(!self->IsExceptionPending()) << self->GetException()->Dump(); self->ThrowNewExceptionF("Ljava/lang/VerifyError;", "Verification of %s failed", PrettyDescriptor(klass).c_str()); CHECK_EQ(klass->GetStatus(), Class::kStatusVerifying) << PrettyClass(klass); diff --git a/src/object.cc b/src/object.cc index c16cdb0123..7f6e451241 100644 --- a/src/object.cc +++ b/src/object.cc @@ -1347,20 +1347,25 @@ bool Throwable::IsCheckedException() const { } std::string Throwable::Dump() const { + std::string result(PrettyTypeOf(this)); + result += ": "; + String* msg = GetFieldObject<String*>(OFFSET_OF_OBJECT_MEMBER(Throwable, detail_message_), false); + if (msg != NULL) { + result += msg->ToModifiedUtf8(); + } + result += "\n"; Object* stack_state = GetStackState(); - if (stack_state == NULL || !stack_state->IsObjectArray()) { - // missing or corrupt stack state - return ""; - } - // Decode the internal stack trace into the depth and method trace - ObjectArray<Object>* method_trace = down_cast<ObjectArray<Object>*>(stack_state); - int32_t depth = method_trace->GetLength() - 1; - std::string result; - for (int32_t i = 0; i < depth; ++i) { - Method* method = down_cast<Method*>(method_trace->Get(i)); - result += " at "; - result += PrettyMethod(method, true); - result += "\n"; + // check stack state isn't missing or corrupt + if (stack_state != NULL && stack_state->IsObjectArray()) { + // Decode the internal stack trace into the depth and method trace + ObjectArray<Object>* method_trace = down_cast<ObjectArray<Object>*>(stack_state); + int32_t depth = method_trace->GetLength() - 1; + for (int32_t i = 0; i < depth; ++i) { + Method* method = down_cast<Method*>(method_trace->Get(i)); + result += " at "; + result += PrettyMethod(method, true); + result += "\n"; + } } return result; } |