llvm / llvm/llvm-project

[DWARF] DWARFDie::getDeclFile() doesn't work with DW_FORM_implicit_const

Open
#179,110 1 comment 0 reactions 0 assignees View on GitHub
debuginfo
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

DWARFDie::getDeclFile() gets an invalid DWARFFormValue without a DWARFUnit* as DWARFAbbreviationDeclaration::getAttributeValueFromOffset() doesn't pass it in DWARFFormValue::createFromSValue().
Can be checked with DWARFDie::dump(). It works correctly as it gets a referenced value, not a lazy copy.
getDeclFile in DWARFDieTest.cpp has a value stored in DW_FORM_data1, so it passes.

Contributor guide

Open the contributing guide

Research direction

Start with DWARFAbbreviationDeclaration::getAttributeValueFromOffset() and DWARFFormValue::createFromSValue(), then inspect DWARFDie::getDeclFile() and DWARFDie::dump(). Review the getDeclFile test in DWARFDieTest.cpp, which currently uses DW_FORM_data1, and add coverage for DW_FORM_implicit_const. Done means getDeclFile() produces a valid value for that form and DWARFDie::dump() handles it correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.