本文整理汇总了C++中QTC_ASSERT函数的典型用法代码示例。如果您正苦于以下问题:C++ QTC_ASSERT函数的具体用法?C++ QTC_ASSERT怎么用?C++ QTC_ASSERT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了QTC_ASSERT函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QTC_ASSERT
void PlainGdbAdapter::handleExecRun(const GdbResponse &response)
{
if (response.resultClass == GdbResultRunning) {
QTC_ASSERT(state() == InferiorRunning, qDebug() << state());
debugMessage(_("INFERIOR STARTED"));
showStatusMessage(msgInferiorStarted());
} else {
QTC_ASSERT(state() == InferiorRunningRequested, qDebug() << state());
const QString &msg = QString::fromLocal8Bit(response.data.findChild("msg").data());
//QTC_ASSERT(status() == InferiorRunning, /**/);
//interruptInferior();
emit inferiorStartFailed(msg);
}
}
示例2: QTC_ASSERT
void GdbTermEngine::runEngine()
{
QTC_ASSERT(state() == EngineRunRequested, qDebug() << state());
const qint64 attachedPID = m_stubProc.applicationPID();
runCommand({"attach " + QByteArray::number(attachedPID), NoFlags,
[this](const DebuggerResponse &r) { handleStubAttached(r); }});
}
示例3: QTC_ASSERT
void GdbAttachEngine::setupInferior()
{
QTC_ASSERT(state() == InferiorSetupRequested, qDebug() << state());
// Task 254674 does not want to remove them
//qq->breakHandler()->removeAllBreakpoints();
handleInferiorPrepared();
}
示例4: QTC_ASSERT
void GdbAttachEngine::runEngine()
{
QTC_ASSERT(state() == EngineRunRequested, qDebug() << state());
showStatusMessage(tr("Attached to process %1.").arg(inferiorPid()));
notifyEngineRunAndInferiorStopOk();
handleStop1(GdbMi());
}
示例5: QTC_ASSERT
void LocalPlainGdbAdapter::startAdapter()
{
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
showMessage(_("TRYING TO START ADAPTER"));
if (!prepareCommand())
return;
QStringList gdbArgs;
if (!m_outputCollector.listen()) {
m_engine->handleAdapterStartFailed(tr("Cannot set up communication with child process: %1")
.arg(m_outputCollector.errorString()), QString());
return;
}
gdbArgs.append(_("--tty=") + m_outputCollector.serverName());
if (!startParameters().workingDirectory.isEmpty())
m_gdbProc.setWorkingDirectory(startParameters().workingDirectory);
if (startParameters().environment.size())
m_gdbProc.setEnvironment(startParameters().environment.toStringList());
if (!m_engine->startGdb(gdbArgs)) {
m_outputCollector.shutdown();
return;
}
checkForReleaseBuild();
m_engine->handleAdapterStarted();
}
示例6: QTC_ASSERT
void CoreGdbAdapter::handleTemporaryTargetCore(const GdbResponse &response)
{
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
if (response.resultClass != GdbResultDone) {
showMessage(tr("Attach to core failed."), StatusBar);
m_engine->notifyEngineSetupFailed();
return;
}
QByteArray console = response.consoleStreamOutput;
int pos1 = console.indexOf('`');
int pos2 = console.indexOf('\'');
if (pos1 == -1 || pos2 == -1) {
showMessage(tr("Attach to core failed."), StatusBar);
m_engine->notifyEngineSetupFailed();
return;
}
m_executable = console.mid(pos1 + 1, pos2 - pos1 - 1);
// Strip off command line arguments. FIXME: make robust.
int idx = m_executable.indexOf(_c(' '));
if (idx >= 0)
m_executable.truncate(idx);
if (m_executable.isEmpty()) {
m_engine->postCommand("detach");
m_engine->notifyEngineSetupFailed();
return;
}
m_executable = QFileInfo(startParameters().coreFile).absoluteDir()
.absoluteFilePath(m_executable);
showMessage(tr("Attached to core temporarily."), StatusBar);
m_engine->postCommand("detach", CB(handleTemporaryDetach));
}
示例7: QTC_ASSERT
void TermGdbAdapter::handleStubAttached(const GdbResponse &response)
{
QTC_ASSERT(state() == InferiorSetupRequested, qDebug() << state());
#ifdef Q_OS_WIN
QString errorMessage;
#endif // Q_OS_WIN
switch (response.resultClass) {
case GdbResultDone:
case GdbResultRunning:
#ifdef Q_OS_WIN
// Resume thread that was suspended by console stub process (see stub code).
if (winResumeThread(m_stubProc.applicationMainThreadID(), &errorMessage)) {
showMessage(QString::fromLatin1("Inferior attached, thread %1 resumed").
arg(m_stubProc.applicationMainThreadID()), LogMisc);
} else {
showMessage(QString::fromLatin1("Inferior attached, unable to resume thread %1: %2").
arg(m_stubProc.applicationMainThreadID()).arg(errorMessage),
LogWarning);
}
#else
showMessage(_("INFERIOR ATTACHED"));
#endif // Q_OS_WIN
m_engine->handleInferiorPrepared();
#ifdef Q_OS_LINUX
m_engine->postCommand("-stack-list-frames 0 0", CB(handleEntryPoint));
#endif
break;
case GdbResultError:
m_engine->notifyInferiorSetupFailed(QString::fromLocal8Bit(response.data.findChild("msg").data()));
break;
default:
m_engine->notifyInferiorSetupFailed(QString::fromLatin1("Invalid response %1").arg(response.resultClass));
break;
}
}
示例8: view
void RewriterTransaction::commit()
{
if (m_valid) {
m_valid = false;
RewriterView *rewriterView = view()->rewriterView();
QTC_ASSERT(rewriterView, qWarning() << Q_FUNC_INFO << "No rewriter attached");
bool oldSemanticChecks = false;
if (rewriterView) {
oldSemanticChecks = rewriterView->checkSemanticErrors();
if (m_ignoreSemanticChecks)
rewriterView->setCheckSemanticErrors(false);
}
view()->emitRewriterEndTransaction();
if (rewriterView)
view()->rewriterView()->setCheckSemanticErrors(oldSemanticChecks);
if (m_activeIdentifier) {
qDebug() << "Commit RewriterTransaction:" << m_identifier << m_identifierNumber;
bool success = m_identifierList.removeOne(m_identifier + QByteArrayLiteral("-") + QByteArray::number(m_identifierNumber));
Q_UNUSED(success);
Q_ASSERT(success);
}
}
}
示例9: QTC_ASSERT
void RemoteGdbServerAdapter::setupInferior()
{
QTC_ASSERT(state() == InferiorSetupRequested, qDebug() << state());
const DebuggerStartParameters &sp = startParameters();
QString fileName;
if (!sp.executable.isEmpty()) {
QFileInfo fi(sp.executable);
fileName = fi.absoluteFilePath();
}
const QByteArray sysroot = sp.sysroot.toLocal8Bit();
const QByteArray remoteArch = sp.remoteArchitecture.toLatin1();
const QByteArray gnuTarget = sp.gnuTarget.toLatin1();
const QByteArray searchPath = startParameters().searchPath.toLocal8Bit();
const QString args = sp.processArgs;
if (!remoteArch.isEmpty())
m_engine->postCommand("set architecture " + remoteArch);
if (!gnuTarget.isEmpty())
m_engine->postCommand("set gnutarget " + gnuTarget);
if (!sysroot.isEmpty())
m_engine->postCommand("set sysroot " + sysroot);
if (!searchPath.isEmpty())
m_engine->postCommand("set solib-search-path " + searchPath);
if (!args.isEmpty())
m_engine->postCommand("-exec-arguments " + args.toLocal8Bit());
// This has to be issued before 'target remote'. On pre-7.0 the
// command is not present and will result in ' No symbol table is
// loaded. Use the "file" command.' as gdb tries to set the
// value of a variable with name 'target-async'.
//
// Testing with -list-target-features which was introduced at
// the same time would not work either, as this need an existing
// target.
//
// Using it even without a target and having it fail might still
// be better as:
// Some external comment: '[but] "set target-async on" with a native
// windows gdb will work, but then fail when you actually do
// "run"/"attach", I think..
// gdb/mi/mi-main.c:1958: internal-error:
// mi_execute_async_cli_command: Assertion `is_running (inferior_ptid)'
// failed.\nA problem internal to GDB has been detected,[...]
if (debuggerCore()->boolSetting(TargetAsync))
m_engine->postCommand("set target-async on", CB(handleSetTargetAsync));
if (fileName.isEmpty()) {
showMessage(tr("No symbol file given."), StatusBar);
callTargetRemote();
return;
}
m_engine->postCommand("-file-exec-and-symbols \""
+ fileName.toLocal8Bit() + '"',
CB(handleFileExecAndSymbols));
}
示例10: QTC_ASSERT
void QmlProfilerClientManager::connectToTcpServer()
{
if (m_connection.isNull()) {
QTC_ASSERT(m_qmlclientplugin.isNull(), disconnectClient());
createConnection();
QTC_ASSERT(m_connection, emit connectionFailed(); return);
m_connection->connectToHost(m_tcpHost, m_tcpPort.number());
}
示例11: QTC_ASSERT
void ScriptEngine::continueInferior()
{
QTC_ASSERT(state() == InferiorStopOk, qDebug() << state());
notifyInferiorRunRequested();
SDEBUG("ScriptEngine::continueInferior()");
m_stopped = false;
m_stopOnNextLine = false;
}
示例12: QTC_ASSERT
QString QbsRunConfiguration::workingDirectory() const
{
ProjectExplorer::EnvironmentAspect *aspect
= extraAspect<ProjectExplorer::EnvironmentAspect>();
QTC_ASSERT(aspect, baseWorkingDirectory());
return QDir::cleanPath(aspect->environment().expandVariables(
Utils::expandMacros(baseWorkingDirectory(), macroExpander())));
}
示例13: QTC_ASSERT
void GdbCoreEngine::setupInferior()
{
QTC_ASSERT(state() == InferiorSetupRequested, qDebug() << state());
// Do that first, otherwise no symbols are loaded.
QFileInfo fi(m_executable);
QByteArray path = fi.absoluteFilePath().toLocal8Bit();
postCommand("-file-exec-and-symbols \"" + path + '"',
CB(handleFileExecAndSymbols));
}
示例14: QTC_ASSERT
void GdbPlainEngine::setupInferior()
{
QTC_ASSERT(state() == InferiorSetupRequested, qDebug() << state());
if (!startParameters().processArgs.isEmpty()) {
QString args = startParameters().processArgs;
postCommand("-exec-arguments " + toLocalEncoding(args));
}
postCommand("-file-exec-and-symbols \"" + execFilePath() + '"',
CB(handleFileExecAndSymbols));
}
示例15: QTC_ASSERT
void GdbPlainEngine::setupInferior()
{
QTC_ASSERT(state() == InferiorSetupRequested, qDebug() << state());
setEnvironmentVariables();
if (!runParameters().inferior.commandLineArguments.isEmpty()) {
QString args = runParameters().inferior.commandLineArguments;
runCommand({"-exec-arguments " + toLocalEncoding(args), NoFlags});
}
runCommand({"-file-exec-and-symbols \"" + execFilePath() + '"', NoFlags,
CB(handleFileExecAndSymbols)});
}