Commit a48a686a authored by hjk's avatar hjk
Browse files

debugger: move script engine initialization to startDebugger()

parent f74d252b
......@@ -188,10 +188,9 @@ ScriptEngine::ScriptEngine(DebuggerManager *parent)
{
q = parent;
qq = parent->engineInterface();
m_scriptEngine = new QScriptEngine(this);
m_scriptAgent = new ScriptAgent(this, m_scriptEngine);
m_scriptEngine->setAgent(m_scriptAgent);
m_scriptEngine->setProcessEventsInterval(1 /*ms*/);
// created in startDebugger()
m_scriptEngine = 0;
m_scriptAgent = 0;
}
ScriptEngine::~ScriptEngine()
......@@ -220,6 +219,13 @@ void ScriptEngine::exitDebugger()
bool ScriptEngine::startDebugger(const QSharedPointer<DebuggerStartParameters> &sp)
{
if (!m_scriptEngine)
m_scriptEngine = new QScriptEngine(this);
if (!m_scriptAgent)
m_scriptAgent = new ScriptAgent(this, m_scriptEngine);
m_scriptEngine->setAgent(m_scriptAgent);
m_scriptEngine->setProcessEventsInterval(1 /*ms*/);
m_stopped = false;
m_stopOnNextLine = false;
m_scriptEngine->abortEvaluation();
......
......@@ -109,9 +109,9 @@ Runner::Runner()
m_gdbServerIP = "127.0.0.1";
m_gdbServerPort = QString::number(2222 + userId);
m_trkServerProc.setObjectName("TRKSERVER");
m_adapterProc.setObjectName("ADAPTER");
m_debuggerProc.setObjectName("GDB");
m_trkServerProc.setObjectName("TRKSERVER PROCESS");
m_adapterProc.setObjectName("ADAPTER PROCESS");
m_debuggerProc.setObjectName("GDB PROCESS");
connectProcess(&m_trkServerProc);
connectProcess(&m_adapterProc);
......@@ -319,13 +319,13 @@ void Runner::writeGdbInit()
void Runner::run()
{
launchAdapter();
if (m_isUnix) {
QProcess::execute("killall -s USR adapter trkserver");
QProcess::execute("killall adapter trkserver");
}
launchAdapter();
uid_t userId = getuid();
if (m_trkServerName.isEmpty())
m_trkServerName = QString("TRKSERVER-%1").arg(userId);
......@@ -408,7 +408,7 @@ int main(int argc, char *argv[])
QApplication app(argc, argv);
#if 1
QStringList args = QCoreApplication::arguments();
qDebug() << "ARGS: " << args;
qDebug() << "RUNNER ARGS: " << args;
#else
// Important options: -w wait for adapter, -af omit serial frame.
QStringList args = QStringList() << "-w" << "-af" << "COM5";
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment