mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-20 10:24:12 +00:00
DWARF: Print line tables per compile unit, so they get the right address size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139808 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -8,9 +8,11 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "DWARFContext.h"
|
||||
#include "llvm/Support/Dwarf.h"
|
||||
#include "llvm/Support/Format.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
using namespace llvm;
|
||||
using namespace dwarf;
|
||||
|
||||
void DWARFContext::dump(raw_ostream &OS) {
|
||||
OS << ".debug_abbrev contents:\n";
|
||||
@ -28,9 +30,18 @@ void DWARFContext::dump(raw_ostream &OS) {
|
||||
set.dump(OS);
|
||||
|
||||
OS << "\n.debug_lines contents:\n";
|
||||
// FIXME: must be done per CU.
|
||||
DataExtractor lineData(getLineSection(), isLittleEndian(), /*FIXME*/8);
|
||||
DWARFDebugLine::dump(lineData, OS);
|
||||
for (unsigned i = 0, e = getNumCompileUnits(); i != e; ++i) {
|
||||
DWARFCompileUnit *cu = getCompileUnitAtIndex(i);
|
||||
unsigned stmtOffset =
|
||||
cu->getCompileUnitDIE()->getAttributeValueAsUnsigned(cu, DW_AT_stmt_list,
|
||||
-1U);
|
||||
if (stmtOffset != -1U) {
|
||||
DataExtractor lineData(getLineSection(), isLittleEndian(),
|
||||
cu->getAddressByteSize());
|
||||
DWARFDebugLine::DumpingState state(OS);
|
||||
DWARFDebugLine::parseStatementTable(lineData, &stmtOffset, state);
|
||||
}
|
||||
}
|
||||
|
||||
OS << "\n.debug_str contents:\n";
|
||||
DataExtractor strData(getStringSection(), isLittleEndian(), 0);
|
||||
|
Reference in New Issue
Block a user