You've already forked linux-packaging-mono
acceptance-tests
data
debian
docs
external
Newtonsoft.Json
api-doc-tools
api-snapshot
aspnetwebstack
binary-reference-assemblies
bockbuild
boringssl
cecil
cecil-legacy
corefx
corert
helix-binaries
ikdasm
ikvm
illinker-test-assets
linker
llvm
bindings
cmake
docs
examples
include
lib
Analysis
AsmParser
BinaryFormat
Bitcode
CodeGen
DebugInfo
CodeView
AppendingTypeTableBuilder.cpp
CMakeLists.txt
CVSymbolVisitor.cpp
CVTypeVisitor.cpp
CodeViewError.cpp
CodeViewRecordIO.cpp
ContinuationRecordBuilder.cpp
DebugChecksumsSubsection.cpp
DebugCrossExSubsection.cpp
DebugCrossImpSubsection.cpp
DebugFrameDataSubsection.cpp
DebugInlineeLinesSubsection.cpp
DebugLinesSubsection.cpp
DebugStringTableSubsection.cpp
DebugSubsection.cpp
DebugSubsectionRecord.cpp
DebugSubsectionVisitor.cpp
DebugSymbolRVASubsection.cpp
DebugSymbolsSubsection.cpp
EnumTables.cpp
Formatters.cpp
GlobalTypeTableBuilder.cpp
LLVMBuild.txt
LazyRandomTypeCollection.cpp
Line.cpp
MergingTypeTableBuilder.cpp
RecordName.cpp
RecordSerialization.cpp
SimpleTypeSerializer.cpp
StringsAndChecksums.cpp
SymbolDumper.cpp
SymbolRecordMapping.cpp
SymbolSerializer.cpp
TypeDumpVisitor.cpp
TypeHashing.cpp
TypeIndex.cpp
TypeIndexDiscovery.cpp
TypeRecordMapping.cpp
TypeStreamMerger.cpp
TypeTableCollection.cpp
DWARF
MSF
PDB
Symbolize
CMakeLists.txt
LLVMBuild.txt
Demangle
ExecutionEngine
FuzzMutate
Fuzzer
IR
IRReader
LTO
LineEditor
Linker
MC
Object
ObjectYAML
Option
Passes
ProfileData
Support
TableGen
Target
Testing
ToolDrivers
Transforms
WindowsManifest
XRay
CMakeLists.txt
LLVMBuild.txt
projects
resources
runtimes
scripts
test
tools
unittests
utils
.arcconfig
.clang-format
.clang-tidy
.gitattributes
.gitignore
CMakeLists.txt
CODE_OWNERS.TXT
CREDITS.TXT
LICENSE.TXT
LLVMBuild.txt
README.txt
RELEASE_TESTERS.TXT
configure
llvm.spec.in
nuget-buildtasks
nunit-lite
roslyn-binaries
rx
xunit-binaries
how-to-bump-roslyn-binaries.md
ikvm-native
libgc
llvm
m4
man
mcs
mk
mono
msvc
po
runtime
samples
scripts
support
tools
COPYING.LIB
LICENSE
Makefile.am
Makefile.in
NEWS
README.md
acinclude.m4
aclocal.m4
autogen.sh
code_of_conduct.md
compile
config.guess
config.h.in
config.rpath
config.sub
configure.REMOVED.git-id
configure.ac.REMOVED.git-id
depcomp
install-sh
ltmain.sh.REMOVED.git-id
missing
mkinstalldirs
mono-uninstalled.pc.in
test-driver
winconfig.h
61 lines
1.8 KiB
C++
61 lines
1.8 KiB
C++
![]() |
//===- SymbolSerializer.cpp -----------------------------------------------===//
|
||
|
//
|
||
|
// The LLVM Compiler Infrastructure
|
||
|
//
|
||
|
// This file is distributed under the University of Illinois Open Source
|
||
|
// License. See LICENSE.TXT for details.
|
||
|
//
|
||
|
//===----------------------------------------------------------------------===//
|
||
|
|
||
|
#include "llvm/DebugInfo/CodeView/SymbolSerializer.h"
|
||
|
#include "llvm/ADT/ArrayRef.h"
|
||
|
#include "llvm/DebugInfo/CodeView/SymbolRecord.h"
|
||
|
#include "llvm/Support/Endian.h"
|
||
|
#include "llvm/Support/Error.h"
|
||
|
#include <cassert>
|
||
|
#include <cstdint>
|
||
|
#include <cstring>
|
||
|
|
||
|
using namespace llvm;
|
||
|
using namespace llvm::codeview;
|
||
|
|
||
|
SymbolSerializer::SymbolSerializer(BumpPtrAllocator &Allocator,
|
||
|
CodeViewContainer Container)
|
||
|
: Storage(Allocator), Stream(RecordBuffer, support::little), Writer(Stream),
|
||
|
Mapping(Writer, Container) {}
|
||
|
|
||
|
Error SymbolSerializer::visitSymbolBegin(CVSymbol &Record) {
|
||
|
assert(!CurrentSymbol.hasValue() && "Already in a symbol mapping!");
|
||
|
|
||
|
Writer.setOffset(0);
|
||
|
|
||
|
if (auto EC = writeRecordPrefix(Record.kind()))
|
||
|
return EC;
|
||
|
|
||
|
CurrentSymbol = Record.kind();
|
||
|
if (auto EC = Mapping.visitSymbolBegin(Record))
|
||
|
return EC;
|
||
|
|
||
|
return Error::success();
|
||
|
}
|
||
|
|
||
|
Error SymbolSerializer::visitSymbolEnd(CVSymbol &Record) {
|
||
|
assert(CurrentSymbol.hasValue() && "Not in a symbol mapping!");
|
||
|
|
||
|
if (auto EC = Mapping.visitSymbolEnd(Record))
|
||
|
return EC;
|
||
|
|
||
|
uint32_t RecordEnd = Writer.getOffset();
|
||
|
uint16_t Length = RecordEnd - 2;
|
||
|
Writer.setOffset(0);
|
||
|
if (auto EC = Writer.writeInteger(Length))
|
||
|
return EC;
|
||
|
|
||
|
uint8_t *StableStorage = Storage.Allocate<uint8_t>(RecordEnd);
|
||
|
::memcpy(StableStorage, &RecordBuffer[0], RecordEnd);
|
||
|
Record.RecordData = ArrayRef<uint8_t>(StableStorage, RecordEnd);
|
||
|
CurrentSymbol.reset();
|
||
|
|
||
|
return Error::success();
|
||
|
}
|