Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
Show First 20 Lines • Show All 1,278 Lines • ▼ Show 20 Lines | case DW_TAG_lexical_block: { | ||||
BlockSP block_sp(new Block(die.GetID())); | BlockSP block_sp(new Block(die.GetID())); | ||||
parent_block->AddChild(block_sp); | parent_block->AddChild(block_sp); | ||||
block = block_sp.get(); | block = block_sp.get(); | ||||
} | } | ||||
DWARFRangeList ranges; | DWARFRangeList ranges; | ||||
const char *name = nullptr; | const char *name = nullptr; | ||||
const char *mangled_name = nullptr; | const char *mangled_name = nullptr; | ||||
int decl_file = 0; | std::optional<int> decl_file; | ||||
int decl_line = 0; | std::optional<int> decl_line; | ||||
int decl_column = 0; | std::optional<int> decl_column; | ||||
int call_file = 0; | std::optional<int> call_file; | ||||
int call_line = 0; | std::optional<int> call_line; | ||||
int call_column = 0; | std::optional<int> call_column; | ||||
if (die.GetDIENamesAndRanges(name, mangled_name, ranges, decl_file, | if (die.GetDIENamesAndRanges(name, mangled_name, ranges, decl_file, | ||||
decl_line, decl_column, call_file, call_line, | decl_line, decl_column, call_file, call_line, | ||||
call_column, nullptr)) { | call_column, nullptr)) { | ||||
if (tag == DW_TAG_subprogram) { | if (tag == DW_TAG_subprogram) { | ||||
assert(subprogram_low_pc == LLDB_INVALID_ADDRESS); | assert(subprogram_low_pc == LLDB_INVALID_ADDRESS); | ||||
subprogram_low_pc = ranges.GetMinRangeBase(0); | subprogram_low_pc = ranges.GetMinRangeBase(0); | ||||
} else if (tag == DW_TAG_inlined_subroutine) { | } else if (tag == DW_TAG_inlined_subroutine) { | ||||
// We get called here for inlined subroutines in two ways. The first | // We get called here for inlined subroutines in two ways. The first | ||||
Show All 26 Lines | case DW_TAG_lexical_block: { | ||||
subprogram_low_pc); | subprogram_low_pc); | ||||
} | } | ||||
} | } | ||||
block->FinalizeRanges(); | block->FinalizeRanges(); | ||||
if (tag != DW_TAG_subprogram && | if (tag != DW_TAG_subprogram && | ||||
(name != nullptr || mangled_name != nullptr)) { | (name != nullptr || mangled_name != nullptr)) { | ||||
std::unique_ptr<Declaration> decl_up; | std::unique_ptr<Declaration> decl_up; | ||||
if (decl_file != 0 || decl_line != 0 || decl_column != 0) | if (decl_file || decl_line || decl_column) | ||||
decl_up = std::make_unique<Declaration>( | decl_up = std::make_unique<Declaration>( | ||||
comp_unit.GetSupportFiles().GetFileSpecAtIndex(decl_file), | comp_unit.GetSupportFiles().GetFileSpecAtIndex( | ||||
decl_line, decl_column); | decl_file ? *decl_file : 0), | ||||
decl_line ? *decl_line : 0, decl_column ? *decl_column : 0); | |||||
std::unique_ptr<Declaration> call_up; | std::unique_ptr<Declaration> call_up; | ||||
if (call_file != 0 || call_line != 0 || call_column != 0) | if (call_file || call_line || call_column) | ||||
call_up = std::make_unique<Declaration>( | call_up = std::make_unique<Declaration>( | ||||
comp_unit.GetSupportFiles().GetFileSpecAtIndex(call_file), | comp_unit.GetSupportFiles().GetFileSpecAtIndex( | ||||
call_line, call_column); | call_file ? *call_file : 0), | ||||
call_line ? *call_line : 0, call_column ? *call_column : 0); | |||||
block->SetInlinedFunctionInfo(name, mangled_name, decl_up.get(), | block->SetInlinedFunctionInfo(name, mangled_name, decl_up.get(), | ||||
call_up.get()); | call_up.get()); | ||||
} | } | ||||
++blocks_added; | ++blocks_added; | ||||
if (die.HasChildren()) { | if (die.HasChildren()) { | ||||
▲ Show 20 Lines • Show All 2,903 Lines • Show Last 20 Lines |