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/mirror/abstract_method-inl.h b/runtime/mirror/abstract_method-inl.h
index a823886..39fc89e 100644
--- a/runtime/mirror/abstract_method-inl.h
+++ b/runtime/mirror/abstract_method-inl.h
@@ -114,17 +114,21 @@
   if (IsNative() || IsRuntimeMethod() || IsProxyMethod()) {
     return;
   }
-  if (GetEntryPointFromCompiledCode() == GetInterpreterEntryPoint()) {
+  if (pc == GetInstrumentationExitPc()) {
+    return;
+  }
+  const void* code = GetEntryPointFromCompiledCode();
+  if (code == GetInterpreterEntryPoint() || code == GetInstrumentationEntryPoint()) {
     return;
   }
   ClassLinker* class_linker = Runtime::Current()->GetClassLinker();
-  if (GetEntryPointFromCompiledCode() == GetResolutionTrampoline(class_linker)) {
-      return;
+  if (code == GetResolutionTrampoline(class_linker)) {
+    return;
   }
   DCHECK(IsWithinCode(pc))
       << PrettyMethod(this)
       << " pc=" << std::hex << pc
-      << " code=" << GetEntryPointFromCompiledCode()
+      << " code=" << code
       << " size=" << GetCodeSize();
 }