本文整理汇总了C++中CComObject::GetCallFrameInfo方法的典型用法代码示例。如果您正苦于以下问题:C++ CComObject::GetCallFrameInfo方法的具体用法?C++ CComObject::GetCallFrameInfo怎么用?C++ CComObject::GetCallFrameInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CComObject
的用法示例。
在下文中一共展示了CComObject::GetCallFrameInfo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PopulateCallStack
HRESULT ThreadController::PopulateCallStack()
{
ATLENSURE_RETURN_HR(ThreadHelpers::IsOnPDMThread(m_dispatchThreadId), E_UNEXPECTED);
ATLENSURE_RETURN_HR(this->IsAtBreak(), E_NOT_VALID_STATE);
// Lock the access to the callstack so that we are thread safe
CComCritSecLock<CComAutoCriticalSection> lock(m_csCallFramesLock);
CComPtr<IEnumDebugStackFrames> pStackFrameEnum;
HRESULT hr = m_spCurrentBrokenThread->EnumStackFrames(&pStackFrameEnum);
if (hr == S_OK)
{
if ((hr = pStackFrameEnum->Reset()) != S_OK)
{
return hr;
}
shared_ptr<DebugStackFrameDescriptor> spFrameDescriptor(new DebugStackFrameDescriptor());
ULONG nFetched;
for (ULONG ulIndex = 0; (pStackFrameEnum->Next(1, spFrameDescriptor.get(), &nFetched) == S_OK) && (nFetched == 1); ulIndex++)
{
// Get a new identifier for this source node
ULONG newFrameId = ThreadController::CreateUniqueFrameId();
ULONG newPropertyId = ThreadController::CreateUniquePropertyId();
// Create object that represents the source file
CComObject<CallFrame>* pFrame;
hr = CComObject<CallFrame>::CreateInstance(&pFrame);
BPT_FAIL_IF_NOT_S_OK(hr);
hr = pFrame->Initialize(m_dispatchThreadId, newFrameId, spFrameDescriptor, m_spSourceController);
BPT_FAIL_IF_NOT_S_OK(hr);
// Add to our maps
m_callFrameMap[newFrameId] = pFrame;
m_callFrames.push_back(newFrameId);
// Get the information about this call frame
shared_ptr<CallFrameInfo> spFrameInfo;
CComPtr<IDebugStackFrame> spStackFrame;
CComPtr<IDebugProperty> spLocalsDebugProperty;
hr = pFrame->GetCallFrameInfo(spFrameInfo, spStackFrame, spLocalsDebugProperty);
BPT_FAIL_IF_NOT_S_OK(hr);
// Store that info in our maps
m_callFramesInfoMap[newFrameId] = spFrameInfo;
m_debugFrameMap[newFrameId] = spStackFrame;
m_propertyMap[newPropertyId] = spLocalsDebugProperty;
// Link the locals to the frame id for later lookup
m_localsMap[newFrameId] = newPropertyId;
}
}
return S_OK;
}