forked from OSchip/llvm-project
[DebugInfoPDB] Add DIA implementation for getSrcLineOnTypeDefn
Summary: This helps to determine the line number for a PDB type with definition Reviewers: zturner, llvm-commits, rnk Reviewed By: zturner Subscribers: rengolin, JDevlieghere Differential Revision: https://reviews.llvm.org/D44119 llvm-svn: 326857
This commit is contained in:
parent
6a58efdf76
commit
25409ddf2a
|
@ -103,6 +103,7 @@ public:
|
||||||
uint32_t getSizeInUdt() const override;
|
uint32_t getSizeInUdt() const override;
|
||||||
uint32_t getSlot() const override;
|
uint32_t getSlot() const override;
|
||||||
std::string getSourceFileName() const override;
|
std::string getSourceFileName() const override;
|
||||||
|
std::unique_ptr<IPDBLineNumber> getSrcLineOnTypeDefn() const override;
|
||||||
uint32_t getStride() const override;
|
uint32_t getStride() const override;
|
||||||
uint32_t getSubTypeId() const override;
|
uint32_t getSubTypeId() const override;
|
||||||
std::string getSymbolsFileName() const override;
|
std::string getSymbolsFileName() const override;
|
||||||
|
|
|
@ -115,6 +115,8 @@ public:
|
||||||
virtual uint32_t getSizeInUdt() const = 0;
|
virtual uint32_t getSizeInUdt() const = 0;
|
||||||
virtual uint32_t getSlot() const = 0;
|
virtual uint32_t getSlot() const = 0;
|
||||||
virtual std::string getSourceFileName() const = 0;
|
virtual std::string getSourceFileName() const = 0;
|
||||||
|
virtual std::unique_ptr<IPDBLineNumber>
|
||||||
|
getSrcLineOnTypeDefn() const = 0;
|
||||||
virtual uint32_t getStride() const = 0;
|
virtual uint32_t getStride() const = 0;
|
||||||
virtual uint32_t getSubTypeId() const = 0;
|
virtual uint32_t getSubTypeId() const = 0;
|
||||||
virtual std::string getSymbolsFileName() const = 0;
|
virtual std::string getSymbolsFileName() const = 0;
|
||||||
|
|
|
@ -108,6 +108,7 @@ public:
|
||||||
uint32_t getSizeInUdt() const override;
|
uint32_t getSizeInUdt() const override;
|
||||||
uint32_t getSlot() const override;
|
uint32_t getSlot() const override;
|
||||||
std::string getSourceFileName() const override;
|
std::string getSourceFileName() const override;
|
||||||
|
std::unique_ptr<IPDBLineNumber> getSrcLineOnTypeDefn() const override;
|
||||||
uint32_t getStride() const override;
|
uint32_t getStride() const override;
|
||||||
uint32_t getSubTypeId() const override;
|
uint32_t getSubTypeId() const override;
|
||||||
std::string getSymbolsFileName() const override;
|
std::string getSymbolsFileName() const override;
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
#include "llvm/DebugInfo/CodeView/Formatters.h"
|
#include "llvm/DebugInfo/CodeView/Formatters.h"
|
||||||
#include "llvm/DebugInfo/PDB/DIA/DIAEnumLineNumbers.h"
|
#include "llvm/DebugInfo/PDB/DIA/DIAEnumLineNumbers.h"
|
||||||
#include "llvm/DebugInfo/PDB/DIA/DIAEnumSymbols.h"
|
#include "llvm/DebugInfo/PDB/DIA/DIAEnumSymbols.h"
|
||||||
|
#include "llvm/DebugInfo/PDB/DIA/DIALineNumber.h"
|
||||||
#include "llvm/DebugInfo/PDB/DIA/DIASession.h"
|
#include "llvm/DebugInfo/PDB/DIA/DIASession.h"
|
||||||
#include "llvm/DebugInfo/PDB/PDBExtras.h"
|
#include "llvm/DebugInfo/PDB/PDBExtras.h"
|
||||||
#include "llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h"
|
#include "llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h"
|
||||||
|
@ -748,6 +749,15 @@ std::string DIARawSymbol::getSourceFileName() const {
|
||||||
return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_sourceFileName);
|
return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_sourceFileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unique_ptr<IPDBLineNumber>
|
||||||
|
DIARawSymbol::getSrcLineOnTypeDefn() const {
|
||||||
|
CComPtr<IDiaLineNumber> LineNumber;
|
||||||
|
if (FAILED(Symbol->getSrcLineOnTypeDefn(&LineNumber)) || !LineNumber)
|
||||||
|
return nullptr;
|
||||||
|
|
||||||
|
return llvm::make_unique<DIALineNumber>(LineNumber);
|
||||||
|
}
|
||||||
|
|
||||||
uint32_t DIARawSymbol::getStride() const {
|
uint32_t DIARawSymbol::getStride() const {
|
||||||
return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_stride);
|
return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_stride);
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
#include "llvm/DebugInfo/PDB/IPDBLineNumber.h"
|
||||||
#include "llvm/DebugInfo/PDB/Native/NativeRawSymbol.h"
|
#include "llvm/DebugInfo/PDB/Native/NativeRawSymbol.h"
|
||||||
#include "llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h"
|
#include "llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h"
|
||||||
|
|
||||||
|
@ -278,6 +279,11 @@ std::string NativeRawSymbol::getSourceFileName() const {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unique_ptr<IPDBLineNumber>
|
||||||
|
NativeRawSymbol::getSrcLineOnTypeDefn() const {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
uint32_t NativeRawSymbol::getStride() const {
|
uint32_t NativeRawSymbol::getStride() const {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
|
|
||||||
#include "llvm/ADT/STLExtras.h"
|
#include "llvm/ADT/STLExtras.h"
|
||||||
#include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"
|
#include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"
|
||||||
|
#include "llvm/DebugInfo/PDB/IPDBLineNumber.h"
|
||||||
#include "llvm/DebugInfo/PDB/IPDBRawSymbol.h"
|
#include "llvm/DebugInfo/PDB/IPDBRawSymbol.h"
|
||||||
#include "llvm/DebugInfo/PDB/IPDBSession.h"
|
#include "llvm/DebugInfo/PDB/IPDBSession.h"
|
||||||
#include "llvm/DebugInfo/PDB/IPDBSourceFile.h"
|
#include "llvm/DebugInfo/PDB/IPDBSourceFile.h"
|
||||||
|
@ -195,6 +196,10 @@ public:
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unique_ptr<IPDBLineNumber> getSrcLineOnTypeDefn() const override {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
MOCK_SYMBOL_ACCESSOR(getAccess)
|
MOCK_SYMBOL_ACCESSOR(getAccess)
|
||||||
MOCK_SYMBOL_ACCESSOR(getAddressOffset)
|
MOCK_SYMBOL_ACCESSOR(getAddressOffset)
|
||||||
MOCK_SYMBOL_ACCESSOR(getAddressSection)
|
MOCK_SYMBOL_ACCESSOR(getAddressSection)
|
||||||
|
|
Loading…
Reference in New Issue