本文整理汇总了C++中GdbMi::findChild方法的典型用法代码示例。如果您正苦于以下问题:C++ GdbMi::findChild方法的具体用法?C++ GdbMi::findChild怎么用?C++ GdbMi::findChild使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GdbMi
的用法示例。
在下文中一共展示了GdbMi::findChild方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parseBreakPoint
// Parse extension command listing breakpoints.
// Note that not all fields are returned, since file, line, function are encoded
// in the expression (that is in addition deleted on resolving for a bp-type breakpoint).
void parseBreakPoint(const GdbMi &gdbmi, BreakpointResponse *r,
QString *expression /* = 0 */)
{
gdbmiChildToBool(gdbmi, "enabled", &(r->enabled));
gdbmiChildToBool(gdbmi, "deferred", &(r->pending));
r->id = BreakpointResponseId();
const GdbMi idG = gdbmi.findChild("id");
if (idG.isValid()) { // Might not be valid if there is not id
bool ok;
const int id = idG.data().toInt(&ok);
if (ok)
r->id = BreakpointResponseId(id);
}
const GdbMi moduleG = gdbmi.findChild("module");
if (moduleG.isValid())
r->module = QString::fromLocal8Bit(moduleG.data());
if (expression) {
const GdbMi expressionG = gdbmi.findChild("expression");
if (expressionG.isValid())
*expression = QString::fromLocal8Bit(expressionG.data());
}
const GdbMi addressG = gdbmi.findChild("address");
if (addressG.isValid())
r->address = addressG.data().toULongLong(0, 0);
if (gdbmiChildToInt(gdbmi, "passcount", &(r->ignoreCount)))
r->ignoreCount--;
gdbmiChildToInt(gdbmi, "thread", &(r->threadSpec));
}
示例2: gdbmiChildToBool
// Helper to retrieve an bool child from GDBMI
static inline bool gdbmiChildToBool(const GdbMi &parent, const char *childName, bool *target)
{
const GdbMi childBA = parent.findChild(childName);
if (childBA.isValid()) {
*target = childBA.data() == "true";
return true;
}
return false;
}
示例3: gdbmiChildToInt
// Helper to retrieve an int child from GDBMI
static inline bool gdbmiChildToInt(const GdbMi &parent, const char *childName, int *target)
{
const GdbMi childBA = parent.findChild(childName);
if (childBA.isValid()) {
bool ok;
const int v = childBA.data().toInt(&ok);
if (ok) {
*target = v;
return true;
}
}
return false;
}
示例4: fromGdbMI
void WinException::fromGdbMI(const GdbMi &gdbmi)
{
exceptionCode = gdbmi.findChild("exceptionCode").data().toUInt();
exceptionFlags = gdbmi.findChild("exceptionFlags").data().toUInt();
exceptionAddress = gdbmi.findChild("exceptionAddress").data().toULongLong();
firstChance = gdbmi.findChild("firstChance").data() != "0";
const GdbMi ginfo1 = gdbmi.findChild("exceptionInformation0");
if (ginfo1.isValid()) {
info1 = ginfo1.data().toULongLong();
const GdbMi ginfo2 = gdbmi.findChild("exceptionInformation1");
if (ginfo2.isValid())
info2 = ginfo1.data().toULongLong();
}
const GdbMi gLineNumber = gdbmi.findChild("exceptionLine");
if (gLineNumber.isValid()) {
lineNumber = gLineNumber.data().toInt();
file = gdbmi.findChild("exceptionFile").data();
}
function = gdbmi.findChild("exceptionFunction").data();
}
示例5: parseGdbmiThreads
Threads ThreadsHandler::parseGdbmiThreads(const GdbMi &data, int *currentThread)
{
// ^done,threads=[{id="1",target-id="Thread 0xb7fdc710 (LWP 4264)",
// frame={level="0",addr="0x080530bf",func="testQString",args=[],
// file="/.../app.cpp",fullname="/../app.cpp",line="1175"},
// state="stopped",core="0"}],current-thread-id="1"
const QList<GdbMi> items = data.findChild("threads").children();
const int n = items.size();
Threads threads;
threads.reserve(n);
for (int index = 0; index != n; ++index) {
bool ok = false;
const GdbMi item = items.at(index);
const GdbMi frame = item.findChild("frame");
ThreadData thread;
thread.id = item.findChild("id").data().toInt();
thread.targetId = QString::fromLatin1(item.findChild("target-id").data());
thread.core = QString::fromLatin1(item.findChild("core").data());
thread.state = QString::fromLatin1(item.findChild("state").data());
thread.address = frame.findChild("addr").data().toULongLong(&ok, 0);
thread.function = QString::fromLatin1(frame.findChild("func").data());
thread.fileName = QString::fromLatin1(frame.findChild("fullname").data());
thread.lineNumber = frame.findChild("line").data().toInt();
thread.module = QString::fromLocal8Bit(frame.findChild("from").data());
// Non-GDB (Cdb2) output name here.
thread.name = QString::fromLatin1(frame.findChild("name").data());
threads.append(thread);
}
if (currentThread)
*currentThread = data.findChild("current-thread-id").data().toInt();
return threads;
}