mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-02 22:23:10 +00:00
DWARF: Remove accessors that parse the whole line table section in one go, this can't possibly work.
The address size is specified by the compile unit associated with a line table, there is no global address size. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139835 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -77,15 +77,25 @@ const DWARFDebugAranges *DWARFContext::getDebugAranges() {
|
||||
return Aranges.get();
|
||||
}
|
||||
|
||||
const DWARFDebugLine *DWARFContext::getDebugLine() {
|
||||
if (Line)
|
||||
return Line.get();
|
||||
const DWARFDebugLine::LineTable *
|
||||
DWARFContext::getLineTableForCompileUnit(DWARFCompileUnit *cu) {
|
||||
if (!Line)
|
||||
Line.reset(new DWARFDebugLine());
|
||||
|
||||
DataExtractor lineData(getLineSection(), isLittleEndian(), 0);
|
||||
unsigned stmtOffset =
|
||||
cu->getCompileUnitDIE()->getAttributeValueAsUnsigned(cu, DW_AT_stmt_list,
|
||||
-1U);
|
||||
if (stmtOffset == -1U)
|
||||
return 0; // No line table for this compile unit.
|
||||
|
||||
Line.reset(new DWARFDebugLine());
|
||||
Line->parse(lineData);
|
||||
return Line.get();
|
||||
// See if the line table is cached.
|
||||
if (const DWARFDebugLine::LineTable *lt = Line->getLineTable(stmtOffset))
|
||||
return lt;
|
||||
|
||||
// We have to parse it first.
|
||||
DataExtractor lineData(getLineSection(), isLittleEndian(),
|
||||
cu->getAddressByteSize());
|
||||
return Line->getOrParseLineTable(lineData, stmtOffset);
|
||||
}
|
||||
|
||||
void DWARFContext::parseCompileUnits() {
|
||||
|
||||
Reference in New Issue
Block a user