Revert "Revert "Make libdexfile build independent of runtime dir""

This reverts commit 787784f9effb126b5d0d3dc97d544c4a477b5daf.

Reason for revert: Bot configuration issue.

Change-Id: I6a10bb4a9571f89c7e4dd095f9157e830a44e2de
Bug: 22322814
Test: make -j 50 checkbuild
diff --git a/runtime/debugger.cc b/runtime/debugger.cc
index 842cd73..61ad725 100644
--- a/runtime/debugger.cc
+++ b/runtime/debugger.cc
@@ -37,6 +37,7 @@
 #include "dex/dex_file_annotations.h"
 #include "dex/dex_file_types.h"
 #include "dex/dex_instruction.h"
+#include "dex/utf.h"
 #include "entrypoints/runtime_asm_entrypoints.h"
 #include "gc/accounting/card_table-inl.h"
 #include "gc/allocation_record.h"
@@ -66,7 +67,6 @@
 #include "scoped_thread_state_change-inl.h"
 #include "stack.h"
 #include "thread_list.h"
-#include "utf.h"
 #include "well_known_classes.h"
 
 namespace art {
@@ -1533,7 +1533,7 @@
  */
 static uint16_t MangleSlot(uint16_t slot, ArtMethod* m)
     REQUIRES_SHARED(Locks::mutator_lock_) {
-  CodeItemDataAccessor accessor(m);
+  CodeItemDataAccessor accessor(m->DexInstructionData());
   if (!accessor.HasCodeItem()) {
     // We should not get here for a method without code (native, proxy or abstract). Log it and
     // return the slot as is since all registers are arguments.
@@ -1564,7 +1564,7 @@
  */
 static uint16_t DemangleSlot(uint16_t slot, ArtMethod* m, JDWP::JdwpError* error)
     REQUIRES_SHARED(Locks::mutator_lock_) {
-  CodeItemDataAccessor accessor(m);
+  CodeItemDataAccessor accessor(m->DexInstructionData());
   if (!accessor.HasCodeItem()) {
     // We should not get here for a method without code (native, proxy or abstract). Log it and
     // return the slot as is since all registers are arguments.
@@ -1675,7 +1675,7 @@
     }
   };
   ArtMethod* m = FromMethodId(method_id);
-  CodeItemDebugInfoAccessor accessor(m);
+  CodeItemDebugInfoAccessor accessor(m->DexInstructionDebugInfo());
   uint64_t start, end;
   if (!accessor.HasCodeItem()) {
     DCHECK(m->IsNative() || m->IsProxyMethod());
@@ -1741,7 +1741,7 @@
     }
   };
   ArtMethod* m = FromMethodId(method_id);
-  CodeItemDebugInfoAccessor accessor(m);
+  CodeItemDebugInfoAccessor accessor(m->DexInstructionDebugInfo());
 
   // arg_count considers doubles and longs to take 2 units.
   // variable_count considers everything to take 1 unit.
@@ -1791,7 +1791,7 @@
   if (m == nullptr) {
     return JDWP::ERR_INVALID_METHODID;
   }
-  CodeItemDataAccessor accessor(m);
+  CodeItemDataAccessor accessor(m->DexInstructionData());
   size_t byte_count = accessor.InsnsSizeInCodeUnits() * 2;
   const uint8_t* begin = reinterpret_cast<const uint8_t*>(accessor.Insns());
   const uint8_t* end = begin + byte_count;
@@ -3908,7 +3908,7 @@
   // Note: if the thread is not running Java code (pure native thread), there is no "current"
   // method on the stack (and no line number either).
   if (m != nullptr && !m->IsNative()) {
-    CodeItemDebugInfoAccessor accessor(m);
+    CodeItemDebugInfoAccessor accessor(m->DexInstructionDebugInfo());
     DebugCallbackContext context(single_step_control, line_number, accessor.InsnsSizeInCodeUnits());
     m->GetDexFile()->DecodeDebugPositionInfo(accessor.DebugInfoOffset(),
                                              DebugCallbackContext::Callback,