[llvm] r259805 - Add support for S_DEFRANGE and S_DEFRANGE_SUBFIELD
David Majnemer via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 4 09:37:30 PST 2016
Author: majnemer
Date: Thu Feb 4 11:37:30 2016
New Revision: 259805
URL: http://llvm.org/viewvc/llvm-project?rev=259805&view=rev
Log:
Add support for S_DEFRANGE and S_DEFRANGE_SUBFIELD
Modified:
llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolRecord.h
llvm/trunk/tools/llvm-readobj/COFFDumper.cpp
Modified: llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolRecord.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolRecord.h?rev=259805&r1=259804&r2=259805&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolRecord.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolRecord.h Thu Feb 4 11:37:30 2016
@@ -123,6 +123,21 @@ struct LocalVariableAddrGap {
ulittle16_t Range;
};
+// S_DEFRANGE
+struct DefRangeSym {
+ ulittle32_t Program;
+ LocalVariableAddrRange Range;
+ // LocalVariableAddrGap Gaps[];
+};
+
+// S_DEFRANGE_SUBFIELD
+struct DefRangeSubfieldSym {
+ ulittle32_t Program;
+ ulittle16_t OffsetInParent;
+ LocalVariableAddrRange Range;
+ // LocalVariableAddrGap Gaps[];
+};
+
// S_DEFRANGE_REGISTER
struct DefRangeRegisterSym {
ulittle16_t Register;
Modified: llvm/trunk/tools/llvm-readobj/COFFDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/COFFDumper.cpp?rev=259805&r1=259804&r2=259805&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-readobj/COFFDumper.cpp (original)
+++ llvm/trunk/tools/llvm-readobj/COFFDumper.cpp Thu Feb 4 11:37:30 2016
@@ -92,7 +92,7 @@ private:
void printLocalVariableAddrRange(const LocalVariableAddrRange &Range,
const coff_section *Sec,
StringRef SectionContents);
- void printLocalVariableAddrGap(StringRef SymData);
+ void printLocalVariableAddrGap(StringRef &SymData);
void printCodeViewSymbolsSubsection(StringRef Subsection,
const SectionRef &Section,
@@ -1503,6 +1503,31 @@ void COFFDumper::printCodeViewSymbolsSub
break;
}
+ case S_DEFRANGE: {
+ DictScope S(W, "DefRange");
+ const DefRangeSym *DefRange;
+ error(consumeObject(SymData, DefRange));
+ W.printString(
+ "Program",
+ CVStringTable.drop_front(DefRange->Program).split('\0').first);
+ printLocalVariableAddrRange(DefRange->Range, Sec, SectionContents);
+ printLocalVariableAddrGap(SymData);
+ break;
+ }
+ case S_DEFRANGE_SUBFIELD: {
+ DictScope S(W, "DefRangeSubfield");
+ const DefRangeSubfieldSym *DefRangeSubfield;
+ error(consumeObject(SymData, DefRangeSubfield));
+ W.printString("Program",
+ CVStringTable.drop_front(DefRangeSubfield->Program)
+ .split('\0')
+ .first);
+ W.printNumber("OffsetInParent", DefRangeSubfield->OffsetInParent);
+ printLocalVariableAddrRange(DefRangeSubfield->Range, Sec,
+ SectionContents);
+ printLocalVariableAddrGap(SymData);
+ break;
+ }
case S_DEFRANGE_REGISTER: {
DictScope S(W, "DefRangeRegister");
const DefRangeRegisterSym *DefRangeRegister;
@@ -1882,7 +1907,7 @@ void COFFDumper::printLocalVariableAddrR
W.printNumber("Range", Range.Range);
}
-void COFFDumper::printLocalVariableAddrGap(StringRef SymData) {
+void COFFDumper::printLocalVariableAddrGap(StringRef &SymData) {
while (!SymData.empty()) {
const LocalVariableAddrGap *Gap;
error(consumeObject(SymData, Gap));
More information about the llvm-commits
mailing list