diff options
author | Zachary Turner <zturner@google.com> | 2017-06-14 05:31:00 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2017-06-14 05:31:00 +0000 |
commit | a3da4467fa8ed514130736c6c15f01422159d00d (patch) | |
tree | 12356bbf4e58c9d059fb2899b240256e75d75a81 /llvm/tools/llvm-pdbutil/YAMLOutputStyle.cpp | |
parent | f4ea23d3a58ee23d13b719e525e0575a29e510da (diff) | |
download | bcm5719-llvm-a3da4467fa8ed514130736c6c15f01422159d00d.tar.gz bcm5719-llvm-a3da4467fa8ed514130736c6c15f01422159d00d.zip |
[codeview] Make obj2yaml/yaml2obj support .debug$S/T sections.
This allows us to use yaml2obj and obj2yaml to round-trip CodeView
symbol and type information without having to manually specify the bytes
of the section. This makes for much easier to maintain tests. See the
tests under lld/COFF in this patch for example. Before they just said
SectionData: <blob> whereas now we can use meaningful record
descriptions. Note that it still supports the SectionData yaml field,
which could be useful for initializing a section to invalid bytes for
testing, for example.
Differential Revision: https://reviews.llvm.org/D34127
llvm-svn: 305366
Diffstat (limited to 'llvm/tools/llvm-pdbutil/YAMLOutputStyle.cpp')
-rw-r--r-- | llvm/tools/llvm-pdbutil/YAMLOutputStyle.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/tools/llvm-pdbutil/YAMLOutputStyle.cpp b/llvm/tools/llvm-pdbutil/YAMLOutputStyle.cpp index 4ab7cd39b29..8f7aba6d30c 100644 --- a/llvm/tools/llvm-pdbutil/YAMLOutputStyle.cpp +++ b/llvm/tools/llvm-pdbutil/YAMLOutputStyle.cpp @@ -18,6 +18,7 @@ #include "llvm/DebugInfo/CodeView/DebugSubsection.h" #include "llvm/DebugInfo/CodeView/DebugUnknownSubsection.h" #include "llvm/DebugInfo/CodeView/Line.h" +#include "llvm/DebugInfo/CodeView/StringsAndChecksums.h" #include "llvm/DebugInfo/MSF/MappedBlockStream.h" #include "llvm/DebugInfo/PDB/Native/DbiStream.h" #include "llvm/DebugInfo/PDB/Native/InfoStream.h" @@ -236,14 +237,16 @@ Error YAMLOutputStyle::dumpDbiStream() { if (!ExpectedChecksums) return ExpectedChecksums.takeError(); + StringsAndChecksumsRef SC(ExpectedST->getStringTable(), + *ExpectedChecksums); + for (const auto &SS : ModS.subsections()) { opts::ModuleSubsection OptionKind = convertSubsectionKind(SS.kind()); if (!opts::checkModuleSubsection(OptionKind)) continue; auto Converted = - CodeViewYAML::YAMLDebugSubsection::fromCodeViewSubection( - ExpectedST->getStringTable(), *ExpectedChecksums, SS); + CodeViewYAML::YAMLDebugSubsection::fromCodeViewSubection(SC, SS); if (!Converted) return Converted.takeError(); DMI.Subsections.push_back(*Converted); |