diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2011-09-15 02:12:05 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2011-09-15 02:12:05 +0000 |
commit | b848e976110a2c4f0a6a9e252115ba291c844fbe (patch) | |
tree | 4aa4b7a08e4914826f59099506bef98803aea1ed /lib/DebugInfo/DWARFContext.cpp | |
parent | c82751dd6761e3db62668b6b1cfddd4f659855b6 (diff) | |
download | external_llvm-b848e976110a2c4f0a6a9e252115ba291c844fbe.zip external_llvm-b848e976110a2c4f0a6a9e252115ba291c844fbe.tar.gz external_llvm-b848e976110a2c4f0a6a9e252115ba291c844fbe.tar.bz2 |
DWARF: Add basic support for line tables.
The llvm-dwarfdump output isn't very verbose yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139771 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/DebugInfo/DWARFContext.cpp')
-rw-r--r-- | lib/DebugInfo/DWARFContext.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/DebugInfo/DWARFContext.cpp b/lib/DebugInfo/DWARFContext.cpp index 3359ae3..68f58d9 100644 --- a/lib/DebugInfo/DWARFContext.cpp +++ b/lib/DebugInfo/DWARFContext.cpp @@ -25,6 +25,10 @@ void DWARFContext::dump(raw_ostream &OS) { DWARFDebugArangeSet set; while (set.extract(arangesData, &offset)) set.dump(OS); + + OS << "\n.debug_lines contents:\n"; + DataExtractor lineData(getLineSection(), isLittleEndian(), 8); + DWARFDebugLine::dump(lineData, OS); } const DWARFDebugAbbrev *DWARFContext::getDebugAbbrev() { @@ -51,6 +55,17 @@ const DWARFDebugAranges *DWARFContext::getDebugAranges() { return Aranges.get(); } +const DWARFDebugLine *DWARFContext::getDebugLine() { + if (Line) + return Line.get(); + + DataExtractor lineData(getLineSection(), isLittleEndian(), 0); + + Line.reset(new DWARFDebugLine()); + Line->parse(lineData); + return Line.get(); +} + void DWARFContext::parseCompileUnits() { uint32_t offset = 0; const DataExtractor &debug_info_data = DataExtractor(getInfoSection(), |