Exclude oob dexfiles from debug symbols.
Those dex files are not mmaped within the ELF file, so it
does not make sense to create debug symbols for them.
Test: testrunner.py --host -t 137
Change-Id: I39a43bc2f264a4180a980a8cba821166e7d9bcad
diff --git a/dex2oat/linker/oat_writer.cc b/dex2oat/linker/oat_writer.cc
index d245cd1..0953e08 100644
--- a/dex2oat/linker/oat_writer.cc
+++ b/dex2oat/linker/oat_writer.cc
@@ -4364,12 +4364,15 @@
debug::DebugInfo OatWriter::GetDebugInfo() const {
debug::DebugInfo debug_info{};
debug_info.compiled_methods = ArrayRef<const debug::MethodDebugInfo>(method_info_);
- if (dex_files_ != nullptr) {
+ if (VdexWillContainDexFiles()) {
DCHECK_EQ(dex_files_->size(), oat_dex_files_.size());
for (size_t i = 0, size = dex_files_->size(); i != size; ++i) {
const DexFile* dex_file = (*dex_files_)[i];
const OatDexFile& oat_dex_file = oat_dex_files_[i];
- debug_info.dex_files.emplace(oat_dex_file.dex_file_offset_, dex_file);
+ uint32_t dex_file_offset = oat_dex_file.dex_file_offset_;
+ if (dex_file_offset != 0) {
+ debug_info.dex_files.emplace(dex_file_offset, dex_file);
+ }
}
}
return debug_info;
diff --git a/dex2oat/linker/oat_writer.h b/dex2oat/linker/oat_writer.h
index dfcaafc..7edb032 100644
--- a/dex2oat/linker/oat_writer.h
+++ b/dex2oat/linker/oat_writer.h
@@ -340,6 +340,10 @@
bool MayHaveCompiledMethods() const;
+ bool VdexWillContainDexFiles() const {
+ return dex_files_ != nullptr && !only_contains_uncompressed_zip_entries_;
+ }
+
// Find the address of the GcRoot<String> in the InternTable for a boot image string.
const uint8_t* LookupBootImageInternTableSlot(const DexFile& dex_file,
dex::StringIndex string_idx);