diff options
Diffstat (limited to 'llvm/tools')
-rw-r--r-- | llvm/tools/CMakeLists.txt | 9 | ||||
-rw-r--r-- | llvm/tools/Makefile | 2 | ||||
-rw-r--r-- | llvm/tools/llvm-pdbdump/CMakeLists.txt | 34 | ||||
-rw-r--r-- | llvm/tools/llvm-pdbdump/COMExtras.h | 295 | ||||
-rw-r--r-- | llvm/tools/llvm-pdbdump/DIAExtras.cpp | 189 | ||||
-rw-r--r-- | llvm/tools/llvm-pdbdump/DIAExtras.h | 131 | ||||
-rw-r--r-- | llvm/tools/llvm-pdbdump/DIASymbol.cpp | 968 | ||||
-rw-r--r-- | llvm/tools/llvm-pdbdump/DIASymbol.h | 282 | ||||
-rw-r--r-- | llvm/tools/llvm-pdbdump/LLVMBuild.txt | 2 | ||||
-rw-r--r-- | llvm/tools/llvm-pdbdump/Makefile | 17 | ||||
-rw-r--r-- | llvm/tools/llvm-pdbdump/llvm-pdbdump.cpp | 325 | ||||
-rw-r--r-- | llvm/tools/llvm-pdbdump/llvm-pdbdump.h | 32 |
12 files changed, 48 insertions, 2238 deletions
diff --git a/llvm/tools/CMakeLists.txt b/llvm/tools/CMakeLists.txt index 26d2dfde931..1f415b620df 100644 --- a/llvm/tools/CMakeLists.txt +++ b/llvm/tools/CMakeLists.txt @@ -61,14 +61,7 @@ add_llvm_tool_subdirectory(yaml2obj) add_llvm_tool_subdirectory(llvm-go) -if(MSVC AND NOT(MSVC_VERSION LESS 1800)) - # Certain aspects of llvm-pdbdump require language support only present in - # MSVC 2013 and higher. Since this is strictly a utility, and since we hope - # to drop support for MSVC 2012 soon, don't build this for MSVC < 2013. - add_llvm_tool_subdirectory(llvm-pdbdump) -else() - ignore_llvm_tool_subdirectory(llvm-pdbdump) -endif() +add_llvm_tool_subdirectory(llvm-pdbdump) if(NOT CYGWIN AND LLVM_ENABLE_PIC) add_llvm_tool_subdirectory(lto) diff --git a/llvm/tools/Makefile b/llvm/tools/Makefile index b559edacd52..fcb6c647e3a 100644 --- a/llvm/tools/Makefile +++ b/llvm/tools/Makefile @@ -33,7 +33,7 @@ PARALLEL_DIRS := opt llvm-as llvm-dis llc llvm-ar llvm-nm llvm-link \ macho-dump llvm-objdump llvm-readobj llvm-rtdyld \ llvm-dwarfdump llvm-cov llvm-size llvm-stress llvm-mcmarkup \ llvm-profdata llvm-symbolizer obj2yaml yaml2obj llvm-c-test \ - llvm-vtabledump verify-uselistorder dsymutil + llvm-vtabledump verify-uselistorder dsymutil llvm-pdbdump # If Intel JIT Events support is configured, build an extra tool to test it. ifeq ($(USE_INTEL_JITEVENTS), 1) diff --git a/llvm/tools/llvm-pdbdump/CMakeLists.txt b/llvm/tools/llvm-pdbdump/CMakeLists.txt index 6cad395b281..a3bb408097c 100644 --- a/llvm/tools/llvm-pdbdump/CMakeLists.txt +++ b/llvm/tools/llvm-pdbdump/CMakeLists.txt @@ -1,28 +1,8 @@ -set(MSVC_DIA_SDK_DIR "$ENV{VSINSTALLDIR}DIA SDK") +set(LLVM_LINK_COMPONENTS + Support + DebugInfoPDB + ) -# Due to a bug in MSVC 2013's installation software, it is possible -# for MSVC 2013 to write the DIA SDK into the Visual Studio 2012 -# install directory. If this happens, the installation is corrupt -# and there's nothing we can do. It happens with enough frequency -# though that we should handle it. We do so by simply checking that -# the DIA SDK folder exists. Should this happen you will need to -# uninstall VS 2012 and then re-install VS 2013. -if (IS_DIRECTORY ${MSVC_DIA_SDK_DIR}) - set(LLVM_LINK_COMPONENTS - Support - ) - - include_directories(${MSVC_DIA_SDK_DIR}/include) - if (CMAKE_SIZEOF_VOID_P EQUAL 8) - link_directories(${MSVC_DIA_SDK_DIR}/lib/amd64) - else() - link_directories(${MSVC_DIA_SDK_DIR}/lib) - endif() - - add_llvm_tool(llvm-pdbdump - llvm-pdbdump.cpp - DIAExtras.cpp - DIASymbol.cpp - ) - target_link_libraries(llvm-pdbdump diaguids) -endif() +add_llvm_tool(llvm-pdbdump + llvm-pdbdump.cpp + ) diff --git a/llvm/tools/llvm-pdbdump/COMExtras.h b/llvm/tools/llvm-pdbdump/COMExtras.h deleted file mode 100644 index 500f5714f81..00000000000 --- a/llvm/tools/llvm-pdbdump/COMExtras.h +++ /dev/null @@ -1,295 +0,0 @@ -//===- COMExtras.h - Helper files for COM operations -------------*- C++-*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_TOOLS_LLVM_PDBDUMP_COMEXTRAS_H -#define LLVM_TOOLS_LLVM_PDBDUMP_COMEXTRAS_H - -#include "llvm/ADT/ArrayRef.h" -#include "llvm/ADT/SmallVector.h" -#include "llvm/Support/ConvertUTF.h" - -#include <tuple> - -namespace llvm { - -template <typename F> struct function_traits; - -#if LLVM_HAS_VARIADIC_TEMPLATES -template <typename R, typename... Args> -struct function_traits<R (*)(Args...)> : public function_traits<R(Args...)> {}; - -template <typename C, typename R, typename... Args> -struct function_traits<R (__stdcall C::*)(Args...)> { - using args_tuple = std::tuple<Args...>; -}; -#else - -// For the sake of COM, we only need a 3 argument version and a 5 argument -// version. We could provide 1, 2, 4, and other length of argument lists if -// this were intended to be more generic. Alternatively, this will "just work" -// if VS2012 support is dropped and we can use the variadic template case -// exclusively. -template <typename C, typename R, typename A1, typename A2, typename A3> -struct function_traits<R (__stdcall C::*)(A1, A2, A3)> { - typedef std::tuple<A1, A2, A3> args_tuple; -}; - -template <typename C, typename R, typename A1, typename A2, typename A3, - typename A4, typename A5> -struct function_traits<R (__stdcall C::*)(A1, A2, A3, A4, A5)> { - typedef std::tuple<A1, A2, A3, A4, A5> args_tuple; -}; -#endif - -template <class FuncTraits, std::size_t arg> struct function_arg { - // Writing function_arg as a separate class that accesses the tuple from - // function_traits is necessary due to what appears to be a bug in MSVC. - // If you write a nested class inside function_traits like this: - // template<std::size_t ArgIndex> - // struct Argument - // { - // typedef typename - // std::tuple_element<ArgIndex, std::tuple<Args...>>::type type; - // }; - // MSVC encounters a parsing error. - typedef - typename std::tuple_element<arg, typename FuncTraits::args_tuple>::type - type; -}; - -template <class T> struct remove_double_pointer {}; -template <class T> struct remove_double_pointer<T **> { typedef T type; }; - -namespace sys { -namespace windows { - -/// A helper class for allowing the use of COM enumerators in range-based -/// for loops. -/// -/// A common idiom in the COM world is to have an enumerator interface, say -/// IMyEnumerator. It's responsible for enumerating over some child data type, -/// say IChildType. You do the enumeration by calling IMyEnumerator::Next() -/// one of whose arguments will be an IChildType**. Eventually Next() fails, -/// indicating that there are no more items. -/// -/// com_iterator represents a single point-in-time of this iteration. It is -/// used by ComEnumerator to support iterating in this fashion via range-based -/// for loops and other common C++ paradigms. -template <class EnumeratorType, std::size_t ArgIndex> class com_iterator { - using FunctionTraits = function_traits<decltype(&EnumeratorType::Next)>; - typedef typename function_arg<FunctionTraits, ArgIndex>::type FuncArgType; - // FuncArgType is now something like ISomeCOMInterface **. Remove both - // pointers, so we can make a CComPtr<T> out of it. - typedef typename remove_double_pointer<FuncArgType>::type EnumDataType; - - CComPtr<EnumeratorType> EnumeratorObject; - CComPtr<EnumDataType> CurrentItem; - -public: - typedef CComPtr<EnumDataType> value_type; - typedef std::ptrdiff_t difference_type; - typedef value_type *pointer_type; - typedef value_type &reference_type; - typedef std::forward_iterator_tag iterator_category; - - explicit com_iterator(CComPtr<EnumeratorType> Enumerator, - CComPtr<EnumDataType> Current) - : EnumeratorObject(Enumerator), CurrentItem(Current) {} - com_iterator() {} - - com_iterator &operator++() { - // EnumeratorObject->Next() expects CurrentItem to be NULL. - CurrentItem.Release(); - ULONG Count = 0; - HRESULT hr = EnumeratorObject->Next(1, &CurrentItem, &Count); - if (FAILED(hr) || Count == 0) - *this = com_iterator(); - - return *this; - } - - value_type operator*() { return CurrentItem; } - - bool operator==(const com_iterator &other) const { - return (EnumeratorObject == other.EnumeratorObject) && - (CurrentItem == other.CurrentItem); - } - - bool operator!=(const com_iterator &other) const { return !(*this == other); } - - com_iterator &operator=(const com_iterator &other) { - EnumeratorObject = other.EnumeratorObject; - CurrentItem = other.CurrentItem; - return *this; - } -}; - -/// ComEnumerator implements the interfaced required for C++ to allow its use -/// in range-based for loops. In particular, a begin() and end() method. -/// These methods simply construct and return an appropriate ComIterator -/// instance. -template <class EnumeratorType, std::size_t ArgIndex> class com_enumerator { - typedef function_traits<decltype(&EnumeratorType::Next)> FunctionTraits; - typedef typename function_arg<FunctionTraits, ArgIndex>::type FuncArgType; - typedef typename remove_double_pointer<FuncArgType>::type EnumDataType; - - CComPtr<EnumeratorType> EnumeratorObject; - -public: - com_enumerator(CComPtr<EnumeratorType> Enumerator) - : EnumeratorObject(Enumerator) {} - - com_iterator<EnumeratorType, ArgIndex> begin() { - if (!EnumeratorObject) - return end(); - - EnumeratorObject->Reset(); - ULONG Count = 0; - CComPtr<EnumDataType> FirstItem; - HRESULT hr = EnumeratorObject->Next(1, &FirstItem, &Count); - return (FAILED(hr) || Count == 0) ? end() - : com_iterator<EnumeratorType, ArgIndex>( - EnumeratorObject, FirstItem); - } - - com_iterator<EnumeratorType, ArgIndex> end() { - return com_iterator<EnumeratorType, ArgIndex>(); - } -}; - -/// A helper class for allowing the use of COM record enumerators in range- -/// based for loops. -/// -/// A record enumerator is almost the same as a regular enumerator, except -/// that it returns raw byte-data instead of interfaces to other COM objects. -/// As a result, the enumerator's Next() method has a slightly different -/// signature, and an iterator dereferences to an ArrayRef instead of a -/// CComPtr. -template <class EnumeratorType> class com_data_record_iterator { -public: - typedef llvm::ArrayRef<uint8_t> value_type; - typedef std::ptrdiff_t difference_type; - typedef value_type *pointer_type; - typedef value_type &reference_type; - typedef std::forward_iterator_tag iterator_category; - - explicit com_data_record_iterator(CComPtr<EnumeratorType> enumerator) - : Enumerator(enumerator), CurrentRecord(0) { - // Make sure we start at the beginning. If there are no records, - // immediately set ourselves equal to end(). - if (enumerator) - enumerator->Reset(); - - if (!ReadNextRecord()) - *this = com_data_record_iterator(); - } - com_data_record_iterator() {} - - com_data_record_iterator &operator++() { - ++CurrentRecord; - // If we can't read any more records, either because there are no more - // or because we encountered an error, we should compare equal to end. - if (!ReadNextRecord()) - *this = com_data_record_iterator(); - return *this; - } - - value_type operator*() { - return llvm::ArrayRef<uint8_t>(RecordData.begin(), RecordData.end()); - } - - bool operator==(const com_data_record_iterator &other) const { - return (Enumerator == other.Enumerator) && - (CurrentRecord == other.CurrentRecord); - } - - bool operator!=(const com_data_record_iterator &other) const { - return !(*this == other); - } - -private: - bool ReadNextRecord() { - RecordData.clear(); - ULONG Count = 0; - DWORD RequiredBufferSize; - HRESULT hr = Enumerator->Next(1, 0, &RequiredBufferSize, nullptr, &Count); - if (hr == S_OK) { - RecordData.resize(RequiredBufferSize); - DWORD BytesRead = 0; - hr = Enumerator->Next(1, RequiredBufferSize, &BytesRead, - RecordData.data(), &Count); - } - if (hr != S_OK) - RecordData.clear(); - return (hr == S_OK); - } - - CComPtr<EnumeratorType> Enumerator; - uint32_t CurrentRecord; - llvm::SmallVector<uint8_t, 32> RecordData; -}; - -/// Similar to ComEnumerator, com_data_record_enumerator implements the range -/// interface for ComDataRecordIterators. -template <class EnumeratorType> class com_data_record_enumerator { -public: - com_data_record_enumerator(CComPtr<EnumeratorType> enumerator) - : Enumerator(enumerator) {} - - com_data_record_iterator<EnumeratorType> begin() { - return com_data_record_iterator<EnumeratorType>(Enumerator); - } - - com_data_record_iterator<EnumeratorType> end() { - LONG NumElts = 0; - HRESULT hr = Enumerator->get_Count(&NumElts); - return (FAILED(hr)) ? com_data_record_iterator<EnumeratorType>(Enumerator) - : com_data_record_iterator<EnumeratorType>(); - } - -private: - CComPtr<EnumeratorType> Enumerator; -}; - -/// com_enumerator is a simple helper function to allow the enumerator -/// class's type to be inferred automatically. -/// This allows you to write simply: -/// for (auto item : com_enumerator(MyEnumerator)) { -/// } -template <class EnumeratorType> -com_enumerator<EnumeratorType, 1> -make_com_enumerator(CComPtr<EnumeratorType> Enumerator) { - return com_enumerator<EnumeratorType, 1>(Enumerator); -} - -/// com_data_record_enumerator is a simple helper function to allow the -/// enumerator class's type to be inferred automatically. -/// This allows you to write simply: -/// for (auto item : com_data_record_enumerator(MyEnumerator)) { -/// } -//============================================================================= -template <class EnumeratorType> -com_data_record_enumerator<EnumeratorType> -make_com_data_record_enumerator(CComPtr<EnumeratorType> Enumerator) { - return com_data_record_enumerator<EnumeratorType>(Enumerator); -} - -inline bool BSTRToUTF8(BSTR String16, std::string &String8) { - UINT ByteLength = ::SysStringByteLen(String16); - char *Bytes = reinterpret_cast<char *>(String16); - String8.clear(); - return llvm::convertUTF16ToUTF8String(ArrayRef<char>(Bytes, ByteLength), - String8); -} - -} // namespace windows -} // namespace sys -} // namespace llvm - -#endif diff --git a/llvm/tools/llvm-pdbdump/DIAExtras.cpp b/llvm/tools/llvm-pdbdump/DIAExtras.cpp deleted file mode 100644 index f08c42efc72..00000000000 --- a/llvm/tools/llvm-pdbdump/DIAExtras.cpp +++ /dev/null @@ -1,189 +0,0 @@ -//===- DIAExtras.cpp - Helper classes and functions for DIA C++ ---------*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -#include "llvm/Support/Format.h" -#include "llvm/Support/raw_ostream.h" - -#include "llvm-pdbdump.h" -#include "DIAExtras.h" - -using namespace llvm; -using namespace llvm::sys::windows; - -#define PRINT_ENUM_VALUE_CASE(Value, Name) \ - case Value: \ - outs() << Name; \ - break; - -raw_ostream &llvm::operator<<(raw_ostream &Stream, DiaSymTagEnum SymTag) { - switch (SymTag) { - PRINT_ENUM_VALUE_CASE(SymTagNull, "Null") - PRINT_ENUM_VALUE_CASE(SymTagExe, "Exe") - PRINT_ENUM_VALUE_CASE(SymTagCompiland, "Compiland") - PRINT_ENUM_VALUE_CASE(SymTagCompilandDetails, "CompilandDetails") - PRINT_ENUM_VALUE_CASE(SymTagCompilandEnv, "CompilandEnv") - PRINT_ENUM_VALUE_CASE(SymTagFunction, "Function") - PRINT_ENUM_VALUE_CASE(SymTagBlock, "Block") - PRINT_ENUM_VALUE_CASE(SymTagData, "Data") - PRINT_ENUM_VALUE_CASE(SymTagAnnotation, "Annotation") - PRINT_ENUM_VALUE_CASE(SymTagLabel, "Label") - PRINT_ENUM_VALUE_CASE(SymTagPublicSymbol, "PublicSymbol") - PRINT_ENUM_VALUE_CASE(SymTagUDT, "UDT") - PRINT_ENUM_VALUE_CASE(SymTagEnum, "Enum") - PRINT_ENUM_VALUE_CASE(SymTagFunctionType, "FunctionType") - PRINT_ENUM_VALUE_CASE(SymTagPointerType, "PointerType") - PRINT_ENUM_VALUE_CASE(SymTagArrayType, "ArrayType") - PRINT_ENUM_VALUE_CASE(SymTagBaseType, "BaseType") - PRINT_ENUM_VALUE_CASE(SymTagTypedef, "Typedef") - PRINT_ENUM_VALUE_CASE(SymTagBaseClass, "BaseClass") - PRINT_ENUM_VALUE_CASE(SymTagFriend, "Friend") - PRINT_ENUM_VALUE_CASE(SymTagFunctionArgType, "FunctionArgType") - PRINT_ENUM_VALUE_CASE(SymTagFuncDebugStart, "FuncDebugStart") - PRINT_ENUM_VALUE_CASE(SymTagFuncDebugEnd, "FuncDebugEnd") - PRINT_ENUM_VALUE_CASE(SymTagUsingNamespace, "UsingNamespace") - PRINT_ENUM_VALUE_CASE(SymTagVTableShape, "VTableShape") - PRINT_ENUM_VALUE_CASE(SymTagVTable, "VTable") - PRINT_ENUM_VALUE_CASE(SymTagCustom, "Custom") - PRINT_ENUM_VALUE_CASE(SymTagThunk, "Thunk") - PRINT_ENUM_VALUE_CASE(SymTagCustomType, "CustomType") - PRINT_ENUM_VALUE_CASE(SymTagManagedType, "ManagedType") - PRINT_ENUM_VALUE_CASE(SymTagDimension, "Dimension") - PRINT_ENUM_VALUE_CASE(SymTagCallSite, "CallSite") - PRINT_ENUM_VALUE_CASE(SymTagInlineSite, "InlineSite") - PRINT_ENUM_VALUE_CASE(SymTagBaseInterface, "BaseInterface") - PRINT_ENUM_VALUE_CASE(SymTagVectorType, "VectorType") - PRINT_ENUM_VALUE_CASE(SymTagMatrixType, "MatrixType") - PRINT_ENUM_VALUE_CASE(SymTagHLSLType, "HLSLType") -#if (_MSC_FULL_VER >= 180031101) - PRINT_ENUM_VALUE_CASE(SymTagCaller, "Caller") - PRINT_ENUM_VALUE_CASE(SymTagCallee, "Callee") -#endif - PRINT_ENUM_VALUE_CASE(SymTagMax, "Max") - } - outs() << " {" << (DWORD)SymTag << "}"; - return Stream; -} - -raw_ostream &llvm::operator<<(raw_ostream &Stream, CV_CPU_TYPE_e CpuType) { - switch (CpuType) { - PRINT_ENUM_VALUE_CASE(CV_CFL_8080, "8080") - PRINT_ENUM_VALUE_CASE(CV_CFL_8086, "8086") - PRINT_ENUM_VALUE_CASE(CV_CFL_80286, "80286") - PRINT_ENUM_VALUE_CASE(CV_CFL_80386, "80386") - PRINT_ENUM_VALUE_CASE(CV_CFL_80486, "80486") - PRINT_ENUM_VALUE_CASE(CV_CFL_PENTIUM, "Pentium") - PRINT_ENUM_VALUE_CASE(CV_CFL_PENTIUMPRO, "Pentium Pro") - PRINT_ENUM_VALUE_CASE(CV_CFL_PENTIUMIII, "Pentium III") - PRINT_ENUM_VALUE_CASE(CV_CFL_MIPS, "MIPS") - PRINT_ENUM_VALUE_CASE(CV_CFL_MIPS16, "MIPS 16") - PRINT_ENUM_VALUE_CASE(CV_CFL_MIPS32, "MIPS 32") - PRINT_ENUM_VALUE_CASE(CV_CFL_MIPS64, "MIPS 64") - PRINT_ENUM_VALUE_CASE(CV_CFL_MIPSI, "MIPS I") - PRINT_ENUM_VALUE_CASE(CV_CFL_MIPSII, "MIPS II") - PRINT_ENUM_VALUE_CASE(CV_CFL_MIPSIII, "MIPS III") - PRINT_ENUM_VALUE_CASE(CV_CFL_MIPSIV, "MIPS IV") - PRINT_ENUM_VALUE_CASE(CV_CFL_MIPSV, "MIPS V") - PRINT_ENUM_VALUE_CASE(CV_CFL_M68000, "M68000") - PRINT_ENUM_VALUE_CASE(CV_CFL_M68010, "M68010") - PRINT_ENUM_VALUE_CASE(CV_CFL_M68020, "M68020") - PRINT_ENUM_VALUE_CASE(CV_CFL_M68030, "M68030") - PRINT_ENUM_VALUE_CASE(CV_CFL_M68040, "M68040") - PRINT_ENUM_VALUE_CASE(CV_CFL_ALPHA, "Alpha") - PRINT_ENUM_VALUE_CASE(CV_CFL_ALPHA_21164, "Alpha 21164") - PRINT_ENUM_VALUE_CASE(CV_CFL_ALPHA_21164A, "Alpha 21164A") - PRINT_ENUM_VALUE_CASE(CV_CFL_ALPHA_21264, "Alpha 21264") - PRINT_ENUM_VALUE_CASE(CV_CFL_ALPHA_21364, "21364") - PRINT_ENUM_VALUE_CASE(CV_CFL_PPC601, "PowerPC 601") - PRINT_ENUM_VALUE_CASE(CV_CFL_PPC603, "PowerPC 603") - PRINT_ENUM_VALUE_CASE(CV_CFL_PPC604, "PowerPC 604") - PRINT_ENUM_VALUE_CASE(CV_CFL_PPC620, "PowerPC 620") - PRINT_ENUM_VALUE_CASE(CV_CFL_PPCFP, "PowerPC FP") - PRINT_ENUM_VALUE_CASE(CV_CFL_PPCBE, "PowerPC BE") - PRINT_ENUM_VALUE_CASE(CV_CFL_SH3, "SH3") - PRINT_ENUM_VALUE_CASE(CV_CFL_SH3E, "SH3-E") - PRINT_ENUM_VALUE_CASE(CV_CFL_SH3DSP, "SH3-DSP") - PRINT_ENUM_VALUE_CASE(CV_CFL_SH4, "SH4") - PRINT_ENUM_VALUE_CASE(CV_CFL_SHMEDIA, "SH Media") - PRINT_ENUM_VALUE_CASE(CV_CFL_ARM3, "ARM 3") - PRINT_ENUM_VALUE_CASE(CV_CFL_ARM4, "ARM 4") - PRINT_ENUM_VALUE_CASE(CV_CFL_ARM4T, "ARM 4T") - PRINT_ENUM_VALUE_CASE(CV_CFL_ARM5, "ARM 5") - PRINT_ENUM_VALUE_CASE(CV_CFL_ARM5T, "ARM 5T") - PRINT_ENUM_VALUE_CASE(CV_CFL_ARM6, "ARM 6") - PRINT_ENUM_VALUE_CASE(CV_CFL_ARM_XMAC, "ARM XMAC") - PRINT_ENUM_VALUE_CASE(CV_CFL_ARM_WMMX, "ARM WMMX") - PRINT_ENUM_VALUE_CASE(CV_CFL_ARM7, "ARM 7") - PRINT_ENUM_VALUE_CASE(CV_CFL_OMNI, "Omni") - PRINT_ENUM_VALUE_CASE(CV_CFL_IA64, "IA64") - PRINT_ENUM_VALUE_CASE(CV_CFL_IA64_2, "IA64-2") - PRINT_ENUM_VALUE_CASE(CV_CFL_CEE, "CEE") - PRINT_ENUM_VALUE_CASE(CV_CFL_AM33, "AM33") - PRINT_ENUM_VALUE_CASE(CV_CFL_M32R, "M32R") - PRINT_ENUM_VALUE_CASE(CV_CFL_TRICORE, "TriCore") - PRINT_ENUM_VALUE_CASE(CV_CFL_X64, "X64") - PRINT_ENUM_VALUE_CASE(CV_CFL_EBC, "EBC") - PRINT_ENUM_VALUE_CASE(CV_CFL_THUMB, "Thumb") - PRINT_ENUM_VALUE_CASE(CV_CFL_ARMNT, "ARM NT") -#if (_MSC_FULL_VER >= 180031101) - PRINT_ENUM_VALUE_CASE(CV_CFL_ARM64, "ARM 64") -#endif - PRINT_ENUM_VALUE_CASE(CV_CFL_D3D11_SHADER, "D3D11 Shader") - } - outs() << " {" << llvm::format_hex((DWORD)CpuType, 2, true) << "}"; - return Stream; -} - -raw_ostream &llvm::operator<<(raw_ostream &Stream, - MachineTypeEnum MachineType) { - switch (MachineType) { - PRINT_ENUM_VALUE_CASE(MachineTypeUnknown, "Unknown") - PRINT_ENUM_VALUE_CASE(MachineTypeX86, "x86") - PRINT_ENUM_VALUE_CASE(MachineTypeR3000, "R3000") - PRINT_ENUM_VALUE_CASE(MachineTypeR4000, "R4000") - PRINT_ENUM_VALUE_CASE(MachineTypeR10000, "R10000") - PRINT_ENUM_VALUE_CASE(MachineTypeWCEMIPSv2, "WCE MIPSv2") - PRINT_ENUM_VALUE_CASE(MachineTypeAlpha, "Alpha") - PRINT_ENUM_VALUE_CASE(MachineTypeSH3, "SH3") - PRINT_ENUM_VALUE_CASE(MachineTypeSH3DSP, "SH3-DSP") - PRINT_ENUM_VALUE_CASE(MachineTypeSH3E, "SH3-E") - PRINT_ENUM_VALUE_CASE(MachineTypeSH4, "SH4") - PRINT_ENUM_VALUE_CASE(MachineTypeSH5, "SH5") - PRINT_ENUM_VALUE_CASE(MachineTypeArm, "ARM") - PRINT_ENUM_VALUE_CASE(MachineTypeThumb, "Thumb") - PRINT_ENUM_VALUE_CASE(MachineTypeArmNT, "ARM NT") - PRINT_ENUM_VALUE_CASE(MachineTypeAM33, "AM33") - PRINT_ENUM_VALUE_CASE(MachineTypePowerPC, "PowerPC") - PRINT_ENUM_VALUE_CASE(MachineTypePowerPCFP, "PowerPC FP") - PRINT_ENUM_VALUE_CASE(MachineTypeIa64, "IA 64") - PRINT_ENUM_VALUE_CASE(MachineTypeMips16, "MIPS 16") - PRINT_ENUM_VALUE_CASE(MachineTypeAlpha64, "Alpha 64") - PRINT_ENUM_VALUE_CASE(MachineTypeMipsFpu, "FPU") - PRINT_ENUM_VALUE_CASE(MachineTypeMipsFpu16, "FPU 16") - PRINT_ENUM_VALUE_CASE(MachineTypeTriCore, "TriCore") - PRINT_ENUM_VALUE_CASE(MachineTypeCEF, "CEF") - PRINT_ENUM_VALUE_CASE(MachineTypeEBC, "EBC") - PRINT_ENUM_VALUE_CASE(MachineTypeAmd64, "x64") - PRINT_ENUM_VALUE_CASE(MachineTypeM32R, "M32R") - PRINT_ENUM_VALUE_CASE(MachineTypeCEE, "CEE") - } - outs() << " {" << llvm::format_hex((DWORD)MachineType, 2, true) << "}"; - return Stream; -} - -raw_ostream &llvm::operator<<(raw_ostream &Stream, HashAlgorithm Algorithm) { - switch (Algorithm) { - PRINT_ENUM_VALUE_CASE(HashNone, "None") - PRINT_ENUM_VALUE_CASE(HashMD5, "MD5") - PRINT_ENUM_VALUE_CASE(HashSHA1, "SHA-1") - default: - outs() << "(Unknown)"; - break; - } - outs() << " {" << (DWORD)Algorithm << "}"; - return Stream; -} diff --git a/llvm/tools/llvm-pdbdump/DIAExtras.h b/llvm/tools/llvm-pdbdump/DIAExtras.h deleted file mode 100644 index aeef1972dc2..00000000000 --- a/llvm/tools/llvm-pdbdump/DIAExtras.h +++ /dev/null @@ -1,131 +0,0 @@ -//===- DIAExtras.h - Helper classes and functions for accessing DIA C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// Defines helper types, classes, and functions for working with DIA. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_TOOLS_LLVMPDBDUMP_DIAEXTRAS_H -#define LLVM_TOOLS_LLVMPDBDUMP_DIAEXTRAS_H - -#include "llvm/ADT/SmallString.h" -#include "llvm/Support/raw_ostream.h" - -#include "COMExtras.h" - -namespace llvm { -namespace sys { -namespace windows { - -typedef llvm::SmallString<16> DIAString; - -template <class T> class DIAResult { -public: - DIAResult() : IsValid(false) {} - DIAResult(const T &ResultValue) : Result(ResultValue), IsValid(true) {} - - bool hasValue() const { return IsValid; } - T value() const { return Result; } - - void dump(StringRef Name, unsigned IndentLevel) const { - if (!hasValue()) - return; - outs().indent(IndentLevel); - outs() << Name << ": " << value() << "\n"; - } - -private: - T Result; - bool IsValid; -}; - -template <> -void DIAResult<BOOL>::dump(StringRef Name, unsigned IndentLevel) const { - if (!hasValue()) - return; - outs().indent(IndentLevel); - outs() << Name << ": " << (value() ? "true" : "false") << "\n"; -} - -template <> -void DIAResult<GUID>::dump(StringRef Name, unsigned IndentLevel) const { - if (!hasValue()) - return; - std::string Guid8; - CComBSTR GuidBSTR(value()); - BSTRToUTF8(GuidBSTR.m_str, Guid8); - - outs().indent(IndentLevel); - outs() << Name << ": " << Guid8 << "\n"; -} - -// MSDN documents the IDiaSymbol::get_machineType method as returning a value -// from the CV_CPU_TYPE_e enumeration. This documentation is wrong, however, -// and this method actually returns a value from the IMAGE_FILE_xxx set of -// defines from winnt.h. These correspond to the platform magic number in -// the COFF file. This enumeration is built from the set of values in winnt.h -enum MachineTypeEnum { - MachineTypeUnknown = IMAGE_FILE_MACHINE_UNKNOWN, - MachineTypeX86 = IMAGE_FILE_MACHINE_I386, - MachineTypeR3000 = IMAGE_FILE_MACHINE_R3000, - MachineTypeR4000 = IMAGE_FILE_MACHINE_R4000, - MachineTypeR10000 = IMAGE_FILE_MACHINE_R10000, - MachineTypeWCEMIPSv2 = IMAGE_FILE_MACHINE_WCEMIPSV2, - MachineTypeAlpha = IMAGE_FILE_MACHINE_ALPHA, - MachineTypeSH3 = IMAGE_FILE_MACHINE_SH3, - MachineTypeSH3DSP = IMAGE_FILE_MACHINE_SH3DSP, - MachineTypeSH3E = IMAGE_FILE_MACHINE_SH3E, - MachineTypeSH4 = IMAGE_FILE_MACHINE_SH4, - MachineTypeSH5 = IMAGE_FILE_MACHINE_SH5, - MachineTypeArm = IMAGE_FILE_MACHINE_ARM, - MachineTypeThumb = IMAGE_FILE_MACHINE_THUMB, - MachineTypeArmNT = IMAGE_FILE_MACHINE_ARMNT, - MachineTypeAM33 = IMAGE_FILE_MACHINE_AM33, - MachineTypePowerPC = IMAGE_FILE_MACHINE_POWERPC, - MachineTypePowerPCFP = IMAGE_FILE_MACHINE_POWERPCFP, - MachineTypeIa64 = IMAGE_FILE_MACHINE_IA64, - MachineTypeMips16 = IMAGE_FILE_MACHINE_MIPS16, - MachineTypeAlpha64 = IMAGE_FILE_MACHINE_ALPHA64, - MachineTypeMipsFpu = IMAGE_FILE_MACHINE_MIPSFPU, - MachineTypeMipsFpu16 = IMAGE_FILE_MACHINE_MIPSFPU16, - MachineTypeTriCore = IMAGE_FILE_MACHINE_TRICORE, - MachineTypeCEF = IMAGE_FILE_MACHINE_CEF, - MachineTypeEBC = IMAGE_FILE_MACHINE_EBC, - MachineTypeAmd64 = IMAGE_FILE_MACHINE_AMD64, - MachineTypeM32R = IMAGE_FILE_MACHINE_M32R, - MachineTypeCEE = IMAGE_FILE_MACHINE_CEE, -}; - -enum HashAlgorithm { HashNone = 0, HashMD5 = 1, HashSHA1 = 2 }; - -// SymTagEnum has the unfortunate property that it is not only the name of -// the enum, but also the name of one of the values of the enum. So that we -// don't have to always type "enum SymTagEnum", we typedef this to a different -// name so that we can refer to it more easily. -typedef enum SymTagEnum DiaSymTagEnum; - -typedef CComPtr<IDiaSymbol> DiaSymbolPtr; - -} // namespace windows -} // namespace sys -} // namespace llvm - -namespace llvm { -class raw_ostream; - -raw_ostream &operator<<(raw_ostream &Stream, - llvm::sys::windows::DiaSymTagEnum SymTag); -raw_ostream &operator<<(raw_ostream &Stream, CV_CPU_TYPE_e CpuType); -raw_ostream &operator<<(raw_ostream &Stream, - llvm::sys::windows::MachineTypeEnum CpuType); -raw_ostream &operator<<(raw_ostream &Stream, - llvm::sys::windows::HashAlgorithm Algorithm); -} - -#endif diff --git a/llvm/tools/llvm-pdbdump/DIASymbol.cpp b/llvm/tools/llvm-pdbdump/DIASymbol.cpp deleted file mode 100644 index 753f6f9b4ea..00000000000 --- a/llvm/tools/llvm-pdbdump/DIASymbol.cpp +++ /dev/null @@ -1,968 +0,0 @@ -//===- DIASymbol.cpp - Dump debug info from a PDB file ----------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include "llvm-pdbdump.h" -#include "DIASymbol.h" - -using namespace llvm::sys::windows; - -DIASymbol::DIASymbol(IDiaSymbol *DiaSymbol) : Symbol(DiaSymbol) { - Symbol->AddRef(); -} - -DIASymbol::~DIASymbol() { Symbol->Release(); } - -void DIASymbol::fullDump(int IndentLevel) { - getLexicalParent().dump("Lexical parent", IndentLevel); - getClassParent().dump("Class parent", IndentLevel); - getType().dump("Type", IndentLevel); - getArrayIndexType().dump("Array index type", IndentLevel); - getVirtualTableShape().dump("Vtable shape", IndentLevel); - getLowerBound().dump("Lower bound", IndentLevel); - getUpperBound().dump("Upper bound", IndentLevel); - getObjectPointerType().dump("Object pointer type", IndentLevel); - getContainer().dump("Container", IndentLevel); - getVirtualBaseTableType().dump("Virtual base table type", IndentLevel); - getUnmodifiedType().dump("Unmodified type", IndentLevel); - getSubType().dump("Sub type", IndentLevel); - getBaseSymbol().dump("Base symbol", IndentLevel); - -#if (_MSC_FULL_VER >= 180031101) - // These methods are only available on VS 2013 SP4 and higher. - isPGO().dump("Is PGO", IndentLevel); - hasValidPGOCounts().dump("Has valid PGO counts", IndentLevel); - isOptimizedForSpeed().dump("Is optimized for speed", IndentLevel); - getPGOEntryCount().dump("PGO entry count", IndentLevel); - getPGOEdgeCount().dump("PGO edge count", IndentLevel); - getPGODynamicInstructionCount().dump("PGO dynamic instruction count", - IndentLevel); - getStaticSize().dump("Static size", IndentLevel); - getFinalLiveStaticSize().dump("Final live static size", IndentLevel); - getPhaseName().dump("Phase name", IndentLevel); - hasControlFlowCheck().dump("Has control flow check", IndentLevel); -#endif - - getAccess().dump("Access", IndentLevel); - getAddressOffset().dump("Address Offset", IndentLevel); - getAddressSection().dump("Address Section", IndentLevel); - getAddressTaken().dump("Address Taken", IndentLevel); - getAge().dump("Age", IndentLevel); - getArrayIndexTypeId().dump("Array Index Type Id", IndentLevel); - getBackEndMajor().dump("Back End Major", IndentLevel); - getBackEndMinor().dump("Back End Minor", IndentLevel); - getBackEndBuild().dump("Back End Build", IndentLevel); - getBaseDataOffset().dump("Base Data Offset", IndentLevel); - getBaseDataSlot().dump("Base Data Slot", IndentLevel); - getBaseSymbolId().dump("Base Symbol Id", IndentLevel); - getBaseType().dump("Base Type", IndentLevel); - getBitPosition().dump("Bit Position", IndentLevel); - getBuiltInKind().dump("Built In Kind", IndentLevel); - getCallingConvention().dump("Calling Convention", IndentLevel); - getClassParentId().dump("Class Parent Id", IndentLevel); - isCode().dump("Code", IndentLevel); - isCompilerGenerated().dump("Compiler Generated", IndentLevel); - getCompilerName().dump("Compiler Name", IndentLevel); - hasConstructor().dump("Constructor", IndentLevel); - isConstType().dump("Const Type", IndentLevel); - getCount().dump("Count", IndentLevel); - getCountLiveRanges().dump("Count Live Ranges", IndentLevel); - hasCustomCallingConvention().dump("Custom Calling Convention", IndentLevel); - getDataKind().dump("Data Kind", IndentLevel); - isEditAndContinueEnabled().dump("Edit and Continue Enabled", IndentLevel); - hasFarReturn().dump("Far Return", IndentLevel); - getFrontEndMajor().dump("Front End Major", IndentLevel); - getFrontEndMinor().dump("Front End Minor", IndentLevel); - getFrontEndBuild().dump("Front End Build", IndentLevel); - isFunction().dump("Function", IndentLevel); - getGuid().dump("GUID", IndentLevel); - hasAlloca().dump("Has Alloca", IndentLevel); - hasAssignmentOperator().dump("Has Assignment Operator", IndentLevel); - hasCastOperator().dump("Has Cast Operator", IndentLevel); - hasDebugInfo().dump("Has Debug Info", IndentLevel); - hasEH().dump("Has EH", IndentLevel); - hasEHa().dump("Has EHa", IndentLevel); - hasInlAsm().dump("Has Inline Asm", IndentLevel); - hasLongJump().dump("Has longjmp", IndentLevel); - hasManagedCode().dump("Has Managed Code", IndentLevel); - hasNestedTypes().dump("Has Nested Types", IndentLevel); - hasSecurityChecks().dump("Has Security Checks", IndentLevel); - hasSEH().dump("Has SEH", IndentLevel); - hasSetJump().dump("Has setjmp", IndentLevel); - isIndirectVirtualBaseClass().dump("Is indirect virtual base", IndentLevel); - hasInlineAttribute().dump("Has inline declspec", IndentLevel); - hasInterruptReturn().dump("Has interrupt return", IndentLevel); - isBaseVirtualFunction().dump("Is base virtual function", IndentLevel); - isAcceleratorGroupSharedLocal().dump("Is Accelerator Group Shared Local", - IndentLevel); - isAcceleratorPointerTagLiveRange().dump( - "Is Accelerator Pointer Tag Live Range", IndentLevel); - isAcceleratorStubFunction().dump("Is Accelerator Stub Function", IndentLevel); - isAggregated().dump("Is aggregated", IndentLevel); - hasCTypes().dump("Has C types", IndentLevel); - isCVTCIL().dump("Was converted from MSIL", IndentLevel); - isDataAligned().dump("Is data aligned", IndentLevel); - isHLSLData().dump("Is HLSL data", IndentLevel); - isHotpatchable().dump("Is hot-patchable", IndentLevel); - isLTCG().dump("Is LTCG", IndentLevel); - isMatrixRowMajor().dump("Is matrix row major", IndentLevel); - isMSILNetmodule().dump("Is MSIL .netmodule", IndentLevel); - isMultipleInheritance().dump("Is multiple inheritance", IndentLevel); - isNaked().dump("Is naked", IndentLevel); - isOptimizedAway().dump("Is optimized away", IndentLevel); - isPointerBasedOnSymbolValue().dump("Is pointer based on symbol value", - IndentLevel); - isPointerToDataMember().dump("Is pointer to data member", IndentLevel); - isPointerToMemberFunction().dump("Is pointer to member function", - IndentLevel); - isReturnValue().dump("Is return value", IndentLevel); - isSdl().dump("Is SDL", IndentLevel); - isSingleInheritance().dump("Is single inheritance", IndentLevel); - isSplitted().dump("Is splitted", IndentLevel); - isStatic().dump("Is staic", IndentLevel); - isStripped().dump("Is stripped", IndentLevel); - isVirtualInheritance().dump("Is virtual inheritance", IndentLevel); - getLanguage().dump("Language", IndentLevel); - getLength().dump("Length", IndentLevel); - getLexicalParentId().dump("Lexical parent id", IndentLevel); - getLibraryName().dump("Library name", IndentLevel); - getLiveRangeLength().dump("Live range length", IndentLevel); - getLiveRangeStartAddressSection().dump("Live range start address section", - IndentLevel); - getLiveRangeStartAddressOffset().dump("Live range start address offset", - IndentLevel); - getLiveRangeStartRelativeVirtualAddress().dump("Live range start address RVA", - IndentLevel); - getLocationType().dump("Location type", IndentLevel); - getLowerBoundId().dump("Lower bound id", IndentLevel); - getMachineType().dump("Machine type", IndentLevel); - isManagedRef().dump("Managed", IndentLevel); - getMemorySpaceKind().dump("Memory space kind", IndentLevel); - isMsilRef().dump("MSIL", IndentLevel); - getName().dump("Name", IndentLevel); - isNested().dump("Nested", IndentLevel); - hasNoInlineAttribute().dump("Has noinline declspec", IndentLevel); - hasNoReturnAttribute().dump("Has noreturn declspec", IndentLevel); - getNoStackOrdering().dump("No stack ordering", IndentLevel); - isUnreached().dump("Not reached", IndentLevel); - getNumberOfAcceleratorPointerTags().dump("Number of accelerator pointer tags", - IndentLevel); - getNumberOfModifiers().dump("Number of modifiers", IndentLevel); - getNumberOfRegisterIndices().dump("Number of register indices", IndentLevel); - getNumberOfRows().dump("Number of rows", IndentLevel); - getNumberOfColumns().dump("Number of columns", IndentLevel); - getObjectFileName().dump("Object file name", IndentLevel); - getOemSymbolId().dump("OEM symbol id", IndentLevel); - getOffset().dump("Offset", IndentLevel); - hasOptimizedCodeDebugInfo().dump("Optimized code debug info", IndentLevel); - hasOverloadedOperator().dump("Overloaded operator", IndentLevel); - isPacked().dump("Packed", IndentLevel); - getPlatform().dump("Platform", IndentLevel); - isPureVirtual().dump("Pure", IndentLevel); - getRank().dump("Rank", IndentLevel); - isReference().dump("Reference", IndentLevel); - getRegisterId().dump("Register ID", IndentLevel); - getRegisterType().dump("Register type", IndentLevel); - getRelativeVirtualAddress().dump("RVA", IndentLevel); - isRestrictedType().dump("Restricted type", IndentLevel); - getSamplerSlot().dump("Sampler slot", IndentLevel); - isScoped().dump("Scoped", IndentLevel); - getSignature().dump("Signature", IndentLevel); - getSizeInUdt().dump("Size in UDT", IndentLevel); - getSlot().dump("Slot", IndentLevel); - getSourceFileName().dump("Source file name", IndentLevel); - getStride().dump("Stride", IndentLevel); - getSubTypeId().dump("Sub type ID", IndentLevel); - getSymbolsFileName().dump("File name", IndentLevel); - getSymIndexId().dump("Sym index ID", IndentLevel); - getSymTag().dump("Sym tag", IndentLevel); - getTargetOffset().dump("Target offset", IndentLevel); - getTargetRelativeVirtualAddress().dump("Target RVA", IndentLevel); - getTargetSection().dump("Target section", IndentLevel); - getTargetVirtualAddress().dump("Target virtual address", IndentLevel); - getTextureSlot().dump("Texture slot", IndentLevel); - getThisAdjust().dump("This adjust", IndentLevel); - getThunkOrdinal().dump("Thunk ordinal", IndentLevel); - getTimeStamp().dump("Time stamp", IndentLevel); - getToken().dump("Token", IndentLevel); - getUavSlot().dump("UAV slot", IndentLevel); - getUdtKind().dump("UDT kind", IndentLevel); - isUnalignedType().dump("Unaligned type", IndentLevel); - getUndecoratedName().dump("Undecorated name", IndentLevel); - getUnmodifiedTypeId().dump("Unmodified type id", IndentLevel); - getUpperBoundId().dump("Upper bound id", IndentLevel); - isVirtual().dump("Virtual", IndentLevel); - getVirtualAddress().dump("Virtual address", IndentLevel); - isVirtualBaseClass().dump("Virtual base class", IndentLevel); - getVirtualBaseDispIndex().dump("Virtual base disp index", IndentLevel); - getVirtualBaseOffset().dump("Virtual base offset", IndentLevel); - getVirtualBasePointerOffset().dump("Virtual base pointer offset", - IndentLevel); - getVirtualTableShapeId().dump("Vtable shape ID", IndentLevel); - isVolatileType().dump("Volatile type", IndentLevel); -} - -#if (_MSC_FULL_VER >= 180031101) -DIAResult<BOOL> DIASymbol::isPGO() { - return InternalGetDIAValue(&IDiaSymbol::get_isPGO); -} - -DIAResult<BOOL> DIASymbol::hasValidPGOCounts() { - return InternalGetDIAValue(&IDiaSymbol::get_hasValidPGOCounts); -} - -DIAResult<BOOL> DIASymbol::isOptimizedForSpeed() { - return InternalGetDIAValue(&IDiaSymbol::get_isOptimizedForSpeed); -} - -DIAResult<DWORD> DIASymbol::getPGOEntryCount() { - return InternalGetDIAValue(&IDiaSymbol::get_PGOEntryCount); -} - -DIAResult<DWORD> DIASymbol::getPGOEdgeCount() { - return InternalGetDIAValue(&IDiaSymbol::get_PGOEdgeCount); -} - -DIAResult<ULONGLONG> DIASymbol::getPGODynamicInstructionCount() { - return InternalGetDIAValue(&IDiaSymbol::get_PGODynamicInstructionCount); -} - -DIAResult<DWORD> DIASymbol::getStaticSize() { - return InternalGetDIAValue(&IDiaSymbol::get_staticSize); -} - -DIAResult<DWORD> DIASymbol::getFinalLiveStaticSize() { - return InternalGetDIAValue(&IDiaSymbol::get_finalLiveStaticSize); -} - -DIAResult<DIAString> DIASymbol::getPhaseName() { - return InternalGetDIAStringValue(&IDiaSymbol::get_phaseName); -} - -DIAResult<BOOL> DIASymbol::hasControlFlowCheck() { - return InternalGetDIAValue(&IDiaSymbol::get_hasControlFlowCheck); -} -#endif - -DIAResult<DiaSymbolPtr> DIASymbol::getClassParent() { - return InternalGetDIAValue<IDiaSymbol *, DiaSymbolPtr>( - &IDiaSymbol::get_classParent); -} - -DIAResult<DiaSymbolPtr> DIASymbol::getType() { - return InternalGetDIAValue<IDiaSymbol *, DiaSymbolPtr>(&IDiaSymbol::get_type); -} - -DIAResult<DiaSymbolPtr> DIASymbol::getArrayIndexType() { - return InternalGetDIAValue<IDiaSymbol *, DiaSymbolPtr>( - &IDiaSymbol::get_arrayIndexType); -} - -DIAResult<DiaSymbolPtr> DIASymbol::getVirtualTableShape() { - return InternalGetDIAValue<IDiaSymbol *, DiaSymbolPtr>( - &IDiaSymbol::get_virtualTableShape); -} - -DIAResult<DiaSymbolPtr> DIASymbol::getLowerBound() { - return InternalGetDIAValue<IDiaSymbol *, DiaSymbolPtr>( - &IDiaSymbol::get_lowerBound); -} - -DIAResult<DiaSymbolPtr> DIASymbol::getUpperBound() { - return InternalGetDIAValue<IDiaSymbol *, DiaSymbolPtr>( - &IDiaSymbol::get_upperBound); -} - -DIAResult<DiaSymbolPtr> DIASymbol::getObjectPointerType() { - return InternalGetDIAValue<IDiaSymbol *, DiaSymbolPtr>( - &IDiaSymbol::get_objectPointerType); -} - -DIAResult<DiaSymbolPtr> DIASymbol::getContainer() { - return InternalGetDIAValue<IDiaSymbol *, DiaSymbolPtr>( - &IDiaSymbol::get_container); -} - -DIAResult<DiaSymbolPtr> DIASymbol::getVirtualBaseTableType() { - return InternalGetDIAValue<IDiaSymbol *, DiaSymbolPtr>( - &IDiaSymbol::get_virtualBaseTableType); -} - -DIAResult<DiaSymbolPtr> DIASymbol::getUnmodifiedType() { - return InternalGetDIAValue<IDiaSymbol *, DiaSymbolPtr>( - &IDiaSymbol::get_unmodifiedType); -} - -DIAResult<DiaSymbolPtr> DIASymbol::getSubType() { - return InternalGetDIAValue<IDiaSymbol *, DiaSymbolPtr>( - &IDiaSymbol::get_subType); -} - -DIAResult<DiaSymbolPtr> DIASymbol::getBaseSymbol() { - return InternalGetDIAValue<IDiaSymbol *, DiaSymbolPtr>( - &IDiaSymbol::get_baseSymbol); -} - -DIAResult<DWORD> DIASymbol::getAccess() { - return InternalGetDIAValue(&IDiaSymbol::get_access); -} - -DIAResult<DWORD> DIASymbol::getAddressOffset() { - return InternalGetDIAValue(&IDiaSymbol::get_addressOffset); -} - -DIAResult<DWORD> DIASymbol::getAddressSection() { - return InternalGetDIAValue(&IDiaSymbol::get_addressSection); -} - -DIAResult<BOOL> DIASymbol::getAddressTaken() { - return InternalGetDIAValue(&IDiaSymbol::get_addressTaken); -} - -DIAResult<DWORD> DIASymbol::getAge() { - return InternalGetDIAValue(&IDiaSymbol::get_age); -} - -DIAResult<DWORD> DIASymbol::getArrayIndexTypeId() { - return InternalGetDIAValue(&IDiaSymbol::get_arrayIndexTypeId); -} - -DIAResult<DWORD> DIASymbol::getBackEndMajor() { - return InternalGetDIAValue(&IDiaSymbol::get_backEndMajor); -} - -DIAResult<DWORD> DIASymbol::getBackEndMinor() { - - return InternalGetDIAValue(&IDiaSymbol::get_backEndMinor); -} - -DIAResult<DWORD> DIASymbol::getBackEndBuild() { - return InternalGetDIAValue(&IDiaSymbol::get_backEndBuild); -} - -DIAResult<DWORD> DIASymbol::getBackEndQFE() { - return InternalGetDIAValue(&IDiaSymbol::get_backEndQFE); -} - -DIAResult<DWORD> DIASymbol::getBaseDataOffset() { - return InternalGetDIAValue(&IDiaSymbol::get_baseDataOffset); -} - -DIAResult<DWORD> DIASymbol::getBaseDataSlot() { - return InternalGetDIAValue(&IDiaSymbol::get_baseDataSlot); -} - -DIAResult<DWORD> DIASymbol::getBaseSymbolId() { - return InternalGetDIAValue(&IDiaSymbol::get_baseSymbolId); -} - -DIAResult<DWORD> DIASymbol::getBaseType() { - return InternalGetDIAValue(&IDiaSymbol::get_baseType); -} - -DIAResult<DWORD> DIASymbol::getBitPosition() { - return InternalGetDIAValue(&IDiaSymbol::get_bitPosition); -} - -DIAResult<DWORD> DIASymbol::getBuiltInKind() { - return InternalGetDIAValue(&IDiaSymbol::get_builtInKind); -} - -DIAResult<CV_call_e> DIASymbol::getCallingConvention() { - return InternalGetDIAValue<DWORD, CV_call_e>( - &IDiaSymbol::get_callingConvention); -} - -DIAResult<DWORD> DIASymbol::getClassParentId() { - return InternalGetDIAValue(&IDiaSymbol::get_classParentId); -} - -DIAResult<BOOL> DIASymbol::isCode() { - return InternalGetDIAValue(&IDiaSymbol::get_code); -} - -DIAResult<BOOL> DIASymbol::isCompilerGenerated() { - return InternalGetDIAValue(&IDiaSymbol::get_compilerGenerated); -} - -DIAResult<DIAString> DIASymbol::getCompilerName() { - return InternalGetDIAStringValue(&IDiaSymbol::get_compilerName); -} - -DIAResult<BOOL> DIASymbol::hasConstructor() { - return InternalGetDIAValue(&IDiaSymbol::get_constructor); -} - -DIAResult<BOOL> DIASymbol::isConstType() { - return InternalGetDIAValue(&IDiaSymbol::get_constType); -} - -DIAResult<DWORD> DIASymbol::getCount() { - return InternalGetDIAValue(&IDiaSymbol::get_count); -} - -DIAResult<DWORD> DIASymbol::getCountLiveRanges() { - return InternalGetDIAValue(&IDiaSymbol::get_countLiveRanges); -} - -DIAResult<BOOL> DIASymbol::hasCustomCallingConvention() { - return InternalGetDIAValue(&IDiaSymbol::get_customCallingConvention); -} - -DIAResult<DataKind> DIASymbol::getDataKind() { - return InternalGetDIAValue<DWORD, DataKind>(&IDiaSymbol::get_dataKind); -} - -DIAResult<BOOL> DIASymbol::isEditAndContinueEnabled() { - return InternalGetDIAValue(&IDiaSymbol::get_editAndContinueEnabled); -} - -DIAResult<BOOL> DIASymbol::hasFarReturn() { - return InternalGetDIAValue(&IDiaSymbol::get_farReturn); -} - -DIAResult<DWORD> DIASymbol::getFrontEndMajor() { - return InternalGetDIAValue(&IDiaSymbol::get_frontEndMajor); -} - -DIAResult<DWORD> DIASymbol::getFrontEndMinor() { - return InternalGetDIAValue(&IDiaSymbol::get_frontEndMinor); -} - -DIAResult<DWORD> DIASymbol::getFrontEndBuild() { - return InternalGetDIAValue(&IDiaSymbol::get_frontEndBuild); -} - -DIAResult<DWORD> DIASymbol::getFrontEndQFE() { - return InternalGetDIAValue(&IDiaSymbol::get_frontEndQFE); -} - -DIAResult<BOOL> DIASymbol::isFunction() { - return InternalGetDIAValue(&IDiaSymbol::get_function); -} - -DIAResult<GUID> DIASymbol::getGuid() { - return InternalGetDIAValue(&IDiaSymbol::get_guid); -} - -DIAResult<BOOL> DIASymbol::hasAlloca() { - return InternalGetDIAValue(&IDiaSymbol::get_hasAlloca); -} - -DIAResult<BOOL> DIASymbol::hasAssignmentOperator() { - return InternalGetDIAValue(&IDiaSymbol::get_hasAssignmentOperator); -} - -DIAResult<BOOL> DIASymbol::hasCastOperator() { - return InternalGetDIAValue(&IDiaSymbol::get_hasCastOperator); -} - -DIAResult<BOOL> DIASymbol::hasDebugInfo() { - return InternalGetDIAValue(&IDiaSymbol::get_hasDebugInfo); -} - -DIAResult<BOOL> DIASymbol::hasEH() { - return InternalGetDIAValue(&IDiaSymbol::get_hasEH); -} - -DIAResult<BOOL> DIASymbol::hasEHa() { - return InternalGetDIAValue(&IDiaSymbol::get_hasEHa); -} - -DIAResult<BOOL> DIASymbol::hasInlAsm() { - return InternalGetDIAValue(&IDiaSymbol::get_hasInlAsm); -} - -DIAResult<BOOL> DIASymbol::hasLongJump() { - return InternalGetDIAValue(&IDiaSymbol::get_hasLongJump); -} - -DIAResult<BOOL> DIASymbol::hasManagedCode() { - return InternalGetDIAValue(&IDiaSymbol::get_hasManagedCode); -} - -DIAResult<BOOL> DIASymbol::hasNestedTypes() { - return InternalGetDIAValue(&IDiaSymbol::get_hasNestedTypes); -} - -DIAResult<BOOL> DIASymbol::hasSecurityChecks() { - return InternalGetDIAValue(&IDiaSymbol::get_hasSecurityChecks); -} - -DIAResult<BOOL> DIASymbol::hasSEH() { - return InternalGetDIAValue(&IDiaSymbol::get_hasSEH); -} - -DIAResult<BOOL> DIASymbol::hasSetJump() { - return InternalGetDIAValue(&IDiaSymbol::get_hasSetJump); -} - -DIAResult<BOOL> DIASymbol::isIndirectVirtualBaseClass() { - return InternalGetDIAValue(&IDiaSymbol::get_indirectVirtualBaseClass); -} - -DIAResult<BOOL> DIASymbol::hasInlineAttribute() { - return InternalGetDIAValue(&IDiaSymbol::get_inlSpec); -} - -DIAResult<BOOL> DIASymbol::hasInterruptReturn() { - return InternalGetDIAValue(&IDiaSymbol::get_interruptReturn); -} - -DIAResult<BOOL> DIASymbol::isBaseVirtualFunction() { - return InternalGetDIAValue(&IDiaSymbol::get_intro); -} - -DIAResult<BOOL> DIASymbol::isIntrinsic() { - return InternalGetDIAValue(&IDiaSymbol::get_intrinsic); -} - -DIAResult<BOOL> DIASymbol::isAcceleratorGroupSharedLocal() { - return InternalGetDIAValue(&IDiaSymbol::get_isAcceleratorGroupSharedLocal); -} - -DIAResult<BOOL> DIASymbol::isAcceleratorPointerTagLiveRange() { - return InternalGetDIAValue(&IDiaSymbol::get_isAcceleratorPointerTagLiveRange); -} - -DIAResult<BOOL> DIASymbol::isAcceleratorStubFunction() { - return InternalGetDIAValue(&IDiaSymbol::get_isAcceleratorStubFunction); -} - -DIAResult<BOOL> DIASymbol::isAggregated() { - return InternalGetDIAValue(&IDiaSymbol::get_isAggregated); -} - -DIAResult<BOOL> DIASymbol::isConstructorVirtualBase() { - return InternalGetDIAValue(&IDiaSymbol::get_isConstructorVirtualBase); -} - -DIAResult<BOOL> DIASymbol::hasStrictGSCheck() { - return InternalGetDIAValue(&IDiaSymbol::get_strictGSCheck); -} - -DIAResult<BOOL> DIASymbol::isLocationControlFlowDependent() { - return InternalGetDIAValue(&IDiaSymbol::get_isLocationControlFlowDependent); -} - -DIAResult<BOOL> DIASymbol::hasCTypes() { - return InternalGetDIAValue(&IDiaSymbol::get_isCTypes); -} - -DIAResult<BOOL> DIASymbol::isCVTCIL() { - return InternalGetDIAValue(&IDiaSymbol::get_isCVTCIL); -} - -DIAResult<BOOL> DIASymbol::isDataAligned() { - return InternalGetDIAValue(&IDiaSymbol::get_isDataAligned); -} - -DIAResult<BOOL> DIASymbol::isHLSLData() { - return InternalGetDIAValue(&IDiaSymbol::get_isHLSLData); -} - -DIAResult<BOOL> DIASymbol::isHotpatchable() { - return InternalGetDIAValue(&IDiaSymbol::get_isHotpatchable); -} - -DIAResult<BOOL> DIASymbol::isLTCG() { - return InternalGetDIAValue(&IDiaSymbol::get_isLTCG); -} - -DIAResult<BOOL> DIASymbol::isMatrixRowMajor() { - return InternalGetDIAValue(&IDiaSymbol::get_isMatrixRowMajor); -} - -DIAResult<BOOL> DIASymbol::isMSILNetmodule() { - return InternalGetDIAValue(&IDiaSymbol::get_isMSILNetmodule); -} - -DIAResult<BOOL> DIASymbol::isMultipleInheritance() { - return InternalGetDIAValue(&IDiaSymbol::get_isMultipleInheritance); -} - -DIAResult<BOOL> DIASymbol::isNaked() { - return InternalGetDIAValue(&IDiaSymbol::get_isNaked); -} - -DIAResult<BOOL> DIASymbol::isOptimizedAway() { - return InternalGetDIAValue(&IDiaSymbol::get_isOptimizedAway); -} - -DIAResult<BOOL> DIASymbol::isPointerBasedOnSymbolValue() { - return InternalGetDIAValue(&IDiaSymbol::get_isPointerBasedOnSymbolValue); -} - -DIAResult<BOOL> DIASymbol::isPointerToDataMember() { - return InternalGetDIAValue(&IDiaSymbol::get_isPointerToDataMember); -} - -DIAResult<BOOL> DIASymbol::isPointerToMemberFunction() { - return InternalGetDIAValue(&IDiaSymbol::get_isPointerToMemberFunction); -} - -DIAResult<BOOL> DIASymbol::isReturnValue() { - return InternalGetDIAValue(&IDiaSymbol::get_isReturnValue); -} - -DIAResult<BOOL> DIASymbol::isSdl() { - return InternalGetDIAValue(&IDiaSymbol::get_isSdl); -} - -DIAResult<BOOL> DIASymbol::isSingleInheritance() { - return InternalGetDIAValue(&IDiaSymbol::get_isSingleInheritance); -} - -DIAResult<BOOL> DIASymbol::isSplitted() { - return InternalGetDIAValue(&IDiaSymbol::get_isSplitted); -} - -DIAResult<BOOL> DIASymbol::isStatic() { - return InternalGetDIAValue(&IDiaSymbol::get_isStatic); -} - -DIAResult<BOOL> DIASymbol::isStripped() { - return InternalGetDIAValue(&IDiaSymbol::get_isStripped); -} - -DIAResult<BOOL> DIASymbol::isVirtualInheritance() { - return InternalGetDIAValue(&IDiaSymbol::get_isVirtualInheritance); -} - -DIAResult<CV_CFL_LANG> DIASymbol::getLanguage() { - return InternalGetDIAValue<DWORD, CV_CFL_LANG>(&IDiaSymbol::get_language); -} - -DIAResult<BOOL> DIASymbol::isSafeBuffers() { - return InternalGetDIAValue(&IDiaSymbol::get_isSafeBuffers); -} - -DIAResult<ULONGLONG> DIASymbol::getLength() { - return InternalGetDIAValue(&IDiaSymbol::get_length); -} - -DIAResult<DWORD> DIASymbol::getLexicalParentId() { - return InternalGetDIAValue(&IDiaSymbol::get_lexicalParentId); -} - -DIAResult<DiaSymbolPtr> DIASymbol::getLexicalParent() { - return InternalGetDIAValue<IDiaSymbol *, DiaSymbolPtr>( - &IDiaSymbol::get_lexicalParent); -} - -DIAResult<DWORD> DIASymbol::getLocalBasePointerRegisterId() { - return InternalGetDIAValue(&IDiaSymbol::get_localBasePointerRegisterId); -} - -DIAResult<DIAString> DIASymbol::getLibraryName() { - return InternalGetDIAStringValue(&IDiaSymbol::get_libraryName); -} - -DIAResult<ULONGLONG> DIASymbol::getLiveRangeLength() { - return InternalGetDIAValue(&IDiaSymbol::get_liveRangeLength); -} - -DIAResult<DWORD> DIASymbol::getLiveRangeStartAddressSection() { - return InternalGetDIAValue(&IDiaSymbol::get_liveRangeStartAddressSection); -} - -DIAResult<DWORD> DIASymbol::getLiveRangeStartAddressOffset() { - return InternalGetDIAValue(&IDiaSymbol::get_liveRangeStartAddressOffset); -} - -DIAResult<DWORD> DIASymbol::getLiveRangeStartRelativeVirtualAddress() { - return InternalGetDIAValue( - &IDiaSymbol::get_liveRangeStartRelativeVirtualAddress); -} - -DIAResult<LocationType> DIASymbol::getLocationType() { - return InternalGetDIAValue<DWORD, LocationType>( - &IDiaSymbol::get_locationType); -} - -DIAResult<DWORD> DIASymbol::getLowerBoundId() { - return InternalGetDIAValue(&IDiaSymbol::get_lowerBoundId); -} - -DIAResult<MachineTypeEnum> DIASymbol::getMachineType() { - return InternalGetDIAValue<DWORD, MachineTypeEnum>( - &IDiaSymbol::get_machineType); -} - -DIAResult<BOOL> DIASymbol::isManagedRef() { - return InternalGetDIAValue(&IDiaSymbol::get_managed); -} - -DIAResult<DWORD> DIASymbol::getMemorySpaceKind() { - return InternalGetDIAValue(&IDiaSymbol::get_memorySpaceKind); -} - -DIAResult<BOOL> DIASymbol::isMsilRef() { - return InternalGetDIAValue(&IDiaSymbol::get_msil); -} - -DIAResult<DIAString> DIASymbol::getName() { - return InternalGetDIAStringValue(&IDiaSymbol::get_name); -} - -DIAResult<BOOL> DIASymbol::isNested() { - return InternalGetDIAValue(&IDiaSymbol::get_nested); -} - -DIAResult<BOOL> DIASymbol::hasNoInlineAttribute() { - return InternalGetDIAValue(&IDiaSymbol::get_noInline); -} - -DIAResult<BOOL> DIASymbol::hasNoReturnAttribute() { - return InternalGetDIAValue(&IDiaSymbol::get_noReturn); -} - -DIAResult<BOOL> DIASymbol::getNoStackOrdering() { - return InternalGetDIAValue(&IDiaSymbol::get_noStackOrdering); -} - -DIAResult<BOOL> DIASymbol::isUnreached() { - return InternalGetDIAValue(&IDiaSymbol::get_notReached); -} - -DIAResult<DWORD> DIASymbol::getNumberOfAcceleratorPointerTags() { - return InternalGetDIAValue(&IDiaSymbol::get_numberOfAcceleratorPointerTags); -} - -DIAResult<DWORD> DIASymbol::getNumberOfModifiers() { - return InternalGetDIAValue(&IDiaSymbol::get_numberOfModifiers); -} - -DIAResult<DWORD> DIASymbol::getNumberOfRegisterIndices() { - return InternalGetDIAValue(&IDiaSymbol::get_numberOfRegisterIndices); -} - -DIAResult<DWORD> DIASymbol::getNumberOfRows() { - return InternalGetDIAValue(&IDiaSymbol::get_numberOfRows); -} - -DIAResult<DWORD> DIASymbol::getNumberOfColumns() { - return InternalGetDIAValue(&IDiaSymbol::get_numberOfColumns); -} - -DIAResult<DIAString> DIASymbol::getObjectFileName() { - return InternalGetDIAStringValue(&IDiaSymbol::get_objectFileName); -} - -DIAResult<DWORD> DIASymbol::getOemSymbolId() { - return InternalGetDIAValue(&IDiaSymbol::get_oemSymbolId); -} - -DIAResult<LONG> DIASymbol::getOffset() { - return InternalGetDIAValue(&IDiaSymbol::get_offset); -} - -DIAResult<DWORD> DIASymbol::getOffsetInUdt() { - return InternalGetDIAValue(&IDiaSymbol::get_offsetInUdt); -} - -DIAResult<BOOL> DIASymbol::hasOptimizedCodeDebugInfo() { - return InternalGetDIAValue(&IDiaSymbol::get_optimizedCodeDebugInfo); -} - -DIAResult<BOOL> DIASymbol::hasOverloadedOperator() { - return InternalGetDIAValue(&IDiaSymbol::get_overloadedOperator); -} - -DIAResult<BOOL> DIASymbol::isPacked() { - return InternalGetDIAValue(&IDiaSymbol::get_packed); -} - -DIAResult<CV_CPU_TYPE_e> DIASymbol::getPlatform() { - return InternalGetDIAValue<DWORD, CV_CPU_TYPE_e>(&IDiaSymbol::get_platform); -} - -DIAResult<BOOL> DIASymbol::isPureVirtual() { - return InternalGetDIAValue(&IDiaSymbol::get_pure); -} - -DIAResult<DWORD> DIASymbol::getRank() { - return InternalGetDIAValue(&IDiaSymbol::get_rank); -} - -DIAResult<BOOL> DIASymbol::isReference() { - return InternalGetDIAValue(&IDiaSymbol::get_reference); -} - -DIAResult<BOOL> DIASymbol::isRValueReference() { - return InternalGetDIAValue(&IDiaSymbol::get_RValueReference); -} - -DIAResult<DWORD> DIASymbol::getRegisterId() { - return InternalGetDIAValue(&IDiaSymbol::get_registerId); -} - -DIAResult<DWORD> DIASymbol::getRegisterType() { - return InternalGetDIAValue(&IDiaSymbol::get_registerType); -} - -DIAResult<DWORD> DIASymbol::getRelativeVirtualAddress() { - return InternalGetDIAValue(&IDiaSymbol::get_relativeVirtualAddress); -} - -DIAResult<BOOL> DIASymbol::isRestrictedType() { - return InternalGetDIAValue(&IDiaSymbol::get_restrictedType); -} - -DIAResult<DWORD> DIASymbol::getSamplerSlot() { - return InternalGetDIAValue(&IDiaSymbol::get_samplerSlot); -} - -DIAResult<BOOL> DIASymbol::isScoped() { - return InternalGetDIAValue(&IDiaSymbol::get_scoped); -} - -DIAResult<BOOL> DIASymbol::isRefUdt() { - return InternalGetDIAValue(&IDiaSymbol::get_isRefUdt); -} - -DIAResult<BOOL> DIASymbol::isValueUdt() { - return InternalGetDIAValue(&IDiaSymbol::get_isValueUdt); -} - -DIAResult<BOOL> DIASymbol::isInterfaceUdt() { - return InternalGetDIAValue(&IDiaSymbol::get_isInterfaceUdt); -} - -DIAResult<BOOL> DIASymbol::isCxxReturnUdt() { - return InternalGetDIAValue(&IDiaSymbol::get_isCxxReturnUdt); -} - -DIAResult<DWORD> DIASymbol::getSignature() { - return InternalGetDIAValue(&IDiaSymbol::get_signature); -} - -DIAResult<DWORD> DIASymbol::getSizeInUdt() { - return InternalGetDIAValue(&IDiaSymbol::get_sizeInUdt); -} - -DIAResult<DWORD> DIASymbol::getSlot() { - return InternalGetDIAValue(&IDiaSymbol::get_slot); -} - -DIAResult<DIAString> DIASymbol::getSourceFileName() { - return InternalGetDIAStringValue(&IDiaSymbol::get_sourceFileName); -} - -DIAResult<DWORD> DIASymbol::getStride() { - return InternalGetDIAValue(&IDiaSymbol::get_stride); -} - -DIAResult<DWORD> DIASymbol::getSubTypeId() { - return InternalGetDIAValue(&IDiaSymbol::get_subTypeId); -} - -DIAResult<DIAString> DIASymbol::getSymbolsFileName() { - return InternalGetDIAStringValue(&IDiaSymbol::get_symbolsFileName); -} - -DIAResult<DWORD> DIASymbol::getSymIndexId() { - return InternalGetDIAValue(&IDiaSymbol::get_symIndexId); -} - -DIAResult<DiaSymTagEnum> DIASymbol::getSymTag() { - return InternalGetDIAValue<DWORD, DiaSymTagEnum>(&IDiaSymbol::get_symTag); -} - -DIAResult<DWORD> DIASymbol::getTargetOffset() { - return InternalGetDIAValue(&IDiaSymbol::get_targetOffset); -} - -DIAResult<DWORD> DIASymbol::getTargetRelativeVirtualAddress() { - return InternalGetDIAValue(&IDiaSymbol::get_targetRelativeVirtualAddress); -} - -DIAResult<DWORD> DIASymbol::getTargetSection() { - return InternalGetDIAValue(&IDiaSymbol::get_targetSection); -} - -DIAResult<ULONGLONG> DIASymbol::getTargetVirtualAddress() { - return InternalGetDIAValue(&IDiaSymbol::get_targetVirtualAddress); -} - -DIAResult<DWORD> DIASymbol::getTextureSlot() { - return InternalGetDIAValue(&IDiaSymbol::get_textureSlot); -} - -DIAResult<LONG> DIASymbol::getThisAdjust() { - return InternalGetDIAValue(&IDiaSymbol::get_thisAdjust); -} - -DIAResult<THUNK_ORDINAL> DIASymbol::getThunkOrdinal() { - return InternalGetDIAValue<DWORD, THUNK_ORDINAL>( - &IDiaSymbol::get_thunkOrdinal); -} - -DIAResult<DWORD> DIASymbol::getTimeStamp() { - return InternalGetDIAValue(&IDiaSymbol::get_timeStamp); -} - -DIAResult<DWORD> DIASymbol::getToken() { - return InternalGetDIAValue(&IDiaSymbol::get_token); -} - -DIAResult<DWORD> DIASymbol::getUavSlot() { - return InternalGetDIAValue(&IDiaSymbol::get_uavSlot); -} - -DIAResult<UdtKind> DIASymbol::getUdtKind() { - return InternalGetDIAValue<DWORD, UdtKind>(&IDiaSymbol::get_udtKind); -} - -DIAResult<BOOL> DIASymbol::isUnalignedType() { - return InternalGetDIAValue(&IDiaSymbol::get_unalignedType); -} - -DIAResult<DIAString> DIASymbol::getUndecoratedName() { - return InternalGetDIAStringValue(&IDiaSymbol::get_undecoratedName); -} - -DIAResult<DWORD> DIASymbol::getUnmodifiedTypeId() { - return InternalGetDIAValue(&IDiaSymbol::get_unmodifiedTypeId); -} - -DIAResult<DWORD> DIASymbol::getUpperBoundId() { - return InternalGetDIAValue(&IDiaSymbol::get_upperBoundId); -} - -DIAResult<BOOL> DIASymbol::isVirtual() { - return InternalGetDIAValue(&IDiaSymbol::get_virtual); -} - -DIAResult<ULONGLONG> DIASymbol::getVirtualAddress() { - return InternalGetDIAValue(&IDiaSymbol::get_virtualAddress); -} - -DIAResult<BOOL> DIASymbol::isVirtualBaseClass() { - return InternalGetDIAValue(&IDiaSymbol::get_virtualBaseClass); -} - -DIAResult<DWORD> DIASymbol::getVirtualBaseDispIndex() { - return InternalGetDIAValue(&IDiaSymbol::get_virtualBaseDispIndex); -} - -DIAResult<DWORD> DIASymbol::getVirtualBaseOffset() { - return InternalGetDIAValue(&IDiaSymbol::get_virtualBaseOffset); -} - -DIAResult<LONG> DIASymbol::getVirtualBasePointerOffset() { - return InternalGetDIAValue(&IDiaSymbol::get_virtualBasePointerOffset); -} - -DIAResult<DWORD> DIASymbol::getVirtualTableShapeId() { - return InternalGetDIAValue(&IDiaSymbol::get_virtualTableShapeId); -} - -DIAResult<BOOL> DIASymbol::isVolatileType() { - return InternalGetDIAValue(&IDiaSymbol::get_volatileType); -} diff --git a/llvm/tools/llvm-pdbdump/DIASymbol.h b/llvm/tools/llvm-pdbdump/DIASymbol.h deleted file mode 100644 index 3e908e1e754..00000000000 --- a/llvm/tools/llvm-pdbdump/DIASymbol.h +++ /dev/null @@ -1,282 +0,0 @@ -//===- DIASymbol.h - Dump debug info from a PDB file ------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// Provides a wrapper around the IDiaSymbol interface. IDiaSymbol is used to -// represent any kind of symbol from functions, to compilands, to source files. -// It provides a monolithic interface of close to 200 operations, and the set -// of operations that are valid depends on the type of the symbol. Since it is -// not clearly documented which set of operations is valid for which type of -// symbol, the best way of figuring it out is to dump every method for every -// symbol, and see which methods return errors. This wrapper provides a clean -// way of doing this without involving needing to embed lots of unsightly -// HRESULT checking at every callsite. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_TOOLS_LLVMPDBDUMP_DIASYMBOL_H -#define LLVM_TOOLS_LLVMPDBDUMP_DIASYMBOL_H - -#include "DIAExtras.h" -#include "llvm/ADT/SmallString.h" - -namespace llvm { -namespace sys { -namespace windows { - -class DIASymbol { -public: - DIASymbol(IDiaSymbol *DiaSymbol); - ~DIASymbol(); - - /// Dumps the value of every property (if it exists) with a default name. - /// This is useful for understanding what symbol types support what methods - /// during development time. - void fullDump(int IndentLevel); - -// TODO: The following methods are present on IDiaSymbol but do not yet have -// wrapper methods. -// -// HRESULT get_value(VARIANT *pRetVal) = 0; -// HRESULT get_undecoratedNameEx(DWORD undecorateOptions, BSTR *name) = 0; -// HRESULT getSrcLineOnTypeDefn(IDiaLineNumber **ppResult) = 0; -// HRESULT get_dataBytes(DWORD cbData, DWORD *pcbData, BYTE *pbData) = 0; -// HRESULT get_types(DWORD cTypes, DWORD *pcTypes, IDiaSymbol **pTypes) = 0; -// HRESULT get_typeIds(DWORD cTypeIds, DWORD *pcTypeIds, DWORD *pdwTypeIds) = 0; -// HRESULT get_numericProperties(DWORD cnt, DWORD *pcnt, -// DWORD *pProperties) = 0; -// HRESULT get_modifierValues(DWORD cnt, DWORD *pcnt, WORD *pModifiers) = 0; -// HRESULT get_acceleratorPointerTags(DWORD cnt, DWORD *pcnt, DWORD -// *pPointerTags) = 0; -// HRESULT get_hfaFloat(BOOL *pRetVal) = 0; -// HRESULT get_hfaDouble(BOOL *pRetVal) = 0; -// HRESULT get_paramBasePointerRegisterId(DWORD *pRetVal) = 0; -// HRESULT get_isWinRTPointer(BOOL *pRetVal) = 0; - -#if (_MSC_FULL_VER >= 180031101) - // These methods are only available on VS 2013 SP 4 and higher. - DIAResult<BOOL> isPGO(); - DIAResult<BOOL> hasValidPGOCounts(); - DIAResult<BOOL> isOptimizedForSpeed(); - DIAResult<DWORD> getPGOEntryCount(); - DIAResult<DWORD> getPGOEdgeCount(); - DIAResult<ULONGLONG> getPGODynamicInstructionCount(); - DIAResult<DWORD> getStaticSize(); - DIAResult<DWORD> getFinalLiveStaticSize(); - DIAResult<DIAString> getPhaseName(); - DIAResult<BOOL> hasControlFlowCheck(); -#endif - - DIAResult<DiaSymbolPtr> getLexicalParent(); - DIAResult<DiaSymbolPtr> getClassParent(); - DIAResult<DiaSymbolPtr> getType(); - DIAResult<DiaSymbolPtr> getArrayIndexType(); - DIAResult<DiaSymbolPtr> getVirtualTableShape(); - DIAResult<DiaSymbolPtr> getLowerBound(); - DIAResult<DiaSymbolPtr> getUpperBound(); - DIAResult<DiaSymbolPtr> getObjectPointerType(); - DIAResult<DiaSymbolPtr> getContainer(); - DIAResult<DiaSymbolPtr> getVirtualBaseTableType(); - DIAResult<DiaSymbolPtr> getUnmodifiedType(); - DIAResult<DiaSymbolPtr> getSubType(); - DIAResult<DiaSymbolPtr> getBaseSymbol(); - - DIAResult<DWORD> getAccess(); - DIAResult<DWORD> getAddressOffset(); - DIAResult<DWORD> getAddressSection(); - DIAResult<DWORD> getAge(); - DIAResult<DWORD> getArrayIndexTypeId(); - DIAResult<DWORD> getBackEndBuild(); - DIAResult<DWORD> getBackEndMajor(); - DIAResult<DWORD> getBackEndMinor(); - DIAResult<DWORD> getBackEndQFE(); - DIAResult<DWORD> getBaseDataOffset(); - DIAResult<DWORD> getBaseDataSlot(); - DIAResult<DWORD> getBaseSymbolId(); - DIAResult<DWORD> getBaseType(); - DIAResult<DWORD> getBitPosition(); - DIAResult<DWORD> getBuiltInKind(); - DIAResult<CV_call_e> getCallingConvention(); - DIAResult<DWORD> getClassParentId(); - DIAResult<DIAString> getCompilerName(); - DIAResult<DWORD> getCount(); - DIAResult<DWORD> getCountLiveRanges(); - DIAResult<DWORD> getFrontEndBuild(); - DIAResult<DWORD> getFrontEndMajor(); - DIAResult<DWORD> getFrontEndMinor(); - DIAResult<DWORD> getFrontEndQFE(); - DIAResult<CV_CFL_LANG> getLanguage(); - DIAResult<DWORD> getLexicalParentId(); - DIAResult<DIAString> getLibraryName(); - DIAResult<DWORD> getLiveRangeStartAddressOffset(); - DIAResult<DWORD> getLiveRangeStartAddressSection(); - DIAResult<DWORD> getLiveRangeStartRelativeVirtualAddress(); - DIAResult<DWORD> getLocalBasePointerRegisterId(); - DIAResult<DWORD> getLowerBoundId(); - DIAResult<DWORD> getMemorySpaceKind(); - DIAResult<DIAString> getName(); - DIAResult<DWORD> getNumberOfAcceleratorPointerTags(); - DIAResult<DWORD> getNumberOfColumns(); - DIAResult<DWORD> getNumberOfModifiers(); - DIAResult<DWORD> getNumberOfRegisterIndices(); - DIAResult<DWORD> getNumberOfRows(); - DIAResult<DIAString> getObjectFileName(); - DIAResult<DWORD> getOemSymbolId(); - DIAResult<DWORD> getOffsetInUdt(); - DIAResult<CV_CPU_TYPE_e> getPlatform(); - DIAResult<DWORD> getRank(); - DIAResult<DWORD> getRegisterId(); - DIAResult<DWORD> getRegisterType(); - DIAResult<DWORD> getRelativeVirtualAddress(); - DIAResult<DWORD> getSamplerSlot(); - DIAResult<DWORD> getSignature(); - DIAResult<DWORD> getSizeInUdt(); - DIAResult<DWORD> getSlot(); - DIAResult<DIAString> getSourceFileName(); - DIAResult<DWORD> getStride(); - DIAResult<DWORD> getSubTypeId(); - DIAResult<DIAString> getSymbolsFileName(); - DIAResult<DWORD> getSymIndexId(); - DIAResult<DWORD> getTargetOffset(); - DIAResult<DWORD> getTargetRelativeVirtualAddress(); - DIAResult<DWORD> getTargetSection(); - DIAResult<DWORD> getTextureSlot(); - DIAResult<DWORD> getTimeStamp(); - DIAResult<DWORD> getToken(); - DIAResult<DWORD> getUavSlot(); - DIAResult<DIAString> getUndecoratedName(); - DIAResult<DWORD> getUnmodifiedTypeId(); - DIAResult<DWORD> getUpperBoundId(); - DIAResult<DWORD> getVirtualBaseDispIndex(); - DIAResult<DWORD> getVirtualBaseOffset(); - DIAResult<DWORD> getVirtualTableShapeId(); - DIAResult<DataKind> getDataKind(); - DIAResult<DiaSymTagEnum> getSymTag(); - DIAResult<GUID> getGuid(); - DIAResult<LONG> getOffset(); - DIAResult<LONG> getThisAdjust(); - DIAResult<LONG> getVirtualBasePointerOffset(); - DIAResult<LocationType> getLocationType(); - DIAResult<MachineTypeEnum> getMachineType(); - DIAResult<THUNK_ORDINAL> getThunkOrdinal(); - DIAResult<ULONGLONG> getLength(); - DIAResult<ULONGLONG> getLiveRangeLength(); - DIAResult<ULONGLONG> getTargetVirtualAddress(); - DIAResult<ULONGLONG> getVirtualAddress(); - DIAResult<UdtKind> getUdtKind(); - DIAResult<BOOL> hasConstructor(); - DIAResult<BOOL> hasCustomCallingConvention(); - DIAResult<BOOL> hasFarReturn(); - DIAResult<BOOL> isCode(); - DIAResult<BOOL> isCompilerGenerated(); - DIAResult<BOOL> isConstType(); - DIAResult<BOOL> isEditAndContinueEnabled(); - DIAResult<BOOL> isFunction(); - DIAResult<BOOL> getAddressTaken(); - DIAResult<BOOL> getNoStackOrdering(); - DIAResult<BOOL> hasAlloca(); - DIAResult<BOOL> hasAssignmentOperator(); - DIAResult<BOOL> hasCTypes(); - DIAResult<BOOL> hasCastOperator(); - DIAResult<BOOL> hasDebugInfo(); - DIAResult<BOOL> hasEH(); - DIAResult<BOOL> hasEHa(); - DIAResult<BOOL> hasInlAsm(); - DIAResult<BOOL> hasInlineAttribute(); - DIAResult<BOOL> hasInterruptReturn(); - DIAResult<BOOL> hasLongJump(); - DIAResult<BOOL> hasManagedCode(); - DIAResult<BOOL> hasNestedTypes(); - DIAResult<BOOL> hasNoInlineAttribute(); - DIAResult<BOOL> hasNoReturnAttribute(); - DIAResult<BOOL> hasOptimizedCodeDebugInfo(); - DIAResult<BOOL> hasOverloadedOperator(); - DIAResult<BOOL> hasSEH(); - DIAResult<BOOL> hasSecurityChecks(); - DIAResult<BOOL> hasSetJump(); - DIAResult<BOOL> hasStrictGSCheck(); - DIAResult<BOOL> isAcceleratorGroupSharedLocal(); - DIAResult<BOOL> isAcceleratorPointerTagLiveRange(); - DIAResult<BOOL> isAcceleratorStubFunction(); - DIAResult<BOOL> isAggregated(); - DIAResult<BOOL> isBaseVirtualFunction(); - DIAResult<BOOL> isCVTCIL(); - DIAResult<BOOL> isConstructorVirtualBase(); - DIAResult<BOOL> isCxxReturnUdt(); - DIAResult<BOOL> isDataAligned(); - DIAResult<BOOL> isHLSLData(); - DIAResult<BOOL> isHotpatchable(); - DIAResult<BOOL> isIndirectVirtualBaseClass(); - DIAResult<BOOL> isInterfaceUdt(); - DIAResult<BOOL> isIntrinsic(); - DIAResult<BOOL> isLTCG(); - DIAResult<BOOL> isLocationControlFlowDependent(); - DIAResult<BOOL> isMSILNetmodule(); - DIAResult<BOOL> isManagedRef(); - DIAResult<BOOL> isMatrixRowMajor(); - DIAResult<BOOL> isMsilRef(); - DIAResult<BOOL> isMultipleInheritance(); - DIAResult<BOOL> isNaked(); - DIAResult<BOOL> isNested(); - DIAResult<BOOL> isOptimizedAway(); - DIAResult<BOOL> isPacked(); - DIAResult<BOOL> isPointerBasedOnSymbolValue(); - DIAResult<BOOL> isPointerToDataMember(); - DIAResult<BOOL> isPointerToMemberFunction(); - DIAResult<BOOL> isPureVirtual(); - DIAResult<BOOL> isRValueReference(); - DIAResult<BOOL> isRefUdt(); - DIAResult<BOOL> isReference(); - DIAResult<BOOL> isRestrictedType(); - DIAResult<BOOL> isReturnValue(); - DIAResult<BOOL> isSafeBuffers(); - DIAResult<BOOL> isScoped(); - DIAResult<BOOL> isSdl(); - DIAResult<BOOL> isSingleInheritance(); - DIAResult<BOOL> isSplitted(); - DIAResult<BOOL> isStatic(); - DIAResult<BOOL> isStripped(); - DIAResult<BOOL> isUnalignedType(); - DIAResult<BOOL> isUnreached(); - DIAResult<BOOL> isValueUdt(); - DIAResult<BOOL> isVirtual(); - DIAResult<BOOL> isVirtualBaseClass(); - DIAResult<BOOL> isVirtualInheritance(); - DIAResult<BOOL> isVolatileType(); - -private: - template <class T, class U = T> - DIAResult<U> - InternalGetDIAValue(HRESULT (__stdcall IDiaSymbol::*Method)(T *)) { - T Value; - if (S_OK == (Symbol->*Method)(&Value)) - return DIAResult<U>(U(Value)); - else - return DIAResult<U>(); - } - - DIAResult<DIAString> - InternalGetDIAStringValue(HRESULT (__stdcall IDiaSymbol::*Method)(BSTR *)) { - BSTR String16; - if (S_OK == (Symbol->*Method)(&String16)) { - std::string String8; - llvm::sys::windows::BSTRToUTF8(String16, String8); - SysFreeString(String16); - return DIAResult<DIAString>(DIAString(String8)); - } else - return DIAResult<DIAString>(); - } - - IDiaSymbol *Symbol; -}; - -} // namespace windows -} // namespace sys -} // namespace llvm - -#endif diff --git a/llvm/tools/llvm-pdbdump/LLVMBuild.txt b/llvm/tools/llvm-pdbdump/LLVMBuild.txt index 29d40debd6b..487768935dd 100644 --- a/llvm/tools/llvm-pdbdump/LLVMBuild.txt +++ b/llvm/tools/llvm-pdbdump/LLVMBuild.txt @@ -19,5 +19,5 @@ type = Tool name = llvm-pdbdump parent = Tools -required_libraries = +required_libraries = DebugInfoPDB diff --git a/llvm/tools/llvm-pdbdump/Makefile b/llvm/tools/llvm-pdbdump/Makefile new file mode 100644 index 00000000000..18aafc4076f --- /dev/null +++ b/llvm/tools/llvm-pdbdump/Makefile @@ -0,0 +1,17 @@ +##===- tools/llvm-pdbdump/Makefile -------------------------*- Makefile -*-===## +# +# The LLVM Compiler Infrastructure +# +# This file is distributed under the University of Illinois Open Source +# License. See LICENSE.TXT for details. +# +##===----------------------------------------------------------------------===## + +LEVEL := ../.. +TOOLNAME := llvm-pdbdump +LINK_COMPONENTS := DebugInfoPDB Object + +# This tool has no plugins, optimize startup time. +TOOL_NO_EXPORTS := 1 + +include $(LEVEL)/Makefile.common diff --git a/llvm/tools/llvm-pdbdump/llvm-pdbdump.cpp b/llvm/tools/llvm-pdbdump/llvm-pdbdump.cpp index 2c5109888bc..e2db7f6daf9 100644 --- a/llvm/tools/llvm-pdbdump/llvm-pdbdump.cpp +++ b/llvm/tools/llvm-pdbdump/llvm-pdbdump.cpp @@ -15,6 +15,12 @@ #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/StringExtras.h" +#include "llvm/DebugInfo/PDB/PDB.h" +#include "llvm/DebugInfo/PDB/IPDBEnumChildren.h" +#include "llvm/DebugInfo/PDB/IPDBSession.h" +#include "llvm/DebugInfo/PDB/IPDBRawSymbol.h" +#include "llvm/DebugInfo/PDB/PDBSymbolExe.h" +#include "llvm/DebugInfo/PDB/PDBSymbolCompiland.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/ConvertUTF.h" #include "llvm/Support/Format.h" @@ -24,335 +30,46 @@ #include "llvm/Support/PrettyStackTrace.h" #include "llvm/Support/Signals.h" -#include "llvm-pdbdump.h" -#include "COMExtras.h" -#include "DIAExtras.h" -#include "DIASymbol.h" +#include <Windows.h> using namespace llvm; -using namespace llvm::sys::windows; namespace opts { cl::list<std::string> InputFilenames(cl::Positional, cl::desc("<input PDB files>"), cl::OneOrMore); -cl::opt<bool> Streams("streams", cl::desc("Display data stream information")); -cl::alias StreamsShort("x", cl::desc("Alias for --streams"), - cl::aliasopt(Streams)); - -cl::opt<bool> StreamData("stream-data", - cl::desc("Dumps stream record data as bytes")); -cl::alias StreamDataShort("X", cl::desc("Alias for --stream-data"), - cl::aliasopt(StreamData)); - -cl::opt<bool> Tables("tables", - cl::desc("Display summary information for all of the " - "debug tables in the input file")); -cl::alias TablesShort("t", cl::desc("Alias for --tables"), - cl::aliasopt(Tables)); - -cl::opt<bool> SourceFiles("source-files", - cl::desc("Display a list of the source files " - "contained in the PDB")); -cl::alias SourceFilesShort("f", cl::desc("Alias for --source-files"), - cl::aliasopt(SourceFiles)); - cl::opt<bool> Compilands("compilands", cl::desc("Display a list of compilands (e.g. object " - "files) and their source file composition")); + "files) and symbols for each one.")); cl::alias CompilandsShort("c", cl::desc("Alias for --compilands"), cl::aliasopt(Compilands)); - -cl::opt<bool> Symbols("symbols", cl::desc("Display symbols")); -cl::alias SymbolsShort("s", cl::desc("Alias for --symbols"), - cl::aliasopt(Symbols)); - -cl::opt<bool> SymbolDetails("symbol-details", - cl::desc("Display symbol details")); -cl::alias SymbolDetailsShort("S", cl::desc("Alias for --symbol-details"), - cl::aliasopt(SymbolDetails)); -} - -template <typename TableType> -static HRESULT getDIATable(IDiaSession *Session, TableType **Table) { - CComPtr<IDiaEnumTables> EnumTables = nullptr; - HRESULT Error = S_OK; - if (FAILED(Error = Session->getEnumTables(&EnumTables))) - return Error; - - for (auto CurTable : make_com_enumerator(EnumTables)) { - TableType *ResultTable = nullptr; - if (FAILED(CurTable->QueryInterface( - __uuidof(TableType), reinterpret_cast<void **>(&ResultTable)))) - continue; - - *Table = ResultTable; - return S_OK; - } - return E_FAIL; -} - -static void dumpBasicFileInfo(StringRef Path, IDiaSession *Session) { - CComPtr<IDiaSymbol> GlobalScope; - HRESULT hr = Session->get_globalScope(&GlobalScope); - DIASymbol GlobalScopeSymbol(GlobalScope); - if (S_OK == hr) - GlobalScopeSymbol.getSymbolsFileName().dump("File", 0); - else - outs() << "File: " << Path << "\n"; - HANDLE FileHandle = ::CreateFile( - Path.data(), GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, nullptr, - OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr); - LARGE_INTEGER FileSize; - if (INVALID_HANDLE_VALUE != FileHandle) { - outs().indent(2); - if (::GetFileSizeEx(FileHandle, &FileSize)) - outs() << "Size: " << FileSize.QuadPart << " bytes\n"; - else - outs() << "Size: (Unable to obtain file size)\n"; - FILETIME ModifiedTime; - outs().indent(2); - if (::GetFileTime(FileHandle, nullptr, nullptr, &ModifiedTime)) { - ULARGE_INTEGER TimeInteger; - TimeInteger.LowPart = ModifiedTime.dwLowDateTime; - TimeInteger.HighPart = ModifiedTime.dwHighDateTime; - llvm::sys::TimeValue Time; - Time.fromWin32Time(TimeInteger.QuadPart); - outs() << "Timestamp: " << Time.str() << "\n"; - } else { - outs() << "Timestamp: (Unable to obtain time stamp)\n"; - } - ::CloseHandle(FileHandle); - } - - if (S_OK == hr) - GlobalScopeSymbol.fullDump(2); - outs() << "\n"; - outs().flush(); } -static void dumpDataStreams(IDiaSession *Session) { - CComPtr<IDiaEnumDebugStreams> DebugStreams = nullptr; - if (FAILED(Session->getEnumDebugStreams(&DebugStreams))) - return; - - LONG Count = 0; - if (FAILED(DebugStreams->get_Count(&Count))) +static void dumpInput(StringRef Path) { + std::unique_ptr<IPDBSession> Session( + llvm::createPDBReader(PDB_ReaderType::DIA, Path)); + if (!Session) { + outs() << "Unable to create PDB reader. Check that a valid implementation"; + outs() << " is available for your platform."; return; - outs() << "Data Streams [count=" << Count << "]\n"; - - std::string Name8; - - for (auto Stream : make_com_enumerator(DebugStreams)) { - BSTR Name16; - if (FAILED(Stream->get_name(&Name16))) - continue; - if (BSTRToUTF8(Name16, Name8)) - outs() << " " << Name8; - ::SysFreeString(Name16); - if (FAILED(Stream->get_Count(&Count))) { - outs() << "\n"; - continue; - } - - outs() << " [" << Count << " records]\n"; - if (opts::StreamData) { - int RecordIndex = 0; - for (auto StreamRecord : make_com_data_record_enumerator(Stream)) { - outs() << " Record " << RecordIndex << " [" << StreamRecord.size() - << " bytes]"; - for (uint8_t byte : StreamRecord) { - outs() << " " << llvm::format_hex_no_prefix(byte, 2, true); - } - outs() << "\n"; - ++RecordIndex; - } - } } - outs() << "\n"; - outs().flush(); -} - -static void dumpDebugTables(IDiaSession *Session) { - CComPtr<IDiaEnumTables> EnumTables = nullptr; - if (SUCCEEDED(Session->getEnumTables(&EnumTables))) { - LONG Count = 0; - if (FAILED(EnumTables->get_Count(&Count))) - return; - - outs() << "Debug Tables [count=" << Count << "]\n"; - std::string Name8; - for (auto Table : make_com_enumerator(EnumTables)) { - BSTR Name16; - if (FAILED(Table->get_name(&Name16))) - continue; - if (BSTRToUTF8(Name16, Name8)) - outs() << " " << Name8; - ::SysFreeString(Name16); - if (SUCCEEDED(Table->get_Count(&Count))) { - outs() << " [" << Count << " items]\n"; - } else - outs() << "\n"; - } - } - outs() << "\n"; - outs().flush(); -} - -static void dumpSourceFiles(IDiaSession *Session) { - CComPtr<IDiaEnumSourceFiles> EnumSourceFileList; - if (FAILED(getDIATable(Session, &EnumSourceFileList))) - return; - - LONG SourceFileCount = 0; - EnumSourceFileList->get_Count(&SourceFileCount); - - outs() << "Dumping source files [" << SourceFileCount << " files]\n"; - for (auto SourceFile : make_com_enumerator(EnumSourceFileList)) { - CComBSTR SourceFileName; - if (S_OK != SourceFile->get_fileName(&SourceFileName)) - continue; - outs().indent(2); - std::string SourceFileName8; - BSTRToUTF8(SourceFileName, SourceFileName8); - outs() << SourceFileName8 << "\n"; - } - outs() << "\n"; + auto GlobalScope(Session->getGlobalScope()); + GlobalScope->dump(outs(), 0, PDB_DumpLevel::Normal); outs().flush(); -} - -static void dumpCompilands(IDiaSession *Session) { - CComPtr<IDiaEnumSourceFiles> EnumSourceFileList; - if (FAILED(getDIATable(Session, &EnumSourceFileList))) - return; - - LONG SourceFileCount = 0; - EnumSourceFileList->get_Count(&SourceFileCount); - - CComPtr<IDiaSymbol> GlobalScope; - HRESULT hr = Session->get_globalScope(&GlobalScope); - DIASymbol GlobalScopeSymbol(GlobalScope); - if (S_OK != hr) - return; - - CComPtr<IDiaEnumSymbols> EnumCompilands; - if (S_OK != - GlobalScope->findChildren(SymTagCompiland, nullptr, nsNone, - &EnumCompilands)) - return; - - LONG CompilandCount = 0; - EnumCompilands->get_Count(&CompilandCount); - outs() << "Dumping compilands [" << CompilandCount - << " compilands containing " << SourceFileCount << " source files]\n"; - - for (auto Compiland : make_com_enumerator(EnumCompilands)) { - DIASymbol CompilandSymbol(Compiland); - outs().indent(2); - outs() << CompilandSymbol.getName().value() << "\n"; - CComPtr<IDiaEnumSourceFiles> EnumFiles; - if (S_OK != Session->findFile(Compiland, nullptr, nsNone, &EnumFiles)) - continue; - - for (auto SourceFile : make_com_enumerator(EnumFiles)) { - DWORD ChecksumType = 0; - DWORD ChecksumSize = 0; - std::vector<uint8_t> Checksum; - outs().indent(4); - SourceFile->get_checksumType(&ChecksumType); - if (S_OK == SourceFile->get_checksum(0, &ChecksumSize, nullptr)) { - Checksum.resize(ChecksumSize); - if (S_OK == - SourceFile->get_checksum(ChecksumSize, &ChecksumSize, - &Checksum[0])) { - outs() << "[" << ((ChecksumType == HashMD5) ? "MD5 " : "SHA-1") - << ": "; - for (auto byte : Checksum) - outs() << format_hex_no_prefix(byte, 2, true); - outs() << "] "; - } + if (opts::Compilands) { + auto Compilands = GlobalScope->findChildren(PDB_SymType::Compiland); + if (Compilands) { + while (auto Compiland = Compilands->getNext()) { + Compiland->dump(outs(), 0, PDB_DumpLevel::Normal); } - CComBSTR SourceFileName; - if (S_OK != SourceFile->get_fileName(&SourceFileName)) - continue; - - std::string SourceFileName8; - BSTRToUTF8(SourceFileName, SourceFileName8); - outs() << SourceFileName8 << "\n"; } } - - outs() << "\n"; outs().flush(); } -static void dumpSymbols(IDiaSession *Session) { - CComPtr<IDiaEnumSymbols> EnumSymbols; - if (FAILED(getDIATable(Session, &EnumSymbols))) - return; - - LONG SymbolCount = 0; - EnumSymbols->get_Count(&SymbolCount); - - outs() << "Dumping symbols [" << SymbolCount << " symbols]\n"; - int UnnamedSymbolCount = 0; - for (auto Symbol : make_com_enumerator(EnumSymbols)) { - DIASymbol SymbolSymbol(Symbol); - DIAResult<DIAString> SymbolName = SymbolSymbol.getName(); - if (!SymbolName.hasValue() || SymbolName.value().empty()) { - ++UnnamedSymbolCount; - outs() << " (Unnamed symbol)\n"; - } else { - outs() << " " << SymbolSymbol.getName().value() << "\n"; - } - if (opts::SymbolDetails) - SymbolSymbol.fullDump(4); - } - outs() << "(Found " << UnnamedSymbolCount << " unnamed symbols)\n"; - outs().flush(); -} - -static void dumpInput(StringRef Path) { - SmallVector<UTF16, 128> Path16String; - llvm::convertUTF8ToUTF16String(Path, Path16String); - wchar_t *Path16 = reinterpret_cast<wchar_t *>(Path16String.data()); - CComPtr<IDiaDataSource> source; - HRESULT hr = - ::CoCreateInstance(CLSID_DiaSource, nullptr, CLSCTX_INPROC_SERVER, - __uuidof(IDiaDataSource), (void **)&source); - if (FAILED(hr)) - return; - if (FAILED(source->loadDataFromPdb(Path16))) - return; - CComPtr<IDiaSession> Session; - if (FAILED(source->openSession(&Session))) - return; - - dumpBasicFileInfo(Path, Session); - if (opts::Streams || opts::StreamData) { - dumpDataStreams(Session); - } - - if (opts::Tables) { - dumpDebugTables(Session); - } - - if (opts::SourceFiles) { - dumpSourceFiles(Session); - } - - if (opts::Compilands) { - dumpCompilands(Session); - } - - if (opts::Symbols || opts::SymbolDetails) { - dumpSymbols(Session); - } -} - int main(int argc_, const char *argv_[]) { // Print a stack trace if we signal out. sys::PrintStackTraceOnErrorSignal(); diff --git a/llvm/tools/llvm-pdbdump/llvm-pdbdump.h b/llvm/tools/llvm-pdbdump/llvm-pdbdump.h deleted file mode 100644 index e73289cc00d..00000000000 --- a/llvm/tools/llvm-pdbdump/llvm-pdbdump.h +++ /dev/null @@ -1,32 +0,0 @@ -//===- llvm-pdbdump.h - Common includes for llvm-pdbdump --------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// Common defines and header includes for all llvm-pdbdump. The definitions -// here configure the necessary #defines and include system headers in the -// proper order for using DIA. -//===----------------------------------------------------------------------===// - -#ifndef LLVM_TOOLS_LLVMPDBDUMP_LLVMPDBDUMP_H -#define LLVM_TOOLS_LLVMPDBDUMP_LLVMPDBDUMP_H - -#define NTDDI_VERSION NTDDI_VISTA -#define _WIN32_WINNT _WIN32_WINNT_VISTA -#define WINVER _WIN32_WINNT_VISTA -#ifndef NOMINMAX -#define NOMINMAX -#endif - -// atlbase.h has to come before windows.h -#include <atlbase.h> -#include <windows.h> - -// DIA headers must come after windows headers. -#include <cvconst.h> -#include <dia2.h> - -#endif
\ No newline at end of file |