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
9 files changed