Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,8 @@ void DWARFDebugInfoEntry::BuildFunctionAddressRangeTable(
DWARFUnit *cu, DWARFDebugAranges *debug_aranges) const {
Log *log = GetLog(DWARFLog::DebugInfo);
if (m_tag) {
if (m_tag == DW_TAG_subprogram) {
if (m_tag == DW_TAG_subprogram &&
!GetAttributeValueAsOptionalUnsigned(cu, DW_AT_declaration)) {
if (llvm::Expected<llvm::DWARFAddressRangesVector> ranges =
GetAttributeAddressRanges(cu, /*check_hi_lo_pc=*/true)) {
for (const auto &r : *ranges)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Test that we don't try to determine address range
# information of forward declaration DIEs which have
# no DW_AT_low_pc/DW_AT_high_pc in DWARF.

# RUN: split-file %s %t
# RUN: %clang_host -c -g -gdwarf %t/main.cpp -o %t.o
# RUN: %lldb -x -b -s %t/commands.input %t.o -o exit 2>&1 \
# RUN: | FileCheck %s

#--- main.cpp

struct Foo {
void func() {}
} foo;

void baz() {
foo.func();
}

#--- commands.input

log enable -v dwarf info
target modules lookup -n func

# CHECK-NOT: DIE has no address range information
Loading