void GdbDebugger::runToLine(const QString &fileName, int line) { line++; GdbCmd cmd; QStringList args; args << "-break-insert"; args << "-t"; args << QString("%1:%2").arg(fileName).arg(line); cmd.setCmd(args); command(cmd); command("-exec-continue"); }
void GdbDebugger::command_helper(const GdbCmd &cmd, bool emitOut) { m_token++; QByteArray buf = cmd.makeCmd(m_token); if (emitOut) { emit debugLog(LiteApi::DebugConsoleLog,">>> "+QString::fromUtf8(buf)); } #ifdef Q_OS_WIN buf.append("\r\n"); #else buf.append("\n"); #endif m_tokenCookieMap.insert(m_token,cmd.cookie()); m_process->write(buf); }
void GdbDebugger::removeBreakPoint(const QString &fileName, int line) { line++; QString location = QString("%1:%2").arg(fileName).arg(line); QString number = m_locationBkMap.key(location); if (number.isEmpty()) { return; } QStringList args; args << "-break-delete"; args << number; GdbCmd cmd; cmd.setCmd(args); command(cmd); }
void GdbDebugger::insertBreakPoint(const QString &fileName, int line) { line++; QString location = QString("%1:%2").arg(fileName).arg(line); if (m_locationBkMap.contains(location)) { return; } QStringList args; args << "-break-insert"; args << QString("%1:%2").arg(fileName).arg(line); GdbCmd cmd; cmd.setCmd(args); cmd.insert("file",fileName); cmd.insert("line",line); command(cmd); }
void GdbDebugger::removeWatchByName(const QString &name, bool children) { QString var = m_varNameMap.key(name); QStringList args; args << "-var-delete"; if (children) { args << "-c"; } args << name; GdbCmd cmd; cmd.setCmd(args); cmd.insert("var",var); cmd.insert("name",name); cmd.insert("children",children); command(cmd); }
void GdbDebugeer::removeWatch(const QString &var, bool children) { QString name = m_varNameMap.value(var); QStringList args; args << "-var-delete"; if (children) { args << "-c"; } args << name; GdbCmd cmd; cmd.setCmd(args); cmd.insert("var",var); cmd.insert("name",name); cmd.insert("children",children); command(cmd); }
void GdbDebugger::createWatch(const QString &var, bool floating, bool watchModel) { GdbCmd cmd; QStringList args; args << "-var-create"; args << "-"; if (floating) { args << "@"; } else { args << "*"; } args << var; cmd.setCmd(args); cmd.insert("var",var); if (watchModel) { cmd.insert("watchModel",true); } command(cmd); }