forked from OSchip/llvm-project
Revert "[PDB] Extend IPDBSession's interface to retrieve frame data"
This reverts commit b5c7e2f9a4dbb34e3667c4bb4972735eadd3247a. llvm-svn: 344909
This commit is contained in:
parent
21d8aef0de
commit
738df2de7f
|
@ -1,40 +0,0 @@
|
|||
//==- DIAEnumFrameData.h --------------------------------------- -*- C++ -*-==//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef LLVM_DEBUGINFO_PDB_DIA_DIAENUMFRAMEDATA_H
|
||||
#define LLVM_DEBUGINFO_PDB_DIA_DIAENUMFRAMEDATA_H
|
||||
|
||||
#include "DIASupport.h"
|
||||
#include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"
|
||||
#include "llvm/DebugInfo/PDB/IPDBFrameData.h"
|
||||
|
||||
namespace llvm {
|
||||
namespace pdb {
|
||||
|
||||
class DIASession;
|
||||
|
||||
class DIAEnumFrameData : public IPDBEnumChildren<IPDBFrameData> {
|
||||
public:
|
||||
explicit DIAEnumFrameData(const DIASession &PDBSession,
|
||||
CComPtr<IDiaEnumFrameData> DiaEnumerator);
|
||||
|
||||
uint32_t getChildCount() const override;
|
||||
ChildTypePtr getChildAtIndex(uint32_t Index) const override;
|
||||
ChildTypePtr getNext() override;
|
||||
void reset() override;
|
||||
|
||||
private:
|
||||
const DIASession &Session;
|
||||
CComPtr<IDiaEnumFrameData> Enumerator;
|
||||
};
|
||||
|
||||
} // namespace pdb
|
||||
} // namespace llvm
|
||||
|
||||
#endif
|
|
@ -1,41 +0,0 @@
|
|||
//===- DIAFrameData.h - DIA Impl. of IPDBFrameData ---------------- C++ -*-===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef LLVM_DEBUGINFO_PDB_DIA_DIAFRAMEDATA_H
|
||||
#define LLVM_DEBUGINFO_PDB_DIA_DIAFRAMEDATA_H
|
||||
|
||||
#include "DIASupport.h"
|
||||
#include "llvm/DebugInfo/PDB/IPDBFrameData.h"
|
||||
|
||||
namespace llvm {
|
||||
namespace pdb {
|
||||
|
||||
class DIASession;
|
||||
|
||||
class DIAFrameData : public IPDBFrameData {
|
||||
public:
|
||||
explicit DIAFrameData(const DIASession &PDBSession,
|
||||
CComPtr<IDiaFrameData> DiaFrameData);
|
||||
|
||||
uint32_t getAddressOffset() const override;
|
||||
uint32_t getAddressSection() const override;
|
||||
uint32_t getLengthBlock() const override;
|
||||
std::string getProgram() const override;
|
||||
uint32_t getRelativeVirtualAddress() const override;
|
||||
uint64_t getVirtualAddress() const override;
|
||||
|
||||
private:
|
||||
const DIASession &Session;
|
||||
CComPtr<IDiaFrameData> FrameData;
|
||||
};
|
||||
|
||||
} // namespace pdb
|
||||
} // namespace llvm
|
||||
|
||||
#endif
|
|
@ -85,7 +85,6 @@ public:
|
|||
|
||||
std::unique_ptr<IPDBEnumSectionContribs> getSectionContribs() const override;
|
||||
|
||||
std::unique_ptr<IPDBEnumFrameData> getFrameData() const override;
|
||||
private:
|
||||
CComPtr<IDiaSession> Session;
|
||||
};
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
//===- IPDBFrameData.h - base interface for frame data ----------*- C++ -*-===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef LLVM_DEBUGINFO_PDB_IPDBFRAMEDATA_H
|
||||
#define LLVM_DEBUGINFO_PDB_IPDBFRAMEDATA_H
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
|
||||
namespace llvm {
|
||||
namespace pdb {
|
||||
|
||||
/// IPDBFrameData defines an interface used to represent a frame data of some
|
||||
/// code block.
|
||||
class IPDBFrameData {
|
||||
public:
|
||||
virtual ~IPDBFrameData();
|
||||
|
||||
virtual uint32_t getAddressOffset() const = 0;
|
||||
virtual uint32_t getAddressSection() const = 0;
|
||||
virtual uint32_t getLengthBlock() const = 0;
|
||||
virtual std::string getProgram() const = 0;
|
||||
virtual uint32_t getRelativeVirtualAddress() const = 0;
|
||||
virtual uint64_t getVirtualAddress() const = 0;
|
||||
};
|
||||
|
||||
} // namespace pdb
|
||||
} // namespace llvm
|
||||
|
||||
#endif
|
|
@ -91,9 +91,6 @@ public:
|
|||
|
||||
virtual std::unique_ptr<IPDBEnumSectionContribs>
|
||||
getSectionContribs() const = 0;
|
||||
|
||||
virtual std::unique_ptr<IPDBEnumFrameData>
|
||||
getFrameData() const = 0;
|
||||
};
|
||||
} // namespace pdb
|
||||
} // namespace llvm
|
||||
|
|
|
@ -93,8 +93,6 @@ public:
|
|||
|
||||
std::unique_ptr<IPDBEnumSectionContribs> getSectionContribs() const override;
|
||||
|
||||
std::unique_ptr<IPDBEnumFrameData> getFrameData() const override;
|
||||
|
||||
PDBFile &getPDBFile() { return *Pdb; }
|
||||
const PDBFile &getPDBFile() const { return *Pdb; }
|
||||
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
|
||||
#include "llvm/DebugInfo/CodeView/CodeView.h"
|
||||
#include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"
|
||||
#include "llvm/DebugInfo/PDB/IPDBFrameData.h"
|
||||
#include "llvm/DebugInfo/PDB/Native/RawTypes.h"
|
||||
#include <cctype>
|
||||
#include <cstddef>
|
||||
|
@ -72,7 +71,6 @@ using IPDBEnumLineNumbers = IPDBEnumChildren<IPDBLineNumber>;
|
|||
using IPDBEnumTables = IPDBEnumChildren<IPDBTable>;
|
||||
using IPDBEnumInjectedSources = IPDBEnumChildren<IPDBInjectedSource>;
|
||||
using IPDBEnumSectionContribs = IPDBEnumChildren<IPDBSectionContrib>;
|
||||
using IPDBEnumFrameData = IPDBEnumChildren<IPDBFrameData>;
|
||||
|
||||
/// Specifies which PDB reader implementation is to be used. Only a value
|
||||
/// of PDB_ReaderType::DIA is currently supported, but Native is in the works.
|
||||
|
|
|
@ -14,7 +14,6 @@ if(LLVM_ENABLE_DIA_SDK)
|
|||
add_pdb_impl_folder(DIA
|
||||
DIA/DIADataStream.cpp
|
||||
DIA/DIAEnumDebugStreams.cpp
|
||||
DIA/DIAEnumFrameData.cpp
|
||||
DIA/DIAEnumInjectedSources.cpp
|
||||
DIA/DIAEnumLineNumbers.cpp
|
||||
DIA/DIAEnumSectionContribs.cpp
|
||||
|
@ -22,7 +21,6 @@ if(LLVM_ENABLE_DIA_SDK)
|
|||
DIA/DIAEnumSymbols.cpp
|
||||
DIA/DIAEnumTables.cpp
|
||||
DIA/DIAError.cpp
|
||||
DIA/DIAFrameData.cpp
|
||||
DIA/DIAInjectedSource.cpp
|
||||
DIA/DIALineNumber.cpp
|
||||
DIA/DIARawSymbol.cpp
|
||||
|
|
|
@ -1,43 +0,0 @@
|
|||
//==- DIAEnumFrameData.cpp ---------------------------------------*- C++ -*-==//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "llvm/DebugInfo/PDB/DIA/DIAEnumFrameData.h"
|
||||
#include "llvm/DebugInfo/PDB/DIA/DIAFrameData.h"
|
||||
#include "llvm/DebugInfo/PDB/DIA/DIASession.h"
|
||||
|
||||
using namespace llvm::pdb;
|
||||
|
||||
DIAEnumFrameData::DIAEnumFrameData(const DIASession &PDBSession,
|
||||
CComPtr<IDiaEnumFrameData> DiaEnumerator)
|
||||
: Session(PDBSession), Enumerator(DiaEnumerator) {}
|
||||
|
||||
uint32_t DIAEnumFrameData::getChildCount() const {
|
||||
LONG Count = 0;
|
||||
return (S_OK == Enumerator->get_Count(&Count)) ? Count : 0;
|
||||
}
|
||||
|
||||
std::unique_ptr<IPDBFrameData>
|
||||
DIAEnumFrameData::getChildAtIndex(uint32_t Index) const {
|
||||
CComPtr<IDiaFrameData> Item;
|
||||
if (S_OK != Enumerator->Item(Index, &Item))
|
||||
return nullptr;
|
||||
|
||||
return std::unique_ptr<IPDBFrameData>(new DIAFrameData(Session, Item));
|
||||
}
|
||||
|
||||
std::unique_ptr<IPDBFrameData> DIAEnumFrameData::getNext() {
|
||||
CComPtr<IDiaFrameData> Item;
|
||||
ULONG NumFetched = 0;
|
||||
if (S_OK != Enumerator->Next(1, &Item, &NumFetched))
|
||||
return nullptr;
|
||||
|
||||
return std::unique_ptr<IPDBFrameData>(new DIAFrameData(Session, Item));
|
||||
}
|
||||
|
||||
void DIAEnumFrameData::reset() { Enumerator->Reset(); }
|
|
@ -1,54 +0,0 @@
|
|||
//===- DIAFrameData.cpp - DIA impl. of IPDBFrameData -------------- C++ -*-===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "llvm/DebugInfo/PDB/DIA/DIAFrameData.h"
|
||||
#include "llvm/DebugInfo/PDB/DIA/DIASession.h"
|
||||
#include "llvm/DebugInfo/PDB/DIA/DIAUtils.h"
|
||||
|
||||
using namespace llvm::pdb;
|
||||
|
||||
DIAFrameData::DIAFrameData(const DIASession &PDBSession,
|
||||
CComPtr<IDiaFrameData> DiaFrameData)
|
||||
: Session(PDBSession), FrameData(DiaFrameData) {}
|
||||
|
||||
template <typename ArgType>
|
||||
ArgType
|
||||
PrivateGetDIAValue(IDiaFrameData *FrameData,
|
||||
HRESULT (__stdcall IDiaFrameData::*Method)(ArgType *)) {
|
||||
ArgType Value;
|
||||
if (S_OK == (FrameData->*Method)(&Value))
|
||||
return static_cast<ArgType>(Value);
|
||||
|
||||
return ArgType();
|
||||
}
|
||||
|
||||
uint32_t DIAFrameData::getAddressOffset() const {
|
||||
return PrivateGetDIAValue(FrameData, &IDiaFrameData::get_addressOffset);
|
||||
}
|
||||
|
||||
uint32_t DIAFrameData::getAddressSection() const {
|
||||
return PrivateGetDIAValue(FrameData, &IDiaFrameData::get_addressSection);
|
||||
}
|
||||
|
||||
uint32_t DIAFrameData::getLengthBlock() const {
|
||||
return PrivateGetDIAValue(FrameData, &IDiaFrameData::get_lengthBlock);
|
||||
}
|
||||
|
||||
std::string DIAFrameData::getProgram() const {
|
||||
return invokeBstrMethod(*FrameData, &IDiaFrameData::get_program);
|
||||
}
|
||||
|
||||
uint32_t DIAFrameData::getRelativeVirtualAddress() const {
|
||||
return PrivateGetDIAValue(FrameData,
|
||||
&IDiaFrameData::get_relativeVirtualAddress);
|
||||
}
|
||||
|
||||
uint64_t DIAFrameData::getVirtualAddress() const {
|
||||
return PrivateGetDIAValue(FrameData, &IDiaFrameData::get_virtualAddress);
|
||||
}
|
|
@ -9,7 +9,6 @@
|
|||
#include "llvm/DebugInfo/PDB/DIA/DIASession.h"
|
||||
#include "llvm/ADT/STLExtras.h"
|
||||
#include "llvm/DebugInfo/PDB/DIA/DIAEnumDebugStreams.h"
|
||||
#include "llvm/DebugInfo/PDB/DIA/DIAEnumFrameData.h"
|
||||
#include "llvm/DebugInfo/PDB/DIA/DIAEnumInjectedSources.h"
|
||||
#include "llvm/DebugInfo/PDB/DIA/DIAEnumLineNumbers.h"
|
||||
#include "llvm/DebugInfo/PDB/DIA/DIAEnumSectionContribs.h"
|
||||
|
@ -420,13 +419,3 @@ DIASession::getSectionContribs() const {
|
|||
|
||||
return llvm::make_unique<DIAEnumSectionContribs>(*this, Sections);
|
||||
}
|
||||
|
||||
std::unique_ptr<IPDBEnumFrameData>
|
||||
DIASession::getFrameData() const {
|
||||
CComPtr<IDiaEnumFrameData> FD =
|
||||
getTableEnumerator<IDiaEnumFrameData>(*Session);
|
||||
if (!FD)
|
||||
return nullptr;
|
||||
|
||||
return llvm::make_unique<DIAEnumFrameData>(*this, FD);
|
||||
}
|
||||
|
|
|
@ -200,11 +200,6 @@ NativeSession::getSectionContribs() const {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
std::unique_ptr<IPDBEnumFrameData>
|
||||
NativeSession::getFrameData() const {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void NativeSession::initializeExeSymbol() {
|
||||
if (ExeSymbol == 0)
|
||||
ExeSymbol = Cache.createSymbol<NativeExeSymbol>();
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "llvm/DebugInfo/PDB/IPDBDataStream.h"
|
||||
#include "llvm/DebugInfo/PDB/IPDBFrameData.h"
|
||||
#include "llvm/DebugInfo/PDB/IPDBInjectedSource.h"
|
||||
#include "llvm/DebugInfo/PDB/IPDBLineNumber.h"
|
||||
#include "llvm/DebugInfo/PDB/IPDBRawSymbol.h"
|
||||
|
@ -36,5 +35,3 @@ IPDBTable::~IPDBTable() = default;
|
|||
IPDBInjectedSource::~IPDBInjectedSource() = default;
|
||||
|
||||
IPDBSectionContrib::~IPDBSectionContrib() = default;
|
||||
|
||||
IPDBFrameData::~IPDBFrameData() = default;
|
||||
|
|
|
@ -159,10 +159,6 @@ class MockSession : public IPDBSession {
|
|||
std::unique_ptr<IPDBEnumSectionContribs> getSectionContribs() const override {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::unique_ptr<IPDBEnumFrameData> getFrameData() const override {
|
||||
return nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
class MockRawSymbol : public IPDBRawSymbol {
|
||||
|
|
Loading…
Reference in New Issue