diff options
| -rw-r--r-- | compiler/debug/elf_symtab_writer.h | 2 | ||||
| -rw-r--r-- | dex2oat/linker/oat_writer.cc | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/compiler/debug/elf_symtab_writer.h b/compiler/debug/elf_symtab_writer.h index 9007360d01..a853714d2b 100644 --- a/compiler/debug/elf_symtab_writer.h +++ b/compiler/debug/elf_symtab_writer.h @@ -108,7 +108,7 @@ static void WriteDebugSymbols(linker::ElfBuilder<ElfTypes>* builder, uint64_t dex_address = dex->GetAddress() + it.first /* offset within the section */; const DexFile* dex_file = it.second; typename ElfTypes::Word dex_name = strtab->Write(kDexFileSymbolName); - symtab->Add(dex_name, dex, dex_address, dex_file->Size(), STB_LOCAL, STT_NOTYPE); + symtab->Add(dex_name, dex, dex_address, dex_file->Size(), STB_GLOBAL, STT_FUNC); if (mini_debug_info) { continue; // Don't add interpreter method names to mini-debug-info for now. } diff --git a/dex2oat/linker/oat_writer.cc b/dex2oat/linker/oat_writer.cc index 44493283db..849887c8ff 100644 --- a/dex2oat/linker/oat_writer.cc +++ b/dex2oat/linker/oat_writer.cc @@ -4220,9 +4220,11 @@ debug::DebugInfo OatWriter::GetDebugInfo() const { debug::DebugInfo debug_info{}; debug_info.compiled_methods = ArrayRef<const debug::MethodDebugInfo>(method_info_); if (dex_files_ != nullptr) { - for (auto dex_file : *dex_files_) { - uint32_t offset = vdex_dex_files_offset_ + (dex_file->Begin() - (*dex_files_)[0]->Begin()); - debug_info.dex_files.emplace(offset, dex_file); + 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); } } return debug_info; |