本文整理汇总了C++中StackFrame::Function方法的典型用法代码示例。如果您正苦于以下问题:C++ StackFrame::Function方法的具体用法?C++ StackFrame::Function怎么用?C++ StackFrame::Function使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StackFrame
的用法示例。
在下文中一共展示了StackFrame::Function方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: locker
void
TeamWindow::_SetActiveFunction(FunctionInstance* functionInstance)
{
if (functionInstance == fActiveFunction)
return;
AutoLocker< ::Team> locker(fTeam);
if (fActiveFunction != NULL) {
fActiveFunction->GetFunction()->RemoveListener(this);
fActiveFunction->ReleaseReference();
}
// to avoid listener feedback problems, first unset the active function and
// set the new image, if any
locker.Unlock();
fActiveFunction = NULL;
if (functionInstance != NULL)
_SetActiveImage(fTeam->ImageByAddress(functionInstance->Address()));
fActiveFunction = functionInstance;
locker.Lock();
SourceCode* sourceCode = NULL;
BReference<SourceCode> sourceCodeReference;
if (fActiveFunction != NULL) {
fActiveFunction->AcquireReference();
fActiveFunction->GetFunction()->AddListener(this);
Function* function = fActiveFunction->GetFunction();
sourceCode = function->GetSourceCode();
if (sourceCode == NULL)
sourceCode = fActiveFunction->GetSourceCode();
sourceCodeReference.SetTo(sourceCode);
// If the source code is not loaded yet, request it.
if (function->SourceCodeState() == FUNCTION_SOURCE_NOT_LOADED)
fListener->FunctionSourceCodeRequested(fActiveFunction);
}
locker.Unlock();
_SetActiveSourceCode(sourceCode);
fImageFunctionsView->SetFunction(fActiveFunction);
locker.Lock();
// look if our current stack trace has a frame matching the selected
// function. If so, set it to match.
StackFrame* matchingFrame = NULL;
BReference<StackFrame> frameRef;
if (fActiveStackTrace != NULL) {
for (int32 i = 0; i < fActiveStackTrace->CountFrames(); i++) {
StackFrame* frame = fActiveStackTrace->FrameAt(i);
if (frame->Function() == fActiveFunction) {
matchingFrame = frame;
frameRef.SetTo(frame);
break;
}
}
}
locker.Unlock();
if (matchingFrame != NULL)
_SetActiveStackFrame(matchingFrame);
}