Exemple #1
0
bool Debugger::validBreakpoint(const QString &code, int line)
{
  if (code.isEmpty() || line < 0)
    return false;

  QSEngine e;
  if (e.checkSyntax(code, QSEngine::CheckNormal, false)) {
    return QSNode::setBreakpoint(QSNode::firstNode(),
                                 e.rep->sourceId(),
                                 line, true);
  }
  return false;
}
Exemple #2
0
bool Debugger::validBreakpoint( const QString &code, int line )
{
    Q_ASSERT(!"Debugger::validBreakpoint is not reentrant and deletes all nodes... Evil!!");
    if ( code.isEmpty() || line < 0 )
	return FALSE;
    // can't check with invalid syntax

    QSEngine e;

    if ( !e.checkSyntax( code, QSEngine::CheckNormal, FALSE ) ) {
	return FALSE;
    }
    // try to set a breakpoint
    Q_ASSERT(!"Unsupported action...");
//     bool b = QSNode::setBreakpoint( /*QSNode::firstNode()*/ 0, e.rep->sourceId(), line, TRUE );
    // free the temporary source id
    return false /* b */;
}