Skip to content
Snippets Groups Projects
Commit 2a4db8a7 authored by hjk's avatar hjk
Browse files

debugger: make script debugger work again

parent 58adeb84
No related branches found
No related tags found
No related merge requests found
...@@ -1060,10 +1060,9 @@ void DebuggerManager::startNewDebugger(const DebuggerStartParametersPtr &sp) ...@@ -1060,10 +1060,9 @@ void DebuggerManager::startNewDebugger(const DebuggerStartParametersPtr &sp)
if (d->m_state != DebuggerNotReady) if (d->m_state != DebuggerNotReady)
return; return;
d->m_startParameters = sp; d->m_startParameters = sp;
d->m_inferiorPid = d->m_startParameters->attachPID > 0 d->m_inferiorPid = sp->attachPID > 0 ? sp->attachPID : 0;
? d->m_startParameters->attachPID : 0;
const QString toolChainName = ProjectExplorer::ToolChain::toolChainName( const QString toolChainName = ProjectExplorer::ToolChain::toolChainName(
ProjectExplorer::ToolChain::ToolChainType(d->m_startParameters->toolChainType)); ProjectExplorer::ToolChain::ToolChainType(sp->toolChainType));
d->m_plugin->activateDebugMode(); d->m_plugin->activateDebugMode();
showDebuggerOutput(LogStatus, showDebuggerOutput(LogStatus,
...@@ -1074,14 +1073,18 @@ void DebuggerManager::startNewDebugger(const DebuggerStartParametersPtr &sp) ...@@ -1074,14 +1073,18 @@ void DebuggerManager::startNewDebugger(const DebuggerStartParametersPtr &sp)
QString settingsIdHint; QString settingsIdHint;
// Figure out engine: toolchain, executable, attach or default // Figure out engine: toolchain, executable, attach or default
const DebuggerStartMode startMode = d->m_startParameters->startMode; const DebuggerStartMode startMode = sp->startMode;
d->m_engine = debuggerEngineForToolChain(d->m_startParameters->toolChainType);
if (sp->executable.endsWith(_(".js")))
d->m_engine = scriptEngine;
else
d->m_engine = debuggerEngineForToolChain(sp->toolChainType);
if (d->m_engine == 0 if (d->m_engine == 0
&& startMode != StartRemote && startMode != StartRemote
&& !d->m_startParameters->executable.isEmpty()) && !sp->executable.isEmpty())
d->m_engine = debuggerEngineForExecutable( d->m_engine = debuggerEngineForExecutable(
d->m_startParameters->executable, &errorMessage, &settingsIdHint); sp->executable, &errorMessage, &settingsIdHint);
if (d->m_engine == 0) if (d->m_engine == 0)
d->m_engine = debuggerEngineForMode(startMode, &errorMessage); d->m_engine = debuggerEngineForMode(startMode, &errorMessage);
...@@ -1089,18 +1092,18 @@ void DebuggerManager::startNewDebugger(const DebuggerStartParametersPtr &sp) ...@@ -1089,18 +1092,18 @@ void DebuggerManager::startNewDebugger(const DebuggerStartParametersPtr &sp)
if (!d->m_engine) { if (!d->m_engine) {
emit debuggingFinished(); emit debuggingFinished();
// Create Message box with possibility to go to settings // Create Message box with possibility to go to settings
const QString msg = tr("Cannot debug '%1' (tool chain: '%2'): %3"). const QString msg = tr("Cannot debug '%1' (tool chain: '%2'): %3")
arg(d->m_startParameters->executable, toolChainName, errorMessage); .arg(sp->executable, toolChainName, errorMessage);
Core::ICore::instance()->showWarningWithOptions(tr("Warning"), msg, QString(), Core::ICore::instance()->showWarningWithOptions(tr("Warning"), msg, QString(),
QLatin1String(DEBUGGER_SETTINGS_CATEGORY), settingsIdHint); QLatin1String(DEBUGGER_SETTINGS_CATEGORY), settingsIdHint);
return; return;
} }
STATE_DEBUG(d->m_startParameters->executable << d->m_engine); STATE_DEBUG(sp->executable << d->m_engine);
setBusyCursor(false); setBusyCursor(false);
setState(EngineStarting); setState(EngineStarting);
connect(d->m_engine, SIGNAL(startFailed()), this, SLOT(startFailed())); connect(d->m_engine, SIGNAL(startFailed()), this, SLOT(startFailed()));
d->m_engine->startDebugger(d->m_startParameters); d->m_engine->startDebugger(sp);
const unsigned engineCapabilities = d->m_engine->debuggerCapabilities(); const unsigned engineCapabilities = d->m_engine->debuggerCapabilities();
theDebuggerAction(OperateByInstruction) theDebuggerAction(OperateByInstruction)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment