diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2015-02-26 10:56:09 +0000 |
---|---|---|
committer | Nicolas Geoffray <ngeoffray@google.com> | 2015-03-03 17:50:49 +0000 |
commit | 7642cfc90fc9c3ebfd8e3b5041915705c93b5cf0 (patch) | |
tree | 807b3c797483310ac23954c5eddb7441b91749c5 /runtime/quick_exception_handler.cc | |
parent | dc47e986941b1a3754447fabea272485f3f0f382 (diff) | |
download | art-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/quick_exception_handler.cc')
-rw-r--r-- | runtime/quick_exception_handler.cc | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/runtime/quick_exception_handler.cc b/runtime/quick_exception_handler.cc index 7bdf652..1ddb761 100644 --- a/runtime/quick_exception_handler.cc +++ b/runtime/quick_exception_handler.cc @@ -115,8 +115,7 @@ class CatchBlockStackVisitor FINAL : public StackVisitor { }; void QuickExceptionHandler::FindCatch(const ThrowLocation& throw_location, - mirror::Throwable* exception, - bool is_exception_reported) { + mirror::Throwable* exception) { DCHECK(!is_deoptimization_); if (kDebugExceptionDelivery) { mirror::String* msg = exception->GetDetailMessage(); @@ -147,23 +146,14 @@ void QuickExceptionHandler::FindCatch(const ThrowLocation& throw_location, } else { // Put exception back in root set with clear throw location. self_->SetException(ThrowLocation(), exception_ref.Get()); - self_->SetExceptionReportedToInstrumentation(is_exception_reported); } // The debugger may suspend this thread and walk its stack. Let's do this before popping // instrumentation frames. - if (!is_exception_reported) { - instrumentation::Instrumentation* instrumentation = Runtime::Current()->GetInstrumentation(); + instrumentation::Instrumentation* instrumentation = Runtime::Current()->GetInstrumentation(); + if (instrumentation->HasExceptionCaughtListeners() + && self_->IsExceptionThrownByCurrentMethod(exception)) { instrumentation->ExceptionCaughtEvent(self_, throw_location, handler_method_, handler_dex_pc_, exception_ref.Get()); - // We're not catching this exception but let's remind we already reported the exception above - // to avoid reporting it twice. - self_->SetExceptionReportedToInstrumentation(true); - } - bool caught_exception = (handler_method_ != nullptr && handler_dex_pc_ != DexFile::kDexNoIndex); - if (caught_exception) { - // We're catching this exception so we finish reporting it. We do it here to avoid doing it - // in the compiled code. - self_->SetExceptionReportedToInstrumentation(false); } } |