summaryrefslogtreecommitdiff
path: root/lib/DebugInfo
diff options
context:
space:
mode:
authorDiego Novillo <dnovillo@google.com>2014-02-14 19:27:53 +0000
committerDiego Novillo <dnovillo@google.com>2014-02-14 19:27:53 +0000
commit837c54fa7bc1873fc739cbc163b8b5f207bc996c (patch)
tree1cff438c31507646df2508056f43170bc0febfc2 /lib/DebugInfo
parentfba2a769a1f9a05437b1d98c99bb827fb7b44482 (diff)
downloadllvm-837c54fa7bc1873fc739cbc163b8b5f207bc996c.tar.gz
llvm-837c54fa7bc1873fc739cbc163b8b5f207bc996c.tar.bz2
llvm-837c54fa7bc1873fc739cbc163b8b5f207bc996c.tar.xz
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
Diffstat (limited to 'lib/DebugInfo')
-rw-r--r--lib/DebugInfo/DWARFDebugLine.cpp12
-rw-r--r--lib/DebugInfo/DWARFDebugLine.h3
2 files changed, 12 insertions, 3 deletions
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<Row>::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
diff --git a/lib/DebugInfo/DWARFDebugLine.h b/lib/DebugInfo/DWARFDebugLine.h
index 2990756bd7..9e93cc86dd 100644
--- a/lib/DebugInfo/DWARFDebugLine.h
+++ b/lib/DebugInfo/DWARFDebugLine.h
@@ -112,6 +112,9 @@ public:
// An unsigned integer whose value encodes the applicable instruction set
// architecture for the current instruction.
uint8_t Isa;
+ // An unsigned integer representing the DWARF path discriminator value
+ // for this location.
+ uint32_t Discriminator;
// A boolean indicating that the current instruction is the beginning of a
// statement.
uint8_t IsStmt:1,