// 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(); // Might not be valid if there is not id r->id = cdbIdToBreakpointResponseId(gdbmi["id"]); const GdbMi moduleG = gdbmi["module"]; if (moduleG.isValid()) r->module = QString::fromLocal8Bit(moduleG.data()); const GdbMi sourceFileName = gdbmi["srcfile"]; if (sourceFileName.isValid()) { r->fileName = QString::fromLocal8Bit(sourceFileName.data()); const GdbMi lineNumber = gdbmi["srcline"]; if (lineNumber.isValid()) r->lineNumber = lineNumber.data().toULongLong(0, 0); } if (expression) { const GdbMi expressionG = gdbmi["expression"]; if (expressionG.isValid()) *expression = QString::fromLocal8Bit(expressionG.data()); } const GdbMi addressG = gdbmi["address"]; if (addressG.isValid()) r->address = addressG.data().toULongLong(0, 0); if (gdbmiChildToInt(gdbmi, "passcount", &(r->ignoreCount))) r->ignoreCount--; gdbmiChildToInt(gdbmi, "thread", &(r->threadSpec)); }
// 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)); }