Fixes to instrumentation for debug build and interpreter.

- Stub uninstall will put back the interpreter entry point if Xint
  mode is specified.
- Copy method entry and exit listeners before iterating over them
  to prevent problems that occur when they are modified during
  iteration.
- Corrected checks from WalkStack and AssertPcIsWithinCode to
  handle instrumented code since they are used to remove the stubs.

Change-Id: Ib0e2b421e6b56d520e4643699624dd80ee5148e3
diff --git a/runtime/stack.cc b/runtime/stack.cc
index fcd0f2d..f4ae81d 100644
--- a/runtime/stack.cc
+++ b/runtime/stack.cc
@@ -289,7 +289,6 @@
       DCHECK(current_fragment->GetTopShadowFrame() == NULL);
       mirror::AbstractMethod* method = *cur_quick_frame_;
       while (method != NULL) {
-        DCHECK(cur_quick_frame_pc_ != GetInstrumentationExitPc());
         SanityCheckFrame();
         bool should_continue = VisitFrame();
         if (UNLIKELY(!should_continue)) {
@@ -312,9 +311,7 @@
             instrumentation_stack_depth++;
             if (instrumentation_frame.interpreter_entry_) {
               mirror::AbstractMethod* callee = Runtime::Current()->GetCalleeSaveMethod(Runtime::kRefsAndArgs);
-              if (GetMethod() != callee) {
-                LOG(FATAL) << "Expected: " << callee << " Found: " << PrettyMethod(GetMethod());
-              }
+              CHECK_EQ(GetMethod(), callee);
             } else if (instrumentation_frame.method_ != GetMethod()) {
               LOG(FATAL)  << "Expected: " << PrettyMethod(instrumentation_frame.method_)
                 << " Found: " << PrettyMethod(GetMethod());