summaryrefslogtreecommitdiffstats
path: root/runtime/interpreter
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2015-02-26 10:56:09 +0000
committerNicolas Geoffray <ngeoffray@google.com>2015-03-03 17:50:49 +0000
commit7642cfc90fc9c3ebfd8e3b5041915705c93b5cf0 (patch)
tree807b3c797483310ac23954c5eddb7441b91749c5 /runtime/interpreter
parentdc47e986941b1a3754447fabea272485f3f0f382 (diff)
downloadart-7642cfc90fc9c3ebfd8e3b5041915705c93b5cf0.zip
art-7642cfc90fc9c3ebfd8e3b5041915705c93b5cf0.tar.gz
art-7642cfc90fc9c3ebfd8e3b5041915705c93b5cf0.tar.bz2
Change how we report exceptions to the debugger.
This is only a refactoring/cleanup. Bug fixes with respect to catch location, and more cleanups will follow. Change-Id: I30d3c6260b0c8f8115a811621397225b88f2063a
Diffstat (limited to 'runtime/interpreter')
-rw-r--r--runtime/interpreter/interpreter_common.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/runtime/interpreter/interpreter_common.cc b/runtime/interpreter/interpreter_common.cc
index 3ab7f30..754602f 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();
}