diff options
Diffstat (limited to 'compiler/debug')
| -rw-r--r-- | compiler/debug/debug_info.h | 3 | ||||
| -rw-r--r-- | compiler/debug/dwarf/dwarf_test.cc | 2 | ||||
| -rw-r--r-- | compiler/debug/dwarf/dwarf_test.h | 3 | ||||
| -rw-r--r-- | compiler/debug/elf_compilation_unit.h | 3 | ||||
| -rw-r--r-- | compiler/debug/elf_debug_frame_writer.h | 7 | ||||
| -rw-r--r-- | compiler/debug/elf_debug_info_writer.h | 9 | ||||
| -rw-r--r-- | compiler/debug/elf_debug_line_writer.h | 4 | ||||
| -rw-r--r-- | compiler/debug/elf_debug_loc_writer.h | 8 | ||||
| -rw-r--r-- | compiler/debug/elf_debug_writer.cc | 5 | ||||
| -rw-r--r-- | compiler/debug/elf_debug_writer.h | 6 | ||||
| -rw-r--r-- | compiler/debug/elf_symtab_writer.h | 5 | ||||
| -rw-r--r-- | compiler/debug/method_debug_info.h | 3 | ||||
| -rw-r--r-- | compiler/debug/src_map_elem.h | 4 | ||||
| -rw-r--r-- | compiler/debug/src_map_elem_test.cc | 2 |
14 files changed, 43 insertions, 21 deletions
diff --git a/compiler/debug/debug_info.h b/compiler/debug/debug_info.h index 04c6991ea3..4027f114ec 100644 --- a/compiler/debug/debug_info.h +++ b/compiler/debug/debug_info.h @@ -20,9 +20,10 @@ #include <map> #include "base/array_ref.h" +#include "base/macros.h" #include "method_debug_info.h" -namespace art { +namespace art HIDDEN { class DexFile; namespace debug { diff --git a/compiler/debug/dwarf/dwarf_test.cc b/compiler/debug/dwarf/dwarf_test.cc index 8897e45584..14c92b2380 100644 --- a/compiler/debug/dwarf/dwarf_test.cc +++ b/compiler/debug/dwarf/dwarf_test.cc @@ -23,7 +23,7 @@ #include "dwarf/headers.h" #include "gtest/gtest.h" -namespace art { +namespace art HIDDEN { namespace dwarf { // Run the tests only on host since we need objdump. diff --git a/compiler/debug/dwarf/dwarf_test.h b/compiler/debug/dwarf/dwarf_test.h index bad986a330..1a0a798d74 100644 --- a/compiler/debug/dwarf/dwarf_test.h +++ b/compiler/debug/dwarf/dwarf_test.h @@ -26,6 +26,7 @@ #include <set> #include <string> +#include "base/macros.h" #include "base/os.h" #include "base/unix_file/fd_file.h" #include "common_compiler_test.h" @@ -33,7 +34,7 @@ #include "gtest/gtest.h" #include "stream/file_output_stream.h" -namespace art { +namespace art HIDDEN { namespace dwarf { #define DW_CHECK(substring) Check(substring, false, __FILE__, __LINE__) diff --git a/compiler/debug/elf_compilation_unit.h b/compiler/debug/elf_compilation_unit.h index b1d89ebeb2..1d7523c350 100644 --- a/compiler/debug/elf_compilation_unit.h +++ b/compiler/debug/elf_compilation_unit.h @@ -19,9 +19,10 @@ #include <vector> +#include "base/macros.h" #include "debug/method_debug_info.h" -namespace art { +namespace art HIDDEN { namespace debug { struct ElfCompilationUnit { diff --git a/compiler/debug/elf_debug_frame_writer.h b/compiler/debug/elf_debug_frame_writer.h index 094e8871b9..6b72262e26 100644 --- a/compiler/debug/elf_debug_frame_writer.h +++ b/compiler/debug/elf_debug_frame_writer.h @@ -20,13 +20,14 @@ #include <vector> #include "arch/instruction_set.h" +#include "base/macros.h" #include "debug/method_debug_info.h" #include "dwarf/debug_frame_opcode_writer.h" #include "dwarf/dwarf_constants.h" #include "dwarf/headers.h" #include "elf/elf_builder.h" -namespace art { +namespace art HIDDEN { namespace debug { static constexpr bool kWriteDebugFrameHdr = false; @@ -88,6 +89,10 @@ static void WriteCIE(InstructionSet isa, /*inout*/ std::vector<uint8_t>* buffer) WriteCIE(is64bit, return_reg, opcodes, buffer); return; } + case InstructionSet::kRiscv64: { + UNIMPLEMENTED(FATAL); + return; + } case InstructionSet::kX86: { // FIXME: Add fp registers once libunwind adds support for them. Bug: 20491296 constexpr bool generate_opcodes_for_x86_fp = false; diff --git a/compiler/debug/elf_debug_info_writer.h b/compiler/debug/elf_debug_info_writer.h index 986c7e820f..9915a24a5f 100644 --- a/compiler/debug/elf_debug_info_writer.h +++ b/compiler/debug/elf_debug_info_writer.h @@ -22,6 +22,7 @@ #include <vector> #include "art_field-inl.h" +#include "base/macros.h" #include "debug/elf_compilation_unit.h" #include "debug/elf_debug_loc_writer.h" #include "debug/method_debug_info.h" @@ -32,14 +33,14 @@ #include "dwarf/debug_info_entry_writer.h" #include "elf/elf_builder.h" #include "heap_poisoning.h" -#include "linear_alloc.h" +#include "linear_alloc-inl.h" #include "mirror/array.h" #include "mirror/class-inl.h" #include "mirror/class.h" #include "oat_file.h" #include "obj_ptr-inl.h" -namespace art { +namespace art HIDDEN { namespace debug { static std::vector<const char*> GetParamNames(const MethodDebugInfo* mi) { @@ -478,7 +479,9 @@ class ElfCompilationUnitWriter { if (methods_ptr == nullptr) { // Some types might have no methods. Allocate empty array instead. LinearAlloc* allocator = Runtime::Current()->GetLinearAlloc(); - void* storage = allocator->Alloc(Thread::Current(), sizeof(LengthPrefixedArray<ArtMethod>)); + void* storage = allocator->Alloc(Thread::Current(), + sizeof(LengthPrefixedArray<ArtMethod>), + LinearAllocKind::kNoGCRoots); methods_ptr = new (storage) LengthPrefixedArray<ArtMethod>(0); type->SetMethodsPtr(methods_ptr, 0, 0); DCHECK(type->GetMethodsPtr() != nullptr); diff --git a/compiler/debug/elf_debug_line_writer.h b/compiler/debug/elf_debug_line_writer.h index 8d62747c66..4896bc1e9b 100644 --- a/compiler/debug/elf_debug_line_writer.h +++ b/compiler/debug/elf_debug_line_writer.h @@ -20,6 +20,7 @@ #include <unordered_set> #include <vector> +#include "base/macros.h" #include "debug/elf_compilation_unit.h" #include "debug/src_map_elem.h" #include "dex/dex_file-inl.h" @@ -29,7 +30,7 @@ #include "oat_file.h" #include "stack_map.h" -namespace art { +namespace art HIDDEN { namespace debug { using PositionInfos = std::vector<DexFile::PositionInfo>; @@ -73,6 +74,7 @@ class ElfDebugLineWriter { code_factor_bits_ = 2; // 32-bit instructions break; case InstructionSet::kNone: + case InstructionSet::kRiscv64: case InstructionSet::kX86: case InstructionSet::kX86_64: break; diff --git a/compiler/debug/elf_debug_loc_writer.h b/compiler/debug/elf_debug_loc_writer.h index 37ab948119..8cf476ed2d 100644 --- a/compiler/debug/elf_debug_loc_writer.h +++ b/compiler/debug/elf_debug_loc_writer.h @@ -21,13 +21,13 @@ #include <map> #include "arch/instruction_set.h" -#include "compiled_method.h" +#include "base/macros.h" #include "debug/method_debug_info.h" #include "dwarf/debug_info_entry_writer.h" #include "dwarf/register.h" #include "stack_map.h" -namespace art { +namespace art HIDDEN { namespace debug { using Reg = dwarf::Reg; @@ -38,6 +38,8 @@ static Reg GetDwarfCoreReg(InstructionSet isa, int machine_reg) { return Reg::ArmCore(machine_reg); case InstructionSet::kArm64: return Reg::Arm64Core(machine_reg); + case InstructionSet::kRiscv64: + return Reg::Riscv64Core(machine_reg); case InstructionSet::kX86: return Reg::X86Core(machine_reg); case InstructionSet::kX86_64: @@ -55,6 +57,8 @@ static Reg GetDwarfFpReg(InstructionSet isa, int machine_reg) { return Reg::ArmFp(machine_reg); case InstructionSet::kArm64: return Reg::Arm64Fp(machine_reg); + case InstructionSet::kRiscv64: + return Reg::Riscv64Fp(machine_reg); case InstructionSet::kX86: return Reg::X86Fp(machine_reg); case InstructionSet::kX86_64: diff --git a/compiler/debug/elf_debug_writer.cc b/compiler/debug/elf_debug_writer.cc index 765a81d4f8..8f64d73aa7 100644 --- a/compiler/debug/elf_debug_writer.cc +++ b/compiler/debug/elf_debug_writer.cc @@ -38,7 +38,7 @@ #include "oat.h" #include "stream/vector_output_stream.h" -namespace art { +namespace art HIDDEN { namespace debug { using ElfRuntimeTypes = std::conditional<sizeof(void*) == 4, ElfTypes32, ElfTypes64>::type; @@ -208,7 +208,8 @@ std::vector<uint8_t> MakeElfFileForJIT( using Reader = ElfDebugReader<ElfTypes>; Reader reader(buffer); reader.VisitFunctionSymbols([&](Elf_Sym sym, const char*) { - DCHECK_EQ(sym.st_value, method_info.code_address + CompiledMethod::CodeDelta(isa)); + DCHECK_EQ(sym.st_value, + method_info.code_address + GetInstructionSetEntryPointAdjustment(isa)); DCHECK_EQ(sym.st_size, method_info.code_size); num_syms++; }); diff --git a/compiler/debug/elf_debug_writer.h b/compiler/debug/elf_debug_writer.h index 1ce3c6f6f8..72b028cb97 100644 --- a/compiler/debug/elf_debug_writer.h +++ b/compiler/debug/elf_debug_writer.h @@ -27,7 +27,7 @@ #include "dwarf/dwarf_constants.h" #include "elf/elf_builder.h" -namespace art { +namespace art HIDDEN { class OatHeader; struct JITCodeEntry; namespace mirror { @@ -37,11 +37,11 @@ namespace debug { struct MethodDebugInfo; template <typename ElfTypes> -void WriteDebugInfo( +EXPORT void WriteDebugInfo( ElfBuilder<ElfTypes>* builder, const DebugInfo& debug_info); -std::vector<uint8_t> MakeMiniDebugInfo( +EXPORT std::vector<uint8_t> MakeMiniDebugInfo( InstructionSet isa, const InstructionSetFeatures* features, uint64_t text_section_address, diff --git a/compiler/debug/elf_symtab_writer.h b/compiler/debug/elf_symtab_writer.h index 410f704582..fcd6696fa8 100644 --- a/compiler/debug/elf_symtab_writer.h +++ b/compiler/debug/elf_symtab_writer.h @@ -21,6 +21,7 @@ #include <unordered_set> #include <unordered_map> +#include "base/macros.h" #include "base/utils.h" #include "debug/debug_info.h" #include "debug/method_debug_info.h" @@ -29,7 +30,7 @@ #include "dex/dex_file-inl.h" #include "elf/elf_builder.h" -namespace art { +namespace art HIDDEN { namespace debug { // The ARM specification defines three special mapping symbols @@ -153,7 +154,7 @@ static void WriteDebugSymbols(ElfBuilder<ElfTypes>* builder, uint64_t address = info.code_address; address += info.is_code_address_text_relative ? text->GetAddress() : 0; // Add in code delta, e.g., thumb bit 0 for Thumb2 code. - address += CompiledMethod::CodeDelta(info.isa); + address += GetInstructionSetEntryPointAdjustment(info.isa); symtab->Add(name_offset, text, address, info.code_size, STB_GLOBAL, STT_FUNC); } // Add symbols for dex files. diff --git a/compiler/debug/method_debug_info.h b/compiler/debug/method_debug_info.h index 152db6eaf0..b83c6e2052 100644 --- a/compiler/debug/method_debug_info.h +++ b/compiler/debug/method_debug_info.h @@ -21,9 +21,10 @@ #include "arch/instruction_set.h" #include "base/array_ref.h" +#include "base/macros.h" #include "dex/dex_file.h" -namespace art { +namespace art HIDDEN { namespace debug { struct MethodDebugInfo { diff --git a/compiler/debug/src_map_elem.h b/compiler/debug/src_map_elem.h index 5286b8c4dc..646a1f0fc7 100644 --- a/compiler/debug/src_map_elem.h +++ b/compiler/debug/src_map_elem.h @@ -19,7 +19,9 @@ #include <stdint.h> -namespace art { +#include "base/macros.h" + +namespace art HIDDEN { class SrcMapElem { public: diff --git a/compiler/debug/src_map_elem_test.cc b/compiler/debug/src_map_elem_test.cc index ceaa53fa99..bdbafd5b40 100644 --- a/compiler/debug/src_map_elem_test.cc +++ b/compiler/debug/src_map_elem_test.cc @@ -20,7 +20,7 @@ #include "base/macros.h" -namespace art { +namespace art HIDDEN { namespace debug { TEST(SrcMapElem, Operators) { |