aboutsummaryrefslogtreecommitdiff
path: root/lib/DebugInfo/CodeView/SymbolDumper.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2019-08-20 20:50:12 +0000
committerDimitry Andric <dim@FreeBSD.org>2019-08-20 20:50:12 +0000
commite6d1592492a3a379186bfb02bd0f4eda0669c0d5 (patch)
tree599ab169a01f1c86eda9adc774edaedde2f2db5b /lib/DebugInfo/CodeView/SymbolDumper.cpp
parent1a56a5ead7a2e84bee8240f5f6b033b5f1707154 (diff)
Diffstat (limited to 'lib/DebugInfo/CodeView/SymbolDumper.cpp')
-rw-r--r--lib/DebugInfo/CodeView/SymbolDumper.cpp42
1 files changed, 28 insertions, 14 deletions
diff --git a/lib/DebugInfo/CodeView/SymbolDumper.cpp b/lib/DebugInfo/CodeView/SymbolDumper.cpp
index 04e0bab745d3..27cb7e35234b 100644
--- a/lib/DebugInfo/CodeView/SymbolDumper.cpp
+++ b/lib/DebugInfo/CodeView/SymbolDumper.cpp
@@ -1,9 +1,8 @@
//===-- SymbolDumper.cpp - CodeView symbol info dumper ----------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -102,10 +101,10 @@ void CVSymbolDumperImpl::printTypeIndex(StringRef FieldName, TypeIndex TI) {
}
Error CVSymbolDumperImpl::visitSymbolBegin(CVSymbol &CVR) {
- W.startLine() << getSymbolKindName(CVR.Type);
+ W.startLine() << getSymbolKindName(CVR.kind());
W.getOStream() << " {\n";
W.indent();
- W.printEnum("Kind", unsigned(CVR.Type), getSymbolTypeNames());
+ W.printEnum("Kind", unsigned(CVR.kind()), getSymbolTypeNames());
return Error::success();
}
@@ -326,7 +325,7 @@ Error CVSymbolDumperImpl::visitKnownRecord(
Error CVSymbolDumperImpl::visitKnownRecord(
CVSymbol &CVR, DefRangeRegisterRelSym &DefRangeRegisterRel) {
W.printEnum("BaseRegister", uint16_t(DefRangeRegisterRel.Hdr.Register),
- getRegisterNames());
+ getRegisterNames(CompilationCPUType));
W.printBoolean("HasSpilledUDTMember",
DefRangeRegisterRel.hasSpilledUDTMember());
W.printNumber("OffsetInParent", DefRangeRegisterRel.offsetInParent());
@@ -340,7 +339,7 @@ Error CVSymbolDumperImpl::visitKnownRecord(
Error CVSymbolDumperImpl::visitKnownRecord(
CVSymbol &CVR, DefRangeRegisterSym &DefRangeRegister) {
W.printEnum("Register", uint16_t(DefRangeRegister.Hdr.Register),
- getRegisterNames());
+ getRegisterNames(CompilationCPUType));
W.printNumber("MayHaveNoName", DefRangeRegister.Hdr.MayHaveNoName);
printLocalVariableAddrRange(DefRangeRegister.Range,
DefRangeRegister.getRelocationOffset());
@@ -351,7 +350,7 @@ Error CVSymbolDumperImpl::visitKnownRecord(
Error CVSymbolDumperImpl::visitKnownRecord(
CVSymbol &CVR, DefRangeSubfieldRegisterSym &DefRangeSubfieldRegister) {
W.printEnum("Register", uint16_t(DefRangeSubfieldRegister.Hdr.Register),
- getRegisterNames());
+ getRegisterNames(CompilationCPUType));
W.printNumber("MayHaveNoName", DefRangeSubfieldRegister.Hdr.MayHaveNoName);
W.printNumber("OffsetInParent", DefRangeSubfieldRegister.Hdr.OffsetInParent);
printLocalVariableAddrRange(DefRangeSubfieldRegister.Range,
@@ -404,7 +403,8 @@ Error CVSymbolDumperImpl::visitKnownRecord(CVSymbol &CVR,
FrameCookie.getRelocationOffset(),
FrameCookie.CodeOffset, &LinkageName);
}
- W.printEnum("Register", uint16_t(FrameCookie.Register), getRegisterNames());
+ W.printEnum("Register", uint16_t(FrameCookie.Register),
+ getRegisterNames(CompilationCPUType));
W.printEnum("CookieKind", uint16_t(FrameCookie.CookieKind),
getFrameCookieKindNames());
W.printHex("Flags", FrameCookie.Flags);
@@ -425,10 +425,10 @@ Error CVSymbolDumperImpl::visitKnownRecord(CVSymbol &CVR,
getFrameProcSymFlagNames());
W.printEnum("LocalFramePtrReg",
uint16_t(FrameProc.getLocalFramePtrReg(CompilationCPUType)),
- getRegisterNames());
+ getRegisterNames(CompilationCPUType));
W.printEnum("ParamFramePtrReg",
uint16_t(FrameProc.getParamFramePtrReg(CompilationCPUType)),
- getRegisterNames());
+ getRegisterNames(CompilationCPUType));
return Error::success();
}
@@ -506,7 +506,8 @@ Error CVSymbolDumperImpl::visitKnownRecord(CVSymbol &CVR,
Error CVSymbolDumperImpl::visitKnownRecord(CVSymbol &CVR,
RegisterSym &Register) {
printTypeIndex("Type", Register.Index);
- W.printEnum("Seg", uint16_t(Register.Register), getRegisterNames());
+ W.printEnum("Seg", uint16_t(Register.Register),
+ getRegisterNames(CompilationCPUType));
W.printString("Name", Register.Name);
return Error::success();
}
@@ -600,7 +601,8 @@ Error CVSymbolDumperImpl::visitKnownRecord(CVSymbol &CVR,
RegRelativeSym &RegRel) {
W.printHex("Offset", RegRel.Offset);
printTypeIndex("Type", RegRel.Type);
- W.printEnum("Register", uint16_t(RegRel.Register), getRegisterNames());
+ W.printEnum("Register", uint16_t(RegRel.Register),
+ getRegisterNames(CompilationCPUType));
W.printString("VarName", RegRel.Name);
return Error::success();
}
@@ -631,6 +633,18 @@ Error CVSymbolDumperImpl::visitKnownRecord(CVSymbol &CVR,
return Error::success();
}
+Error CVSymbolDumperImpl::visitKnownRecord(CVSymbol &CVR,
+ AnnotationSym &Annot) {
+ W.printHex("Offset", Annot.CodeOffset);
+ W.printHex("Segment", Annot.Segment);
+
+ ListScope S(W, "Strings");
+ for (StringRef Str : Annot.Strings)
+ W.printString(Str);
+
+ return Error::success();
+}
+
Error CVSymbolDumperImpl::visitUnknownSymbol(CVSymbol &CVR) {
W.printNumber("Length", CVR.length());
return Error::success();