diff options
Diffstat (limited to 'compiler/dwarf')
| -rw-r--r-- | compiler/dwarf/debug_info_entry_writer.h | 11 | ||||
| -rw-r--r-- | compiler/dwarf/dwarf_test.h | 1 | ||||
| -rw-r--r-- | compiler/dwarf/headers.h | 7 | ||||
| -rw-r--r-- | compiler/dwarf/method_debug_info.h | 41 | ||||
| -rw-r--r-- | compiler/dwarf/register.h | 5 |
5 files changed, 58 insertions, 7 deletions
diff --git a/compiler/dwarf/debug_info_entry_writer.h b/compiler/dwarf/debug_info_entry_writer.h index aa31036c8b..a551e4b495 100644 --- a/compiler/dwarf/debug_info_entry_writer.h +++ b/compiler/dwarf/debug_info_entry_writer.h @@ -112,6 +112,12 @@ class DebugInfoEntryWriter FINAL : private Writer<Vector> { this->PushData(ptr, num_bytes); } + void WriteExprLoc(Attribute attrib, const void* ptr, size_t num_bytes) { + AddAbbrevAttribute(attrib, DW_FORM_exprloc); + this->PushUleb128(dchecked_integral_cast<uint32_t>(num_bytes)); + this->PushData(ptr, num_bytes); + } + void WriteData1(Attribute attrib, uint8_t value) { AddAbbrevAttribute(attrib, DW_FORM_data1); this->PushUint8(value); @@ -132,6 +138,11 @@ class DebugInfoEntryWriter FINAL : private Writer<Vector> { this->PushUint64(value); } + void WriteSecOffset(Attribute attrib, uint32_t offset) { + AddAbbrevAttribute(attrib, DW_FORM_sec_offset); + this->PushUint32(offset); + } + void WriteSdata(Attribute attrib, int value) { AddAbbrevAttribute(attrib, DW_FORM_sdata); this->PushSleb128(value); diff --git a/compiler/dwarf/dwarf_test.h b/compiler/dwarf/dwarf_test.h index 5464ed9c49..c3a3ca9425 100644 --- a/compiler/dwarf/dwarf_test.h +++ b/compiler/dwarf/dwarf_test.h @@ -29,6 +29,7 @@ #include "common_runtime_test.h" #include "elf_builder.h" #include "gtest/gtest.h" +#include "linker/file_output_stream.h" #include "os.h" namespace art { diff --git a/compiler/dwarf/headers.h b/compiler/dwarf/headers.h index c75aeacabd..f76f76f7b6 100644 --- a/compiler/dwarf/headers.h +++ b/compiler/dwarf/headers.h @@ -134,7 +134,7 @@ void WriteDebugInfoCU(uint32_t debug_abbrev_offset, Writer<> writer(debug_info); size_t start = writer.data()->size(); writer.PushUint32(0); // Length placeholder. - writer.PushUint16(3); // Version. + writer.PushUint16(4); // Version. writer.PushUint32(debug_abbrev_offset); writer.PushUint8(entries.Is64bit() ? 8 : 4); size_t entries_offset = writer.data()->size(); @@ -167,10 +167,7 @@ void WriteDebugLineTable(const std::vector<std::string>& include_directories, Writer<> writer(debug_line); size_t header_start = writer.data()->size(); writer.PushUint32(0); // Section-length placeholder. - // Claim DWARF-2 version even though we use some DWARF-3 features. - // DWARF-2 consumers will ignore the unknown opcodes. - // This is what clang currently does. - writer.PushUint16(2); // .debug_line version. + writer.PushUint16(3); // .debug_line version. size_t header_length_pos = writer.data()->size(); writer.PushUint32(0); // Header-length placeholder. writer.PushUint8(1 << opcodes.GetCodeFactorBits()); diff --git a/compiler/dwarf/method_debug_info.h b/compiler/dwarf/method_debug_info.h new file mode 100644 index 0000000000..a391e4d08a --- /dev/null +++ b/compiler/dwarf/method_debug_info.h @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2015 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ART_COMPILER_DWARF_METHOD_DEBUG_INFO_H_ +#define ART_COMPILER_DWARF_METHOD_DEBUG_INFO_H_ + +#include "dex_file.h" + +namespace art { +class CompiledMethod; +namespace dwarf { + +struct MethodDebugInfo { + const DexFile* dex_file_; + size_t class_def_index_; + uint32_t dex_method_index_; + uint32_t access_flags_; + const DexFile::CodeItem* code_item_; + bool deduped_; + uint32_t low_pc_; + uint32_t high_pc_; + CompiledMethod* compiled_method_; +}; + +} // namespace dwarf +} // namespace art + +#endif // ART_COMPILER_DWARF_METHOD_DEBUG_INFO_H_ diff --git a/compiler/dwarf/register.h b/compiler/dwarf/register.h index 70452377dd..b67e8ddc9d 100644 --- a/compiler/dwarf/register.h +++ b/compiler/dwarf/register.h @@ -35,9 +35,10 @@ class Reg { // Arm64 mapping is correct since we already do this there. // libunwind might struggle with the new mapping as well. - static Reg ArmCore(int num) { return Reg(num); } + static Reg ArmCore(int num) { return Reg(num); } // R0-R15. static Reg ArmFp(int num) { return Reg(64 + num); } // S0–S31. - static Reg Arm64Core(int num) { return Reg(num); } + static Reg ArmDp(int num) { return Reg(256 + num); } // D0–D31. + static Reg Arm64Core(int num) { return Reg(num); } // X0-X31. static Reg Arm64Fp(int num) { return Reg(64 + num); } // V0-V31. static Reg MipsCore(int num) { return Reg(num); } static Reg Mips64Core(int num) { return Reg(num); } |