forked from qt-creator/qt-creator
Debugging: Pass a DebuggingLanguage arg in executeDebuggerCommand()
Change-Id: I99eedc86c987615072b7400051b61700b98ebab3 Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -1357,9 +1357,10 @@ void CdbEngine::handleThreads(const CdbExtensionCommandPtr &reply)
|
||||
}
|
||||
}
|
||||
|
||||
void CdbEngine::executeDebuggerCommand(const QString &command)
|
||||
void CdbEngine::executeDebuggerCommand(const QString &command, DebuggerLanguages languages)
|
||||
{
|
||||
postCommand(command.toLocal8Bit(), QuietCommand);
|
||||
if (languages & CppLanguage)
|
||||
postCommand(command.toLocal8Bit(), QuietCommand);
|
||||
}
|
||||
|
||||
// Post command without callback
|
||||
|
@@ -115,7 +115,7 @@ public:
|
||||
virtual void executeRunToFunction(const QString &functionName);
|
||||
virtual void executeJumpToLine(const ContextData &data);
|
||||
virtual void assignValueInDebugger(const WatchData *w, const QString &expr, const QVariant &value);
|
||||
virtual void executeDebuggerCommand(const QString &command);
|
||||
virtual void executeDebuggerCommand(const QString &command, DebuggerLanguages languages);
|
||||
|
||||
virtual void activateFrame(int index);
|
||||
virtual void selectThread(int index);
|
||||
|
@@ -118,7 +118,7 @@ public:
|
||||
const QVector<Symbol> &symbols) = 0;
|
||||
virtual void openMemoryEditor() = 0;
|
||||
virtual void languagesChanged() = 0;
|
||||
virtual void executeDebuggerCommand(const QString &command) = 0;
|
||||
virtual void executeDebuggerCommand(const QString &command, DebuggerLanguages languages) = 0;
|
||||
virtual bool evaluateScriptExpression(const QString &expression) = 0;
|
||||
|
||||
virtual Utils::SavedAction *action(int code) const = 0;
|
||||
|
@@ -1674,7 +1674,7 @@ void DebuggerEngine::executeJumpToLine(const ContextData &)
|
||||
{
|
||||
}
|
||||
|
||||
void DebuggerEngine::executeDebuggerCommand(const QString &)
|
||||
void DebuggerEngine::executeDebuggerCommand(const QString &, DebuggerLanguages)
|
||||
{
|
||||
showStatusMessage(tr("This debugger cannot handle user input."));
|
||||
}
|
||||
|
@@ -362,7 +362,7 @@ protected:
|
||||
virtual void executeRunToLine(const Internal::ContextData &data);
|
||||
virtual void executeRunToFunction(const QString &functionName);
|
||||
virtual void executeJumpToLine(const Internal::ContextData &data);
|
||||
virtual void executeDebuggerCommand(const QString &command);
|
||||
virtual void executeDebuggerCommand(const QString &command, DebuggerLanguages languages);
|
||||
virtual bool evaluateScriptExpression(const QString &expression);
|
||||
|
||||
virtual void frameUp();
|
||||
|
@@ -846,7 +846,7 @@ public slots:
|
||||
void aboutToUnloadSession();
|
||||
void aboutToSaveSession();
|
||||
|
||||
void executeDebuggerCommand(const QString &command);
|
||||
void executeDebuggerCommand(const QString &command, DebuggerLanguages languages);
|
||||
bool evaluateScriptExpression(const QString &expression);
|
||||
void coreShutdown();
|
||||
|
||||
@@ -2526,10 +2526,10 @@ void DebuggerPluginPrivate::aboutToSaveSession()
|
||||
m_breakHandler->saveSessionData();
|
||||
}
|
||||
|
||||
void DebuggerPluginPrivate::executeDebuggerCommand(const QString &command)
|
||||
void DebuggerPluginPrivate::executeDebuggerCommand(const QString &command, DebuggerLanguages languages)
|
||||
{
|
||||
if (currentEngine()->acceptsDebuggerCommands())
|
||||
currentEngine()->executeDebuggerCommand(command);
|
||||
currentEngine()->executeDebuggerCommand(command, languages);
|
||||
else
|
||||
showStatusMessage(tr("User commands are not accepted in the current state."));
|
||||
}
|
||||
|
@@ -1234,8 +1234,10 @@ bool GdbEngine::acceptsDebuggerCommands() const
|
||||
|| state() == InferiorUnrunnable;
|
||||
}
|
||||
|
||||
void GdbEngine::executeDebuggerCommand(const QString &command)
|
||||
void GdbEngine::executeDebuggerCommand(const QString &command, DebuggerLanguages languages)
|
||||
{
|
||||
if (!(languages & CppLanguage))
|
||||
return;
|
||||
QTC_CHECK(acceptsDebuggerCommands());
|
||||
GdbCommand cmd;
|
||||
cmd.command = command.toLatin1();
|
||||
|
@@ -242,7 +242,7 @@ private: ////////// General Interface //////////
|
||||
virtual void abortDebugger();
|
||||
|
||||
virtual bool acceptsDebuggerCommands() const;
|
||||
virtual void executeDebuggerCommand(const QString &command);
|
||||
virtual void executeDebuggerCommand(const QString &command, DebuggerLanguages languages);
|
||||
virtual QByteArray qtNamespace() const { return m_dumperHelper.qtNamespace(); }
|
||||
virtual void setQtNamespace(const QByteArray &ns)
|
||||
{ return m_dumperHelper.setQtNamespace(ns); }
|
||||
|
@@ -389,12 +389,13 @@ LogWindow::LogWindow(QWidget *parent)
|
||||
void LogWindow::executeLine()
|
||||
{
|
||||
m_ignoreNextInputEcho = true;
|
||||
debuggerCore()->executeDebuggerCommand(m_inputText->textCursor().block().text());
|
||||
debuggerCore()->executeDebuggerCommand(m_inputText->textCursor().block().text(),
|
||||
CppLanguage);
|
||||
}
|
||||
|
||||
void LogWindow::sendCommand()
|
||||
{
|
||||
debuggerCore()->executeDebuggerCommand(m_commandEdit->text());
|
||||
debuggerCore()->executeDebuggerCommand(m_commandEdit->text(), CppLanguage);
|
||||
}
|
||||
|
||||
void LogWindow::showOutput(int channel, const QString &output)
|
||||
|
@@ -98,8 +98,10 @@ PdbEngine::PdbEngine(const DebuggerStartParameters &startParameters)
|
||||
PdbEngine::~PdbEngine()
|
||||
{}
|
||||
|
||||
void PdbEngine::executeDebuggerCommand(const QString &command)
|
||||
void PdbEngine::executeDebuggerCommand(const QString &command, DebuggerLanguages languages)
|
||||
{
|
||||
if (!(languages & CppLanguage))
|
||||
return;
|
||||
QTC_ASSERT(state() == InferiorStopOk, qDebug() << state());
|
||||
//XSDEBUG("PdbEngine::executeDebuggerCommand:" << command);
|
||||
if (state() == DebuggerNotReady) {
|
||||
|
@@ -97,7 +97,7 @@ private:
|
||||
|
||||
void assignValueInDebugger(const WatchData *data,
|
||||
const QString &expr, const QVariant &value);
|
||||
void executeDebuggerCommand(const QString &command);
|
||||
void executeDebuggerCommand(const QString &command, DebuggerLanguages languages);
|
||||
|
||||
void loadSymbols(const QString &moduleName);
|
||||
void loadAllSymbols();
|
||||
|
@@ -409,13 +409,10 @@ void QmlCppEngine::executeJumpToLine(const ContextData &data)
|
||||
d->m_activeEngine->executeJumpToLine(data);
|
||||
}
|
||||
|
||||
void QmlCppEngine::executeDebuggerCommand(const QString &command)
|
||||
void QmlCppEngine::executeDebuggerCommand(const QString &command, DebuggerLanguages languages)
|
||||
{
|
||||
if (d->m_qmlEngine->state() == InferiorStopOk) {
|
||||
d->m_qmlEngine->executeDebuggerCommand(command);
|
||||
} else {
|
||||
d->m_cppEngine->executeDebuggerCommand(command);
|
||||
}
|
||||
d->m_qmlEngine->executeDebuggerCommand(command, languages);
|
||||
d->m_cppEngine->executeDebuggerCommand(command, languages);
|
||||
}
|
||||
|
||||
bool QmlCppEngine::evaluateScriptExpression(const QString &expression)
|
||||
|
@@ -116,7 +116,7 @@ protected:
|
||||
void executeRunToLine(const ContextData &data);
|
||||
void executeRunToFunction(const QString &functionName);
|
||||
void executeJumpToLine(const ContextData &data);
|
||||
void executeDebuggerCommand(const QString &command);
|
||||
void executeDebuggerCommand(const QString &command, DebuggerLanguages languages);
|
||||
bool evaluateScriptExpression(const QString &expression);
|
||||
|
||||
void setupEngine();
|
||||
|
@@ -1141,9 +1141,9 @@ void QmlEngine::appendDebugOutput(QtMsgType type, const QString &message,
|
||||
qtMessageLogHandler()->appendItem(item);
|
||||
}
|
||||
|
||||
void QmlEngine::executeDebuggerCommand(const QString& command)
|
||||
void QmlEngine::executeDebuggerCommand(const QString &command, DebuggerLanguages languages)
|
||||
{
|
||||
if (d->m_adapter.activeDebuggerClient()) {
|
||||
if ((languages & QmlLanguage) && d->m_adapter.activeDebuggerClient()) {
|
||||
d->m_adapter.activeDebuggerClient()->executeDebuggerCommand(command);
|
||||
}
|
||||
}
|
||||
@@ -1183,7 +1183,7 @@ bool QmlEngine::evaluateScriptExpression(const QString& expression)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
executeDebuggerCommand(expression);
|
||||
executeDebuggerCommand(expression, QmlLanguage);
|
||||
}
|
||||
} else {
|
||||
didEvaluate = false;
|
||||
|
@@ -151,7 +151,7 @@ private:
|
||||
bool supportsThreads() const { return false; }
|
||||
void updateWatchData(const WatchData &data,
|
||||
const WatchUpdateFlags &flags);
|
||||
void executeDebuggerCommand(const QString &command);
|
||||
void executeDebuggerCommand(const QString &command, DebuggerLanguages languages);
|
||||
bool evaluateScriptExpression(const QString &expression);
|
||||
|
||||
bool hasCapability(unsigned) const;
|
||||
|
@@ -214,9 +214,10 @@ ScriptEngine::~ScriptEngine()
|
||||
{
|
||||
}
|
||||
|
||||
void ScriptEngine::executeDebuggerCommand(const QString &command)
|
||||
void ScriptEngine::executeDebuggerCommand(const QString &command, DebuggerLanguages languages)
|
||||
{
|
||||
Q_UNUSED(command)
|
||||
Q_UNUSED(languages)
|
||||
XSDEBUG("FIXME: ScriptEngine::executeDebuggerCommand()");
|
||||
}
|
||||
|
||||
|
@@ -95,7 +95,7 @@ private:
|
||||
|
||||
void assignValueInDebugger(const WatchData *w,
|
||||
const QString &expr, const QVariant &value);
|
||||
void executeDebuggerCommand(const QString &command);
|
||||
void executeDebuggerCommand(const QString &command, DebuggerLanguages languages);
|
||||
|
||||
void loadSymbols(const QString &moduleName);
|
||||
void loadAllSymbols();
|
||||
|
Reference in New Issue
Block a user