2015-02-11 05:17:52 +08:00
|
|
|
macro(add_pdb_impl_folder group)
|
|
|
|
list(APPEND PDB_IMPL_SOURCES ${ARGN})
|
|
|
|
source_group(${group} FILES ${ARGN})
|
|
|
|
endmacro()
|
|
|
|
|
|
|
|
if(HAVE_DIA_SDK)
|
|
|
|
include_directories(${MSVC_DIA_SDK_DIR}/include)
|
|
|
|
set(LIBPDB_LINK_FOLDERS "${MSVC_DIA_SDK_DIR}\\lib")
|
|
|
|
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|
|
|
set(LIBPDB_LINK_FOLDERS "${LIBPDB_LINK_FOLDERS}\\amd64")
|
|
|
|
endif()
|
2015-06-20 05:50:27 +08:00
|
|
|
file(TO_CMAKE_PATH "${LIBPDB_LINK_FOLDERS}\\diaguids.lib" LIBPDB_ADDITIONAL_LIBRARIES)
|
2015-02-11 05:17:52 +08:00
|
|
|
|
|
|
|
add_pdb_impl_folder(DIA
|
|
|
|
DIA/DIADataStream.cpp
|
|
|
|
DIA/DIAEnumDebugStreams.cpp
|
|
|
|
DIA/DIAEnumLineNumbers.cpp
|
|
|
|
DIA/DIAEnumSourceFiles.cpp
|
|
|
|
DIA/DIAEnumSymbols.cpp
|
2016-05-07 04:51:57 +08:00
|
|
|
DIA/DIAError.cpp
|
2015-02-11 05:17:52 +08:00
|
|
|
DIA/DIALineNumber.cpp
|
|
|
|
DIA/DIARawSymbol.cpp
|
|
|
|
DIA/DIASession.cpp
|
|
|
|
DIA/DIASourceFile.cpp
|
|
|
|
)
|
|
|
|
|
2015-02-11 11:28:02 +08:00
|
|
|
set(LIBPDB_ADDITIONAL_HEADER_DIRS "${LLVM_MAIN_INCLUDE_DIR}/llvm/DebugInfo/PDB/DIA")
|
2016-04-22 20:04:42 +08:00
|
|
|
endif()
|
2016-04-22 04:58:35 +08:00
|
|
|
|
2016-04-26 01:38:08 +08:00
|
|
|
add_pdb_impl_folder(Raw
|
2016-04-30 01:28:47 +08:00
|
|
|
Raw/DbiStream.cpp
|
2016-06-02 13:07:49 +08:00
|
|
|
Raw/EnumTables.cpp
|
[pdb] Use MappedBlockStream to parse the PDB directory.
In order to efficiently write PDBs, we need to be able to make a
StreamWriter class similar to a StreamReader, which can transparently deal
with writing to discontiguous streams, and we need to use this for all
writing, similar to how we use StreamReader for all reading.
Most discontiguous streams are the typical numbered streams that appear in
a PDB file and are described by the directory, but the exception to this,
that until now has been parsed by hand, is the directory itself.
MappedBlockStream works by querying the directory to find out which blocks
a stream occupies and various other things, so naturally the same logic
could not possibly work to describe the blocks that the directory itself
resided on.
To solve this, I've introduced an abstraction IPDBStreamData, which allows
the client to query for the list of blocks occupied by the stream, as well
as the stream length. I provide two implementations of this: one which
queries the directory (for indexed streams), and one which queries the
super block (for the directory stream).
This has the side benefit of vastly simplifying the code to parse the
directory. Whereas before a mini state machine was rolled by hand, now we
simply use FixedStreamArray to read out the stream sizes, then build a
vector of FixedStreamArrays for the stream map, all in just a few lines of
code.
Reviewed By: ruiu
Differential Revision: http://reviews.llvm.org/D21046
llvm-svn: 271982
2016-06-07 13:28:55 +08:00
|
|
|
Raw/IndexedStreamData.cpp
|
2016-04-30 01:28:47 +08:00
|
|
|
Raw/InfoStream.cpp
|
2016-05-10 01:45:21 +08:00
|
|
|
Raw/MappedBlockStream.cpp
|
|
|
|
Raw/ModInfo.cpp
|
|
|
|
Raw/ModStream.cpp
|
2016-05-03 02:09:14 +08:00
|
|
|
Raw/NameHashTable.cpp
|
2016-04-30 01:28:47 +08:00
|
|
|
Raw/NameMap.cpp
|
2016-05-10 01:45:21 +08:00
|
|
|
Raw/PDBFile.cpp
|
2016-05-14 05:21:53 +08:00
|
|
|
Raw/PublicsStream.cpp
|
2016-05-07 04:51:57 +08:00
|
|
|
Raw/RawError.cpp
|
2016-04-30 01:22:58 +08:00
|
|
|
Raw/RawSession.cpp
|
2016-05-21 03:55:17 +08:00
|
|
|
Raw/SymbolStream.cpp
|
2016-05-03 08:28:21 +08:00
|
|
|
Raw/TpiStream.cpp)
|
2016-04-26 01:38:08 +08:00
|
|
|
|
2016-05-27 09:54:44 +08:00
|
|
|
list(APPEND LIBPDB_ADDITIONAL_HEADER_DIRS "${LLVM_MAIN_INCLUDE_DIR}/llvm/DebugInfo/PDB/Raw")
|
2015-02-11 11:28:02 +08:00
|
|
|
list(APPEND LIBPDB_ADDITIONAL_HEADER_DIRS "${LLVM_MAIN_INCLUDE_DIR}/llvm/DebugInfo/PDB")
|
2015-02-11 05:17:52 +08:00
|
|
|
|
2015-02-07 04:30:52 +08:00
|
|
|
add_llvm_library(LLVMDebugInfoPDB
|
2016-05-07 04:51:57 +08:00
|
|
|
GenericError.cpp
|
2015-02-11 06:43:25 +08:00
|
|
|
IPDBSourceFile.cpp
|
2015-02-07 04:30:52 +08:00
|
|
|
PDB.cpp
|
2015-04-28 01:19:51 +08:00
|
|
|
PDBContext.cpp
|
2015-02-11 06:43:25 +08:00
|
|
|
PDBExtras.cpp
|
2015-02-07 04:30:52 +08:00
|
|
|
PDBInterfaceAnchors.cpp
|
|
|
|
PDBSymbol.cpp
|
2015-02-08 08:29:29 +08:00
|
|
|
PDBSymbolAnnotation.cpp
|
|
|
|
PDBSymbolBlock.cpp
|
|
|
|
PDBSymbolCompiland.cpp
|
|
|
|
PDBSymbolCompilandDetails.cpp
|
2015-02-07 04:30:52 +08:00
|
|
|
PDBSymbolCompilandEnv.cpp
|
|
|
|
PDBSymbolCustom.cpp
|
2015-02-08 08:29:29 +08:00
|
|
|
PDBSymbolData.cpp
|
|
|
|
PDBSymbolExe.cpp
|
|
|
|
PDBSymbolFunc.cpp
|
|
|
|
PDBSymbolFuncDebugEnd.cpp
|
|
|
|
PDBSymbolFuncDebugStart.cpp
|
|
|
|
PDBSymbolLabel.cpp
|
|
|
|
PDBSymbolPublicSymbol.cpp
|
|
|
|
PDBSymbolThunk.cpp
|
|
|
|
PDBSymbolTypeArray.cpp
|
|
|
|
PDBSymbolTypeBaseClass.cpp
|
|
|
|
PDBSymbolTypeBuiltin.cpp
|
|
|
|
PDBSymbolTypeCustom.cpp
|
|
|
|
PDBSymbolTypeDimension.cpp
|
|
|
|
PDBSymbolTypeEnum.cpp
|
|
|
|
PDBSymbolTypeFriend.cpp
|
|
|
|
PDBSymbolTypeFunctionArg.cpp
|
|
|
|
PDBSymbolTypeFunctionSig.cpp
|
|
|
|
PDBSymbolTypeManaged.cpp
|
|
|
|
PDBSymbolTypePointer.cpp
|
|
|
|
PDBSymbolTypeTypedef.cpp
|
|
|
|
PDBSymbolTypeUDT.cpp
|
|
|
|
PDBSymbolTypeVTable.cpp
|
|
|
|
PDBSymbolTypeVTableShape.cpp
|
|
|
|
PDBSymbolUnknown.cpp
|
|
|
|
PDBSymbolUsingNamespace.cpp
|
2015-02-23 06:03:38 +08:00
|
|
|
PDBSymDumper.cpp
|
2015-02-11 05:17:52 +08:00
|
|
|
${PDB_IMPL_SOURCES}
|
|
|
|
|
|
|
|
ADDITIONAL_HEADER_DIRS
|
|
|
|
${LIBPDB_ADDITIONAL_HEADER_DIRS}
|
2015-02-07 04:30:52 +08:00
|
|
|
)
|
2015-02-11 05:17:52 +08:00
|
|
|
|
2015-03-24 04:03:57 +08:00
|
|
|
target_link_libraries(LLVMDebugInfoPDB INTERFACE "${LIBPDB_ADDITIONAL_LIBRARIES}")
|