Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion lldb/source/Plugins/SymbolFile/DWARF/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ add_lldb_library(lldbPluginSymbolFileDWARF PLUGIN
DWARFContext.cpp
DWARFDataExtractor.cpp
DWARFDebugAranges.cpp
DWARFDebugArangeSet.cpp
DWARFDebugInfo.cpp
DWARFDebugInfoEntry.cpp
DWARFDebugMacro.cpp
Expand Down
176 changes: 0 additions & 176 deletions lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp

This file was deleted.

70 changes: 0 additions & 70 deletions lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.h

This file was deleted.

47 changes: 13 additions & 34 deletions lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,65 +7,44 @@
//===----------------------------------------------------------------------===//

#include "DWARFDebugAranges.h"
#include "DWARFDebugArangeSet.h"
#include "DWARFUnit.h"
#include "LogChannelDWARF.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/Timer.h"
#include "llvm/DebugInfo/DWARF/DWARFDebugArangeSet.h"

using namespace lldb;
using namespace lldb_private;
using namespace lldb_private::plugin::dwarf;
using llvm::DWARFDebugArangeSet;

// Constructor
DWARFDebugAranges::DWARFDebugAranges() : m_aranges() {}

// CountArangeDescriptors
class CountArangeDescriptors {
public:
CountArangeDescriptors(uint32_t &count_ref) : count(count_ref) {
// printf("constructor CountArangeDescriptors()\n");
}
void operator()(const DWARFDebugArangeSet &set) {
count += set.NumDescriptors();
}
uint32_t &count;
};

// Extract
void DWARFDebugAranges::extract(const DWARFDataExtractor &debug_aranges_data) {
llvm::DWARFDataExtractor dwarf_data = debug_aranges_data.GetAsLLVMDWARF();
lldb::offset_t offset = 0;

DWARFDebugArangeSet set;
Range range;
while (debug_aranges_data.ValidOffset(offset)) {
while (dwarf_data.isValidOffset(offset)) {
const lldb::offset_t set_offset = offset;
if (llvm::Error error = set.extract(debug_aranges_data, &offset)) {
if (llvm::Error error = set.extract(dwarf_data, &offset)) {
Log *log = GetLog(DWARFLog::DebugInfo);
LLDB_LOG_ERROR(log, std::move(error),
"DWARFDebugAranges::extract failed to extract "
".debug_aranges set at offset {1:x}: {0}",
set_offset);
} else {
const uint32_t num_descriptors = set.NumDescriptors();
if (num_descriptors > 0) {
const dw_offset_t cu_offset = set.GetHeader().cu_offset;

for (uint32_t i = 0; i < num_descriptors; ++i) {
const DWARFDebugArangeSet::Descriptor &descriptor =
set.GetDescriptorRef(i);
m_aranges.Append(RangeToDIE::Entry(descriptor.address,
descriptor.length, cu_offset));
}
}
set.clear();
return;
}
const uint64_t cu_offset = set.getCompileUnitDIEOffset();
for (const auto &desc : set.descriptors()) {
if (desc.Length != 0)
m_aranges.Append(
RangeToDIE::Entry(desc.Address, desc.Length, cu_offset));
}
// Always use the previous DWARFDebugArangeSet's information to calculate
// the offset of the next DWARFDebugArangeSet in case we entouncter an
// error in the current DWARFDebugArangeSet and our offset position is
// still in the middle of the data. If we do this, we can parse all valid
// DWARFDebugArangeSet objects without returning invalid errors.
offset = set.GetNextOffset();
set.Clear();
}
}

Expand Down
Loading
Loading