summaryrefslogtreecommitdiffstats
path: root/runtime/mirror
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2015-03-04 11:13:16 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-03-04 11:13:17 +0000
commit3d7d2af4c6502b771b032ee9bf3ab30e78f9c60d (patch)
treecc15416fa8208661fe98a19055fa4c98010a0e53 /runtime/mirror
parent87896b3a1f97c815fe02c7490c1f27951c58bbbf (diff)
parent7642cfc90fc9c3ebfd8e3b5041915705c93b5cf0 (diff)
downloadart-3d7d2af4c6502b771b032ee9bf3ab30e78f9c60d.tar.gz
art-3d7d2af4c6502b771b032ee9bf3ab30e78f9c60d.tar.bz2
art-3d7d2af4c6502b771b032ee9bf3ab30e78f9c60d.zip
Merge "Change how we report exceptions to the debugger."
Diffstat (limited to 'runtime/mirror')
-rw-r--r--runtime/mirror/art_method.cc2
-rw-r--r--runtime/mirror/class.cc2
-rw-r--r--runtime/mirror/throwable.cc7
-rw-r--r--runtime/mirror/throwable.h2
4 files changed, 9 insertions, 4 deletions
diff --git a/runtime/mirror/art_method.cc b/runtime/mirror/art_method.cc
index 26f6f345d5..85fc5f3c96 100644
--- a/runtime/mirror/art_method.cc
+++ b/runtime/mirror/art_method.cc
@@ -274,7 +274,6 @@ uint32_t ArtMethod::FindCatchBlock(Handle<ArtMethod> h_this, Handle<Class> excep
ThrowLocation throw_location;
StackHandleScope<1> hs(self);
Handle<mirror::Throwable> exception(hs.NewHandle(self->GetException(&throw_location)));
- bool is_exception_reported = self->IsExceptionReportedToInstrumentation();
self->ClearException();
// Default to handler not found.
uint32_t found_dex_pc = DexFile::kDexNoIndex;
@@ -311,7 +310,6 @@ uint32_t ArtMethod::FindCatchBlock(Handle<ArtMethod> h_this, Handle<Class> excep
// Put the exception back.
if (exception.Get() != nullptr) {
self->SetException(throw_location, exception.Get());
- self->SetExceptionReportedToInstrumentation(is_exception_reported);
}
return found_dex_pc;
}
diff --git a/runtime/mirror/class.cc b/runtime/mirror/class.cc
index ae684b162c..96b15dd676 100644
--- a/runtime/mirror/class.cc
+++ b/runtime/mirror/class.cc
@@ -84,7 +84,6 @@ void Class::SetStatus(Status new_status, Thread* self) {
Handle<mirror::Object> old_throw_this_object(hs.NewHandle(old_throw_location.GetThis()));
Handle<mirror::ArtMethod> old_throw_method(hs.NewHandle(old_throw_location.GetMethod()));
uint32_t old_throw_dex_pc = old_throw_location.GetDexPc();
- bool is_exception_reported = self->IsExceptionReportedToInstrumentation();
Class* eiie_class;
// Do't attempt to use FindClass if we have an OOM error since this can try to do more
// allocations and may cause infinite loops.
@@ -113,7 +112,6 @@ void Class::SetStatus(Status new_status, Thread* self) {
ThrowLocation gc_safe_throw_location(old_throw_this_object.Get(), old_throw_method.Get(),
old_throw_dex_pc);
self->SetException(gc_safe_throw_location, old_exception.Get());
- self->SetExceptionReportedToInstrumentation(is_exception_reported);
}
static_assert(sizeof(Status) == sizeof(uint32_t), "Size of status not equal to uint32");
if (Runtime::Current()->IsActiveTransaction()) {
diff --git a/runtime/mirror/throwable.cc b/runtime/mirror/throwable.cc
index 61d85e2fe2..fdfeb47da0 100644
--- a/runtime/mirror/throwable.cc
+++ b/runtime/mirror/throwable.cc
@@ -69,6 +69,13 @@ bool Throwable::IsCheckedException() {
return !InstanceOf(WellKnownClasses::ToClass(WellKnownClasses::java_lang_RuntimeException));
}
+int32_t Throwable::GetStackDepth() {
+ Object* stack_state = GetStackState();
+ if (stack_state == nullptr || !stack_state->IsObjectArray()) return -1;
+ ObjectArray<Object>* method_trace = down_cast<ObjectArray<Object>*>(stack_state);
+ return method_trace->GetLength() - 1;
+}
+
std::string Throwable::Dump() {
std::string result(PrettyTypeOf(this));
result += ": ";
diff --git a/runtime/mirror/throwable.h b/runtime/mirror/throwable.h
index f90812d2ec..c22475b4ce 100644
--- a/runtime/mirror/throwable.h
+++ b/runtime/mirror/throwable.h
@@ -51,6 +51,8 @@ class MANAGED Throwable : public Object {
return java_lang_Throwable_.Read();
}
+ int32_t GetStackDepth() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
+
static void SetClass(Class* java_lang_Throwable);
static void ResetClass();
static void VisitRoots(RootCallback* callback, void* arg)