From 837c54fa7bc1873fc739cbc163b8b5f207bc996c Mon Sep 17 00:00:00 2001 From: Diego Novillo Date: Fri, 14 Feb 2014 19:27:53 +0000 Subject: Support DWARF discriminators in object streamer. Summary: This adds support for emitting DWARF path discriminator values in the object streamer. It also changes the DWARF dumper to show discriminator values in the line table output. Reviewers: echristo CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2794 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201427 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/DebugInfo/DWARFDebugLine.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'lib/DebugInfo/DWARFDebugLine.cpp') diff --git a/lib/DebugInfo/DWARFDebugLine.cpp b/lib/DebugInfo/DWARFDebugLine.cpp index 13d09dd298..b2c8502d57 100644 --- a/lib/DebugInfo/DWARFDebugLine.cpp +++ b/lib/DebugInfo/DWARFDebugLine.cpp @@ -62,6 +62,7 @@ void DWARFDebugLine::Row::reset(bool default_is_stmt) { Column = 0; File = 1; Isa = 0; + Discriminator = 0; IsStmt = default_is_stmt; BasicBlock = false; EndSequence = false; @@ -71,7 +72,7 @@ void DWARFDebugLine::Row::reset(bool default_is_stmt) { void DWARFDebugLine::Row::dump(raw_ostream &OS) const { OS << format("0x%16.16" PRIx64 " %6u %6u", Address, Line, Column) - << format(" %6u %3u ", File, Isa) + << format(" %6u %3u %13u ", File, Isa, Discriminator) << (IsStmt ? " is_stmt" : "") << (BasicBlock ? " basic_block" : "") << (PrologueEnd ? " prologue_end" : "") @@ -85,8 +86,9 @@ void DWARFDebugLine::LineTable::dump(raw_ostream &OS) const { OS << '\n'; if (!Rows.empty()) { - OS << "Address Line Column File ISA Flags\n" - << "------------------ ------ ------ ------ --- -------------\n"; + OS << "Address Line Column File ISA Discriminator Flags\n" + << "------------------ ------ ------ ------ --- ------------- " + "-------------\n"; for (std::vector::const_iterator pos = Rows.begin(), end = Rows.end(); pos != end; ++pos) pos->dump(OS); @@ -311,6 +313,10 @@ DWARFDebugLine::parseStatementTable(DataExtractor debug_line_data, } break; + case DW_LNE_set_discriminator: + state.Discriminator = debug_line_data.getULEB128(offset_ptr); + break; + default: // Length doesn't include the zero opcode byte or the length itself, but // it does include the sub_opcode, so we have to adjust for that below -- cgit v1.2.3