本文整理汇总了C++中GdbMi::childCount方法的典型用法代码示例。如果您正苦于以下问题:C++ GdbMi::childCount方法的具体用法?C++ GdbMi::childCount怎么用?C++ GdbMi::childCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GdbMi
的用法示例。
在下文中一共展示了GdbMi::childCount方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleEntryPoint
void TermGdbAdapter::handleEntryPoint(const GdbResponse &response)
{
if (response.resultClass == GdbResultDone) {
GdbMi stack = response.data.findChild("stack");
if (stack.isValid() && stack.childCount() == 1)
m_engine->m_entryPoint = stack.childAt(0).findChild("addr").data();
}
}
示例2: setFramesAndCurrentIndex
void StackHandler::setFramesAndCurrentIndex(const GdbMi &frames, bool isFull)
{
int targetFrame = -1;
StackFrames stackFrames;
const int n = frames.childCount();
for (int i = 0; i != n; ++i) {
stackFrames.append(StackFrame::parseFrame(frames.childAt(i), m_engine->runParameters()));
const StackFrame &frame = stackFrames.back();
// Initialize top frame to the first valid frame.
const bool isValid = frame.isUsable() && !frame.function.isEmpty();
if (isValid && targetFrame == -1)
targetFrame = i;
}
bool canExpand = !isFull && (n >= action(MaximalStackDepth)->value().toInt());
action(ExpandStack)->setEnabled(canExpand);
setFrames(stackFrames, canExpand);
// We can't jump to any file if we don't have any frames.
if (stackFrames.isEmpty())
return;
// targetFrame contains the top most frame for which we have source
// information. That's typically the frame we'd like to jump to, with
// a few exceptions:
// Always jump to frame #0 when stepping by instruction.
if (m_engine->operatesByInstruction())
targetFrame = 0;
// If there is no frame with source, jump to frame #0.
if (targetFrame == -1)
targetFrame = 0;
setCurrentIndex(targetFrame);
}