diff options
author | 2015-03-04 11:13:16 +0000 | |
---|---|---|
committer | 2015-03-04 11:13:17 +0000 | |
commit | 3d7d2af4c6502b771b032ee9bf3ab30e78f9c60d (patch) | |
tree | cc15416fa8208661fe98a19055fa4c98010a0e53 /runtime/interpreter/interpreter_common.cc | |
parent | 87896b3a1f97c815fe02c7490c1f27951c58bbbf (diff) | |
parent | 7642cfc90fc9c3ebfd8e3b5041915705c93b5cf0 (diff) |
Merge "Change how we report exceptions to the debugger."
Diffstat (limited to 'runtime/interpreter/interpreter_common.cc')
-rw-r--r-- | runtime/interpreter/interpreter_common.cc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/runtime/interpreter/interpreter_common.cc b/runtime/interpreter/interpreter_common.cc index 3ab7f3036e..754602f943 100644 --- a/runtime/interpreter/interpreter_common.cc +++ b/runtime/interpreter/interpreter_common.cc @@ -491,12 +491,12 @@ uint32_t FindNextInstructionFollowingException(Thread* self, ThrowLocation throw_location; StackHandleScope<3> hs(self); Handle<mirror::Throwable> exception(hs.NewHandle(self->GetException(&throw_location))); - if (!self->IsExceptionReportedToInstrumentation() && instrumentation->HasExceptionCaughtListeners()) { + if (instrumentation->HasExceptionCaughtListeners() + && self->IsExceptionThrownByCurrentMethod(exception.Get())) { CatchLocationFinder clf(self, &exception); clf.WalkStack(false); instrumentation->ExceptionCaughtEvent(self, throw_location, clf.GetCatchMethod(), clf.GetCatchDexPc(), exception.Get()); - self->SetExceptionReportedToInstrumentation(true); } bool clear_exception = false; uint32_t found_dex_pc; @@ -507,13 +507,12 @@ uint32_t FindNextInstructionFollowingException(Thread* self, &clear_exception); } if (found_dex_pc == DexFile::kDexNoIndex) { + // Exception is not caught by the current method. We will unwind to the + // caller. Notify any instrumentation listener. instrumentation->MethodUnwindEvent(self, shadow_frame.GetThisObject(), shadow_frame.GetMethod(), dex_pc); } else { - if (self->IsExceptionReportedToInstrumentation()) { - instrumentation->MethodUnwindEvent(self, shadow_frame.GetThisObject(), - shadow_frame.GetMethod(), dex_pc); - } + // Exception is caught in the current method. We will jump to the found_dex_pc. if (clear_exception) { self->ClearException(); } |