Skip to content

[lldb/DWARF] Remove "range lower than function low_pc" check #132395

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 23, 2025
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
18 changes: 4 additions & 14 deletions lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1323,7 +1323,7 @@ bool SymbolFileDWARF::ParseDebugMacros(CompileUnit &comp_unit) {

size_t SymbolFileDWARF::ParseBlocksRecursive(CompileUnit &comp_unit,
Block *parent_block, DWARFDIE die,
addr_t subprogram_low_pc) {
addr_t function_file_addr) {
size_t blocks_added = 0;
for (; die; die = die.GetSibling()) {
dw_tag_t tag = die.Tag();
Expand All @@ -1346,19 +1346,9 @@ size_t SymbolFileDWARF::ParseBlocksRecursive(CompileUnit &comp_unit,
decl_line, decl_column, call_file, call_line,
call_column, nullptr)) {
for (const llvm::DWARFAddressRange &range : ranges) {
if (!range.valid())
continue;
if (range.LowPC >= subprogram_low_pc)
block->AddRange(Block::Range(range.LowPC - subprogram_low_pc,
if (range.valid() && range.LowPC >= m_first_code_address)
block->AddRange(Block::Range(range.LowPC - function_file_addr,
range.HighPC - range.LowPC));
else {
GetObjectFile()->GetModule()->ReportError(
"{0:x8}: adding range [{1:x16}-{2:x16}) which has a base "
"that is less than the function's low PC {3:x16}. Please file "
"a bug and attach the file at the "
"start of this error message",
block->GetID(), range.LowPC, range.HighPC, subprogram_low_pc);
}
}
block->FinalizeRanges();

Expand Down Expand Up @@ -1386,7 +1376,7 @@ size_t SymbolFileDWARF::ParseBlocksRecursive(CompileUnit &comp_unit,

if (die.HasChildren()) {
blocks_added += ParseBlocksRecursive(
comp_unit, block, die.GetFirstChild(), subprogram_low_pc);
comp_unit, block, die.GetFirstChild(), function_file_addr);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ class SymbolFileDWARF : public SymbolFileCommon {
Function *ParseFunction(CompileUnit &comp_unit, const DWARFDIE &die);

size_t ParseBlocksRecursive(CompileUnit &comp_unit, Block *parent_block,
DWARFDIE die, lldb::addr_t subprogram_low_pc);
DWARFDIE die, lldb::addr_t function_file_addr);

size_t ParseTypes(const SymbolContext &sc, const DWARFDIE &die,
bool parse_siblings, bool parse_children);
Expand Down
317 changes: 0 additions & 317 deletions lldb/test/Shell/SymbolFile/DWARF/range-lower-then-low-pc.s

This file was deleted.

Loading
Loading