Commit 17572282 authored by Kai Koehne's avatar Kai Koehne

New QTC_CHECK warning replacing QTC_ASSERT(x, /**/)

Warn if the condition fails, but otherwise don't change the execution
flow.

Change-Id: Id7b14c745109b66960add967b2a4ef8d31e1a546
Reviewed-on: http://codereview.qt.nokia.com/2389Reviewed-by: default avatarEike Ziller <eike.ziller@nokia.com>
parent c031d456
......@@ -125,7 +125,7 @@ QString ClassNameValidatingLineEdit::createClassName(const QString &name)
// Remove spaces and convert the adjacent characters to uppercase
QString className = name;
QRegExp spaceMatcher(QLatin1String(" +(\\w)"), Qt::CaseSensitive, QRegExp::RegExp2);
QTC_ASSERT(spaceMatcher.isValid(), /**/);
QTC_CHECK(spaceMatcher.isValid());
int pos;
while ((pos = spaceMatcher.indexIn(className)) != -1) {
className.replace(pos, spaceMatcher.matchedLength(),
......
......@@ -44,5 +44,8 @@
#define QTC_ASSERT(cond, action) \
if(cond){}else{qDebug()<<"ASSERTION " #cond " FAILED AT " __FILE__ ":" QTC_ASSERT_STRINGIFY(__LINE__);action;}
#define QTC_CHECK(cond) \
if(cond){}else{qDebug()<<"ASSERTION " #cond " FAILED AT " __FILE__ ":" QTC_ASSERT_STRINGIFY(__LINE__);}
#endif // QTC_ASSERT_H
......@@ -602,7 +602,7 @@ QAction *AnalyzerManagerPrivate::actionFromToolAndMode(IAnalyzerTool *tool, Star
foreach (QAction *action, m_actions)
if (m_toolFromAction.value(action) == tool && m_modeFromAction[action] == mode)
return action;
QTC_ASSERT(false, /**/);
QTC_CHECK(false);
return 0;
}
......@@ -666,9 +666,9 @@ void AnalyzerManagerPrivate::selectTool(IAnalyzerTool *tool, StartMode mode)
if (!m_defaultSettings.contains(tool)) {
QWidget *widget = tool->createWidgets();
QTC_ASSERT(widget, /**/);
QTC_CHECK(widget);
m_defaultSettings.insert(tool, m_mainWindow->saveSettings());
QTC_ASSERT(!m_controlsWidgetFromTool.contains(tool), /**/);
QTC_CHECK(!m_controlsWidgetFromTool.contains(tool));
m_controlsWidgetFromTool[tool] = widget;
m_controlsStackWidget->addWidget(widget);
}
......@@ -677,7 +677,7 @@ void AnalyzerManagerPrivate::selectTool(IAnalyzerTool *tool, StartMode mode)
loadToolSettings(tool);
QTC_ASSERT(m_controlsWidgetFromTool.contains(tool), /**/);
QTC_CHECK(m_controlsWidgetFromTool.contains(tool));
m_controlsStackWidget->setCurrentWidget(m_controlsWidgetFromTool.value(tool));
m_toolBox->setCurrentIndex(actionIndex);
......
......@@ -565,7 +565,7 @@ MimeTypeData::MimeTypeData()
// "*.log[1-9]"
: suffixPattern(QLatin1String("^\\*\\.[\\w+]+$"))
{
QTC_ASSERT(suffixPattern.isValid(), /**/);
QTC_CHECK(suffixPattern.isValid());
}
void MimeTypeData::clear()
......
......@@ -165,7 +165,7 @@ static QScriptValue fileBox(QScriptContext *context, QScriptEngine *engine)
if (fileDialog.exec() == QDialog::Rejected)
return QScriptValue(engine, QScriptValue::NullValue);
const QStringList rc = fileDialog.selectedFiles();
QTC_ASSERT(!rc.empty(), /**/);
QTC_CHECK(!rc.empty());
return TFileMode == QFileDialog::ExistingFiles ?
engine->toScriptValue(rc) : engine->toScriptValue(rc.front());
}
......
......@@ -102,7 +102,7 @@ VersionDialog::VersionDialog(QWidget *parent)
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
QPushButton *closeButton = buttonBox->button(QDialogButtonBox::Close);
QTC_ASSERT(closeButton, /**/);
QTC_CHECK(closeButton);
buttonBox->addButton(closeButton, QDialogButtonBox::ButtonRole(QDialogButtonBox::RejectRole | QDialogButtonBox::AcceptRole));
connect(buttonBox , SIGNAL(rejected()), this, SLOT(reject()));
......
......@@ -232,7 +232,7 @@ bool CppClassWizard::generateHeaderAndSource(const CppClassWizardParameters &par
<< "\n#define " << guard << '\n';
const QRegExp qtClassExpr(QLatin1String("^Q[A-Z3].+"));
QTC_ASSERT(qtClassExpr.isValid(), /**/);
QTC_CHECK(qtClassExpr.isValid());
// Determine parent QObject type for Qt types. Provide base
// class in case the user did not specify one.
QString parentQObjectClass;
......
......@@ -127,7 +127,7 @@ cvs diff -d -u -r1.1 -r1.2:
VCSBase::DiffHighlighter *CVSEditor::createDiffHighlighter() const
{
const QRegExp filePattern(QLatin1String("^[-+][-+][-+] .*1\\.[\\d\\.]+$"));
QTC_ASSERT(filePattern.isValid(), /**/);
QTC_CHECK(filePattern.isValid());
return new VCSBase::DiffHighlighter(filePattern);
}
......
......@@ -634,7 +634,7 @@ CVSSubmitEditor *CVSPlugin::openCVSSubmitEditor(const QString &fileName)
Core::IEditor *editor = Core::EditorManager::instance()->openEditor(fileName, QLatin1String(Constants::CVSCOMMITEDITOR_ID),
Core::EditorManager::ModeSwitch);
CVSSubmitEditor *submitEditor = qobject_cast<CVSSubmitEditor*>(editor);
QTC_ASSERT(submitEditor, /**/);
QTC_CHECK(submitEditor);
submitEditor->registerActions(m_submitUndoAction, m_submitRedoAction, m_submitCurrentLogAction, m_submitDiffAction);
connect(submitEditor, SIGNAL(diffSelectedFiles(QStringList)), this, SLOT(diffCommitFiles(QStringList)));
......
......@@ -461,7 +461,7 @@ QModelIndex BreakHandler::createIndex(int row, int column, quint32 id) const
QModelIndex BreakHandler::createIndex(int row, int column, void *ptr) const
{
QTC_ASSERT(false, /**/); // This function is not used.
QTC_CHECK(false); // This function is not used.
return QAbstractItemModel::createIndex(row, column, ptr);
}
......
......@@ -743,7 +743,7 @@ static bool isAllowedTransition(DebuggerState from, DebuggerState to)
void DebuggerEngine::setupSlaveEngine()
{
QTC_ASSERT(state() == DebuggerNotReady, /**/);
QTC_CHECK(state() == DebuggerNotReady);
d->queueSetupEngine();
}
......@@ -776,7 +776,7 @@ void DebuggerEngine::notifyEngineSetupOk()
void DebuggerEngine::setupSlaveInferior()
{
QTC_ASSERT(state() == EngineSetupOk, /**/);
QTC_CHECK(state() == EngineSetupOk);
d->queueSetupInferior();
}
......@@ -809,7 +809,7 @@ void DebuggerEngine::notifyInferiorSetupOk()
void DebuggerEngine::runSlaveEngine()
{
QTC_ASSERT(isSlaveEngine(), return);
QTC_ASSERT(state() == InferiorSetupOk, /**/);
QTC_CHECK(state() == InferiorSetupOk);
d->queueRunEngine();
}
......@@ -980,7 +980,7 @@ void DebuggerEngine::notifyInferiorIll()
void DebuggerEngine::shutdownSlaveEngine()
{
QTC_ASSERT(isAllowedTransition(state(),EngineShutdownRequested), /**/);
QTC_CHECK(isAllowedTransition(state(),EngineShutdownRequested));
setState(EngineShutdownRequested);
shutdownEngine();
}
......@@ -1329,7 +1329,7 @@ void DebuggerEngine::updateAll()
#if 0
// FIXME: Remove explicit use of BreakpointData
if (!bp->engine && acceptsBreakpoint(id)) {
QTC_ASSERT(state == BreakpointNew, /**/);
QTC_CHECK(state == BreakpointNew);
// Take ownership of the breakpoint.
bp->engine = this;
}
......@@ -1355,7 +1355,7 @@ void DebuggerEngine::attemptBreakpointSynchronization()
switch (handler->state(id)) {
case BreakpointNew:
// Should not happen once claimed.
QTC_ASSERT(false, /**/);
QTC_CHECK(false);
continue;
case BreakpointInsertRequested:
done = false;
......@@ -1381,7 +1381,7 @@ void DebuggerEngine::attemptBreakpointSynchronization()
continue;
case BreakpointDead:
// Should not only be visible inside BreakpointHandler.
QTC_ASSERT(false, /**/);
QTC_CHECK(false);
continue;
}
QTC_ASSERT(false, qDebug() << "UNKNOWN STATE" << id << state());
......@@ -1395,21 +1395,21 @@ void DebuggerEngine::insertBreakpoint(BreakpointModelId id)
{
BreakpointState state = breakHandler()->state(id);
QTC_ASSERT(state == BreakpointInsertRequested, qDebug() << id << this << state);
QTC_ASSERT(false, /**/);
QTC_CHECK(false);
}
void DebuggerEngine::removeBreakpoint(BreakpointModelId id)
{
BreakpointState state = breakHandler()->state(id);
QTC_ASSERT(state == BreakpointRemoveRequested, qDebug() << id << this << state);
QTC_ASSERT(false, /**/);
QTC_CHECK(false);
}
void DebuggerEngine::changeBreakpoint(BreakpointModelId id)
{
BreakpointState state = breakHandler()->state(id);
QTC_ASSERT(state == BreakpointChangeRequested, qDebug() << id << this << state);
QTC_ASSERT(false, /**/);
QTC_CHECK(false);
}
void DebuggerEngine::selectThread(int)
......
......@@ -1113,7 +1113,7 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(DebuggerPlugin *plugin) :
qRegisterMetaType<ContextData>("ContextData");
qRegisterMetaType<DebuggerStartParameters>("DebuggerStartParameters");
QTC_ASSERT(!theDebuggerCore, /**/);
QTC_CHECK(!theDebuggerCore);
theDebuggerCore = this;
m_plugin = plugin;
......@@ -1350,7 +1350,7 @@ void DebuggerPluginPrivate::onCurrentProjectChanged(Project *project)
Target *target = project->activeTarget();
QTC_ASSERT(target, return);
activeRc = target->activeRunConfiguration();
QTC_ASSERT(activeRc, /**/);
QTC_CHECK(activeRc);
}
for (int i = 0, n = m_snapshotHandler->size(); i != n; ++i) {
// Run controls might be deleted during exit.
......@@ -3148,7 +3148,7 @@ void DebuggerPluginPrivate::extensionsInitialized()
SIGNAL(startupProjectChanged(ProjectExplorer::Project*)),
SLOT(onCurrentProjectChanged(ProjectExplorer::Project*)));
QTC_ASSERT(m_coreSettings, /**/);
QTC_CHECK(m_coreSettings);
m_globalDebuggerOptions->fromSettings(m_coreSettings);
m_watchersWindow->setVisible(false);
m_returnWindow->setVisible(false);
......
......@@ -345,7 +345,7 @@ bool DebuggerRunControl::isRunning() const
DebuggerEngine *DebuggerRunControl::engine()
{
QTC_ASSERT(d->m_engine, /**/);
QTC_CHECK(d->m_engine);
return d->m_engine;
}
......
......@@ -107,7 +107,7 @@ void AbstractPlainGdbAdapter::handleExecRun(const GdbResponse &response)
m_engine->postCommand("target record");
} else {
QString msg = fromLocalEncoding(response.data.findChild("msg").data());
//QTC_ASSERT(status() == InferiorRunOk, /**/);
//QTC_CHECK(status() == InferiorRunOk);
//interruptInferior();
showMessage(msg);
m_engine->notifyEngineRunFailed();
......
......@@ -55,7 +55,7 @@
#endif
#define PRECONDITION QTC_ASSERT(!hasPython(), /**/)
#define PRECONDITION QTC_CHECK(!hasPython())
#define CB(callback) &GdbEngine::callback, STRINGIFY(callback)
......@@ -543,7 +543,7 @@ void DumperHelper::evaluationParameters(const WatchData &data,
// iname="local.ob.slots.2" // ".deleteLater()"?
const int pos = data.iname.lastIndexOf('.');
const QByteArray slotNumber = data.iname.mid(pos + 1);
QTC_ASSERT(slotNumber.toInt() != -1, /**/);
QTC_CHECK(slotNumber.toInt() != -1);
extraArgs[0] = slotNumber;
}
break;
......@@ -1111,7 +1111,7 @@ void GdbEngine::tryLoadDebuggingHelpersClassic()
// Do not use STRINGIFY for RTLD_NOW as we really want to expand that to a number.
#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
// We are using Python on Windows and Symbian.
QTC_ASSERT(false, /**/);
QTC_CHECK(false);
#elif defined(Q_OS_MAC)
//postCommand("sharedlibrary libc"); // for malloc
//postCommand("sharedlibrary libdl"); // for dlopen
......
......@@ -417,7 +417,7 @@ void CodaGdbAdapter::logMessage(const QString &msg, int channel)
void CodaGdbAdapter::handleGdbConnection()
{
logMessage("HANDLING GDB CONNECTION");
QTC_ASSERT(m_gdbConnection == 0, /**/);
QTC_CHECK(m_gdbConnection == 0);
m_gdbConnection = m_gdbServer->nextPendingConnection();
QTC_ASSERT(m_gdbConnection, return);
connect(m_gdbConnection, SIGNAL(disconnected()),
......@@ -1550,7 +1550,7 @@ void CodaGdbAdapter::tryAnswerGdbMemoryRequest(bool buffered)
}
}
// Happens when chunks are not combined
QTC_ASSERT(false, /**/);
QTC_CHECK(false);
showMessage("CHUNKS NOT COMBINED");
# ifdef MEMORY_DEBUG
qDebug() << "CHUNKS NOT COMBINED";
......
......@@ -239,7 +239,7 @@ void CoreGdbAdapter::runEngine()
void CoreGdbAdapter::interruptInferior()
{
// A core never runs, so this cannot be called.
QTC_ASSERT(false, /**/);
QTC_CHECK(false);
}
void CoreGdbAdapter::shutdownInferior()
......
......@@ -1023,7 +1023,7 @@ void GdbEngine::handleResultRecord(GdbResponse *response)
showMessage(_("APPLYING WORKAROUND #5"));
showMessageBox(QMessageBox::Critical,
tr("Setting breakpoints failed"), QString::fromLocal8Bit(msg));
QTC_ASSERT(state() == InferiorRunOk, /**/);
QTC_CHECK(state() == InferiorRunOk);
notifyInferiorSpontaneousStop();
notifyEngineIll();
} else {
......@@ -1147,7 +1147,7 @@ bool GdbEngine::acceptsDebuggerCommands() const
void GdbEngine::executeDebuggerCommand(const QString &command)
{
QTC_ASSERT(acceptsDebuggerCommands(), /**/);
QTC_CHECK(acceptsDebuggerCommands());
m_gdbAdapter->write(command.toLatin1() + "\r\n");
}
......@@ -1337,7 +1337,7 @@ void GdbEngine::handleStopResponse(const GdbMi &data)
notifyInferiorStopOk();
flushQueuedCommands();
if (state() == InferiorStopOk) {
QTC_ASSERT(m_commandsDoneCallback == 0, /**/);
QTC_CHECK(m_commandsDoneCallback == 0);
m_commandsDoneCallback = &GdbEngine::autoContinueInferior;
} else {
QTC_ASSERT(state() == InferiorShutdownRequested, qDebug() << state())
......@@ -1969,7 +1969,7 @@ AbstractGdbAdapter *GdbEngine::createAdapter()
void GdbEngine::setupEngine()
{
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
QTC_ASSERT(m_debuggingHelperState == DebuggingHelperUninitialized, /**/);
QTC_CHECK(m_debuggingHelperState == DebuggingHelperUninitialized);
if (m_gdbAdapter->dumperHandling() != AbstractGdbAdapter::DumperNotAvailable) {
connect(debuggerCore()->action(UseDebuggingHelpers),
......@@ -1977,7 +1977,7 @@ void GdbEngine::setupEngine()
SLOT(setUseDebuggingHelpers(QVariant)));
}
QTC_ASSERT(state() == EngineSetupRequested, /**/);
QTC_CHECK(state() == EngineSetupRequested);
m_gdbAdapter->startAdapter();
}
......@@ -2068,7 +2068,7 @@ void GdbEngine::handleExecuteStep(const GdbResponse &response)
if (response.resultClass == GdbResultDone) {
// Step was finishing too quick, and a '*stopped' messages should
// have preceded it, so just ignore this result.
QTC_ASSERT(state() == InferiorStopOk, /**/);
QTC_CHECK(state() == InferiorStopOk);
return;
}
QTC_ASSERT(state() == InferiorRunRequested, qDebug() << state());
......@@ -2138,7 +2138,7 @@ void GdbEngine::handleExecuteNext(const GdbResponse &response)
if (response.resultClass == GdbResultDone) {
// Step was finishing too quick, and a '*stopped' messages should
// have preceded it, so just ignore this result.
QTC_ASSERT(state() == InferiorStopOk, /**/);
QTC_CHECK(state() == InferiorStopOk);
return;
}
QTC_ASSERT(state() == InferiorRunRequested, qDebug() << state());
......@@ -2447,7 +2447,7 @@ void GdbEngine::handleWatchInsert(const GdbResponse &response)
if (exp.startsWith('*'))
br.address = exp.mid(1).toULongLong(0, 0);
handler->setResponse(id, br);
QTC_ASSERT(!handler->needsChange(id), /**/);
QTC_CHECK(!handler->needsChange(id));
handler->notifyBreakpointInsertOk(id);
} else if (ba.startsWith("Hardware watchpoint ")
|| ba.startsWith("Watchpoint ")) {
......@@ -2459,7 +2459,7 @@ void GdbEngine::handleWatchInsert(const GdbResponse &response)
if (address.startsWith('*'))
br.address = address.mid(1).toULongLong(0, 0);
handler->setResponse(id, br);
QTC_ASSERT(!handler->needsChange(id), /**/);
QTC_CHECK(!handler->needsChange(id));
handler->notifyBreakpointInsertOk(id);
} else {
showMessage(_("CANNOT PARSE WATCHPOINT FROM " + ba));
......@@ -2658,7 +2658,7 @@ void GdbEngine::handleBreakList(const GdbMi &table)
void GdbEngine::handleBreakListMultiple(const GdbResponse &response)
{
QTC_ASSERT(response.resultClass == GdbResultDone, /**/)
QTC_CHECK(response.resultClass == GdbResultDone)
const BreakpointModelId id = response.cookie.value<BreakpointModelId>();
const QString str = QString::fromLocal8Bit(response.consoleStreamOutput);
extractDataFromInfoBreak(str, id);
......@@ -2666,7 +2666,7 @@ void GdbEngine::handleBreakListMultiple(const GdbResponse &response)
void GdbEngine::handleBreakDisable(const GdbResponse &response)
{
QTC_ASSERT(response.resultClass == GdbResultDone, /**/)
QTC_CHECK(response.resultClass == GdbResultDone)
const BreakpointModelId id = response.cookie.value<BreakpointModelId>();
BreakHandler *handler = breakHandler();
// This should only be the requested state.
......@@ -2679,7 +2679,7 @@ void GdbEngine::handleBreakDisable(const GdbResponse &response)
void GdbEngine::handleBreakEnable(const GdbResponse &response)
{
QTC_ASSERT(response.resultClass == GdbResultDone, /**/)
QTC_CHECK(response.resultClass == GdbResultDone)
const BreakpointModelId id = response.cookie.value<BreakpointModelId>();
BreakHandler *handler = breakHandler();
// This should only be the requested state.
......@@ -2692,7 +2692,7 @@ void GdbEngine::handleBreakEnable(const GdbResponse &response)
void GdbEngine::handleBreakThreadSpec(const GdbResponse &response)
{
QTC_ASSERT(response.resultClass == GdbResultDone, /**/)
QTC_CHECK(response.resultClass == GdbResultDone)
const BreakpointModelId id = response.cookie.value<BreakpointModelId>();
BreakHandler *handler = breakHandler();
BreakpointResponse br = handler->response(id);
......@@ -2714,7 +2714,7 @@ void GdbEngine::handleBreakIgnore(const GdbResponse &response)
// 29^done
//
// gdb 6.3 does not produce any console output
QTC_ASSERT(response.resultClass == GdbResultDone, /**/)
QTC_CHECK(response.resultClass == GdbResultDone)
//QString msg = _(response.consoleStreamOutput);
BreakpointModelId id = response.cookie.value<BreakpointModelId>();
BreakHandler *handler = breakHandler();
......@@ -2734,7 +2734,7 @@ void GdbEngine::handleBreakIgnore(const GdbResponse &response)
void GdbEngine::handleBreakCondition(const GdbResponse &response)
{
// Can happen at invalid condition strings.
//QTC_ASSERT(response.resultClass == GdbResultDone, /**/)
//QTC_CHECK(response.resultClass == GdbResultDone)
const BreakpointModelId id = response.cookie.value<BreakpointModelId>();
BreakHandler *handler = breakHandler();
// We just assume it was successful. Otherwise we had to parse
......@@ -2923,7 +2923,7 @@ void GdbEngine::insertBreakpoint(BreakpointModelId id)
// Set up fallback in case of pending breakpoints which aren't handled
// by the MI interface.
BreakHandler *handler = breakHandler();
QTC_ASSERT(handler->state(id) == BreakpointInsertRequested, /**/);
QTC_CHECK(handler->state(id) == BreakpointInsertRequested);
handler->notifyBreakpointInsertProceeding(id);
BreakpointType type = handler->type(id);
QVariant vid = QVariant::fromValue(id);
......@@ -3054,7 +3054,7 @@ void GdbEngine::changeBreakpoint(BreakpointModelId id)
void GdbEngine::removeBreakpoint(BreakpointModelId id)
{
BreakHandler *handler = breakHandler();
QTC_ASSERT(handler->state(id) == BreakpointRemoveRequested, /**/);
QTC_CHECK(handler->state(id) == BreakpointRemoveRequested);
handler->notifyBreakpointRemoveProceeding(id);
BreakpointResponse br = handler->response(id);
showMessage(_("DELETING BP %1 IN %2").arg(br.id.toString())
......@@ -3298,7 +3298,7 @@ void GdbEngine::reloadSourceFiles()
void GdbEngine::reloadSourceFilesInternal()
{
QTC_ASSERT(!m_sourcesListUpdating, /**/);
QTC_CHECK(!m_sourcesListUpdating);
m_sourcesListUpdating = true;
postCommand("-file-list-exec-source-files", NeedsStop, CB(handleQuerySources));
#if 0
......@@ -3328,7 +3328,7 @@ void GdbEngine::selectThread(int index)
void GdbEngine::handleStackSelectThread(const GdbResponse &)
{
QTC_ASSERT(state() == InferiorUnrunnable || state() == InferiorStopOk, /**/);
QTC_CHECK(state() == InferiorUnrunnable || state() == InferiorStopOk);
showStatusMessage(tr("Retrieving data for stack view..."), 3000);
reloadStack(true); // Will reload registers.
updateLocals();
......@@ -4871,7 +4871,7 @@ void GdbEngine::handleInferiorPrepared()
if (m_cookieForToken.isEmpty()) {
finishInferiorSetup();
} else {
QTC_ASSERT(m_commandsDoneCallback == 0, /**/);
QTC_CHECK(m_commandsDoneCallback == 0);
m_commandsDoneCallback = &GdbEngine::finishInferiorSetup;
}
}
......
......@@ -183,7 +183,7 @@ void GdbMi::parseValue(const char *&from, const char *to)
void GdbMi::parseTuple(const char *&from, const char *to)
{
//qDebug() << "parseTuple: " << QByteArray(from, to - from);
QTC_ASSERT(*from == '{', /**/);
QTC_CHECK(*from == '{');
++from;
parseTuple_helper(from, to);
}
......@@ -211,7 +211,7 @@ void GdbMi::parseTuple_helper(const char *&from, const char *to)
void GdbMi::parseList(const char *&from, const char *to)
{
//qDebug() << "parseList: " << QByteArray(from, to - from);
QTC_ASSERT(*from == '[', /**/);
QTC_CHECK(*from == '[');
++from;
m_type = List;
skipCommas(from, to);
......
......@@ -44,7 +44,7 @@
#include <utils/qtcassert.h>
#define PRECONDITION QTC_ASSERT(hasPython(), /**/)
#define PRECONDITION QTC_CHECK(hasPython())
#define CB(callback) &GdbEngine::callback, STRINGIFY(callback)
......@@ -200,7 +200,7 @@ void GdbEngine::updateAllPython()
{
PRECONDITION;
//PENDING_DEBUG("UPDATING ALL\n");
QTC_ASSERT(state() == InferiorUnrunnable || state() == InferiorStopOk, /**/);
QTC_CHECK(state() == InferiorUnrunnable || state() == InferiorStopOk);
reloadModulesInternal();
postCommand("-stack-list-frames", CB(handleStackListFrames),
QVariant::fromValue<StackCookie>(StackCookie(false, true)));
......
......@@ -59,7 +59,7 @@ MemoryRange::MemoryRange(uint f, uint t)
bool MemoryRange::intersects(const MemoryRange &other) const
{
Q_UNUSED(other);
QTC_ASSERT(false, /**/);
QTC_CHECK(false);
return false; // FIXME
}
......
......@@ -93,7 +93,7 @@ namespace { const int DataRange = 1024 * 1024; }
MemoryAgent::MemoryAgent(DebuggerEngine *engine)
: QObject(engine), m_engine(engine)
{
QTC_ASSERT(engine, /**/);
QTC_CHECK(engine);
connect(engine, SIGNAL(stateChanged(Debugger::DebuggerState)),
this, SLOT(engineStateChanged(Debugger::DebuggerState)));
connect(engine, SIGNAL(stackFrameCompleted()), this,
......
......@@ -338,7 +338,7 @@ bool PdbEngine::acceptsBreakpoint(BreakpointModelId id) const
void PdbEngine::insertBreakpoint(BreakpointModelId id)
{
BreakHandler *handler = breakHandler();
QTC_ASSERT(handler->state(id) == BreakpointInsertRequested, /**/);
QTC_CHECK(handler->state(id) == BreakpointInsertRequested);
handler->notifyBreakpointInsertProceeding(id);
QByteArray loc;
......@@ -374,7 +374,7 @@ void PdbEngine::handleBreakInsert(const PdbResponse &response)
void PdbEngine::removeBreakpoint(BreakpointModelId id)
{
BreakHandler *handler = breakHandler();
QTC_ASSERT(handler->state(id) == BreakpointRemoveRequested, /**/);
QTC_CHECK(handler->state(id) == BreakpointRemoveRequested);
handler->notifyBreakpointRemoveProceeding(id);
BreakpointResponse br = handler->response(id);
showMessage(_("DELETING BP %1 IN %2").arg(br.id.toString())
......
......@@ -317,7 +317,7 @@ void QmlCppEngine::detachDebugger()
void QmlCppEngine::executeStep()
{
if (d->m_activeEngine == d->m_qmlEngine) {
QTC_ASSERT(d->m_cppEngine->state() == InferiorRunOk, /**/);
QTC_CHECK(d->m_cppEngine->state() == InferiorRunOk);
if (d->m_cppEngine->setupQmlStep(true))
return; // Wait for callback to readyToExecuteQmlStep()
} else {
......
......@@ -883,7 +883,7 @@ void QmlEngine::messageReceived(const QByteArray &message)
foreach (BreakpointModelId id, handler->engineBreakpointIds(this)) {
QString processedFilename = handler->fileName(id);
if (processedFilename == file && handler->lineNumber(id) == line) {
QTC_ASSERT(handler->state(id) == BreakpointInserted,/**/);
QTC_CHECK(handler->state(id) == BreakpointInserted);
BreakpointResponse br = handler->response(id);
br.fileName = file;
br.lineNumber = line;
......
......@@ -246,7 +246,7 @@ void ScriptEngine::setupEngine()
showMessage(_("STARTING SCRIPT DEBUGGER"), LogMisc);
if (m_scriptEngine.isNull())
m_scriptEngine = Core::ICore::instance()->scriptManager()->scriptEngine();
QTC_ASSERT(!m_scriptAgent, /**/);
QTC_CHECK(!m_scriptAgent);
m_scriptAgent.reset(new ScriptAgent(this, m_scriptEngine.data()));
m_scriptEngine->setAgent(m_scriptAgent.data());
//m_scriptEngine->setAgent(new ScriptAgent(this, m_scriptEngine.data()));
......