LLVM  8.0.1
DIAFrameData.cpp
Go to the documentation of this file.
1 //===- DIAFrameData.cpp - DIA impl. of IPDBFrameData -------------- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
13 
14 using namespace llvm::pdb;
15 
16 DIAFrameData::DIAFrameData(CComPtr<IDiaFrameData> DiaFrameData)
17  : FrameData(DiaFrameData) {}
18 
19 template <typename ArgType>
20 ArgType
21 PrivateGetDIAValue(IDiaFrameData *FrameData,
22  HRESULT (__stdcall IDiaFrameData::*Method)(ArgType *)) {
23  ArgType Value;
24  if (S_OK == (FrameData->*Method)(&Value))
25  return static_cast<ArgType>(Value);
26 
27  return ArgType();
28 }
29 
31  return PrivateGetDIAValue(FrameData, &IDiaFrameData::get_addressOffset);
32 }
33 
35  return PrivateGetDIAValue(FrameData, &IDiaFrameData::get_addressSection);
36 }
37 
39  return PrivateGetDIAValue(FrameData, &IDiaFrameData::get_lengthBlock);
40 }
41 
42 std::string DIAFrameData::getProgram() const {
43  return invokeBstrMethod(*FrameData, &IDiaFrameData::get_program);
44 }
45 
47  return PrivateGetDIAValue(FrameData,
48  &IDiaFrameData::get_relativeVirtualAddress);
49 }
50 
52  return PrivateGetDIAValue(FrameData, &IDiaFrameData::get_virtualAddress);
53 }
std::string getProgram() const override
uint32_t getAddressSection() const override
ArgType PrivateGetDIAValue(IDiaFrameData *FrameData, HRESULT(__stdcall IDiaFrameData::*Method)(ArgType *))
DIAFrameData(CComPtr< IDiaFrameData > DiaFrameData)
std::string invokeBstrMethod(Obj &Object, HRESULT(__stdcall Obj::*Func)(BSTR *))
Definition: DIAUtils.h:17
uint32_t getLengthBlock() const override
uint64_t getVirtualAddress() const override
uint32_t getAddressOffset() const override
uint32_t getRelativeVirtualAddress() const override