Pass the debug_info_offset explicitly.
In order to use debug_info_offset for encoding implementation details,
rewrite all indirect users of it to fetch it before calling DexFile
methods.
This allows keeping the DexFile interface clean of runtime
considerations.
Test: test.py
Change-Id: I4591e0039b5f822f4409aae411071ecbe97082b1
diff --git a/compiler/debug/elf_debug_line_writer.h b/compiler/debug/elf_debug_line_writer.h
index 6e72b46..943e03a 100644
--- a/compiler/debug/elf_debug_line_writer.h
+++ b/compiler/debug/elf_debug_line_writer.h
@@ -26,6 +26,7 @@
#include "debug/src_map_elem.h"
#include "dex_file-inl.h"
#include "linker/elf_builder.h"
+#include "oat_file.h"
#include "stack_map.h"
namespace art {
@@ -158,7 +159,9 @@
PositionInfos dex2line_map;
DCHECK(mi->dex_file != nullptr);
const DexFile* dex = mi->dex_file;
- if (!dex->DecodeDebugPositionInfo(mi->code_item, PositionInfoCallback, &dex2line_map)) {
+ uint32_t debug_info_offset = OatFile::GetDebugInfoOffset(*dex, mi->code_item);
+ if (!dex->DecodeDebugPositionInfo(
+ mi->code_item, debug_info_offset, PositionInfoCallback, &dex2line_map)) {
continue;
}