Debugger: Let LldbEngine pass current token to dumper

Change-Id: Ifea751354f637f67e640d36ba1baa95678c86ee9
Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
hjk
2015-03-05 10:41:16 +01:00
parent a0f8a67d7a
commit b981f5049d
3 changed files with 31 additions and 9 deletions

View File

@@ -75,6 +75,12 @@ using namespace Utils;
namespace Debugger {
namespace Internal {
static int &currentToken()
{
static int token = 0;
return token;
}
///////////////////////////////////////////////////////////////////////
//
// LldbEngine
@@ -85,7 +91,6 @@ LldbEngine::LldbEngine(const DebuggerStartParameters &startParameters)
: DebuggerEngine(startParameters), m_continueAtNextSpontaneousStop(false)
{
m_lastAgentId = 0;
m_lastToken = 0;
setObjectName(QLatin1String("LldbEngine"));
if (startParameters.useTerminal) {
@@ -126,11 +131,13 @@ void LldbEngine::executeDebuggerCommand(const QString &command, DebuggerLanguage
runCommand(cmd);
}
void LldbEngine::runCommand(const DebuggerCommand &command)
void LldbEngine::runCommand(const DebuggerCommand &command_)
{
QTC_ASSERT(m_lldbProc.state() == QProcess::Running, notifyEngineIll());
++m_lastToken;
QByteArray token = QByteArray::number(m_lastToken);
const int tok = ++currentToken();
DebuggerCommand command = command_;
command.arg("token", tok);
QByteArray token = QByteArray::number(tok);
QByteArray cmd = command.function + "({" + command.args + "})";
showMessage(_(token + cmd + '\n'), LogInput);
m_lldbProc.write("script theDumper." + cmd + "\n");