summaryrefslogtreecommitdiff
path: root/runtime/quick_exception_handler.cc
diff options
context:
space:
mode:
author Mythri Alle <mythria@google.com> 2022-12-19 09:40:18 +0000
committer Mythri Alle <mythria@google.com> 2023-01-04 15:15:23 +0000
commit5497f749b4d35c7b0767d21cb487e2fee293cd07 (patch)
treeab9d266fa3e38628486b1dcdbdcbd43237851aed /runtime/quick_exception_handler.cc
parent3cde18ddf4a7af5aabd183eab59f052065270f10 (diff)
Fix method tracing in non-debuggable runtimes
There are a few fixes needed for correctly supporting method tracing in non-debuggable runtimes: 1. When we start method tracing we report method entry events for methods already on the stack with the expectation that method exit events would be called when method finishes. In non-debuggable runtimes some of these may not support method exit events, so report method entry events only if the frame supports them. 2. When method tracing is enabled, we switch the runtime to debuggable. When we switch to debuggable runtime, we missed updating entrypoints and deoptimizing boot image. Fix it so we get method entry / exit events for all methods. Also updates test 2246-method-trace to work in non-debuggable runtimes. Bug: 259258187 Test: art/testrunner.py -t 2246 Change-Id: I040416c7cb72062c02312eedb5bcd41da09e53dc
Diffstat (limited to 'runtime/quick_exception_handler.cc')
-rw-r--r--runtime/quick_exception_handler.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/runtime/quick_exception_handler.cc b/runtime/quick_exception_handler.cc
index eb9b47180f..1dc90097e0 100644
--- a/runtime/quick_exception_handler.cc
+++ b/runtime/quick_exception_handler.cc
@@ -476,6 +476,12 @@ class DeoptimizeStackVisitor final : public StackVisitor {
} else {
HandleOptimizingDeoptimization(method, new_frame, updated_vregs);
}
+ // Update if method exit event needs to be reported. We should report exit event only if we
+ // have reported an entry event. So tell interpreter if/ an entry event was reported.
+ bool supports_exit_events =
+ Runtime::Current()->GetInstrumentation()->MethodSupportsExitEvents(
+ method, GetCurrentOatQuickMethodHeader());
+ new_frame->SetSkipMethodExitEvents(!supports_exit_events);
if (updated_vregs != nullptr) {
// Calling Thread::RemoveDebuggerShadowFrameMapping will also delete the updated_vregs
// array so this must come after we processed the frame.