ios simulator debugging

Change-Id: Ieee4a509b46da937c3bce21f72c77685946db4dd
Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
Fawzi Mohamed
2013-10-10 15:15:49 +02:00
committed by hjk
parent dc5ba1127d
commit c162ba1391
12 changed files with 213 additions and 28 deletions

View File

@@ -32,6 +32,7 @@
#include <debugger/debuggeractions.h>
#include <debugger/debuggercore.h>
#include <debugger/debuggerdialogs.h>
#include <debugger/debuggerinternalconstants.h>
#include <debugger/debuggerplugin.h>
#include <debugger/debuggerprotocol.h>
#include <debugger/debuggerstartparameters.h>
@@ -66,9 +67,6 @@
#include <QMessageBox>
#include <QToolTip>
#include <stdio.h>
namespace Debugger {
namespace Internal {
@@ -131,9 +129,16 @@ void LldbEngine::shutdownEngine()
void LldbEngine::setupEngine()
{
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
if (startParameters().remoteSetupNeeded) {
notifyEngineRequestRemoteSetup();
} else {
startLldb();
}
}
void LldbEngine::startLldb()
{
m_lldbCmd = startParameters().debuggerCommand;
connect(&m_lldbProc, SIGNAL(error(QProcess::ProcessError)),
SLOT(handleLldbError(QProcess::ProcessError)));
connect(&m_lldbProc, SIGNAL(finished(int,QProcess::ExitStatus)),
@@ -170,9 +175,14 @@ void LldbEngine::setupInferior()
const DebuggerStartParameters &sp = startParameters();
Command cmd("setupInferior");
cmd.arg("executable", QFileInfo(sp.executable).absoluteFilePath());
cmd.arg("startMode", sp.startMode);
cmd.arg("startMode", sp.startMode); // directly relying on this is brittle wrt. insertions, so check it here
cmd.arg("processArgs", sp.processArgs);
cmd.arg("attachPid", sp.attachPID);
cmd.arg("attachPid", ((sp.startMode == AttachCrashedExternal || sp.startMode == AttachExternal)
? sp.attachPID : 0));
cmd.arg("sysRoot", sp.sysRoot);
cmd.arg("remoteChannel", ((sp.startMode == AttachToRemoteProcess || sp.startMode == AttachToRemoteServer)
? sp.remoteChannel : QString()));
runCommand(cmd);
requestUpdateWatchers();
}
@@ -1107,6 +1117,39 @@ DebuggerEngine *createLldbEngine(const DebuggerStartParameters &startParameters)
return new LldbEngine(startParameters);
}
void LldbEngine::notifyEngineRemoteSetupDone(int portOrPid, int qmlPort)
{
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
DebuggerEngine::notifyEngineRemoteSetupDone(portOrPid, qmlPort);
if (qmlPort != -1)
startParameters().qmlServerPort = qmlPort;
if (portOrPid != -1) {
if (startParameters().startMode == AttachExternal) {
startParameters().attachPID = portOrPid;
} else {
QString &rc = startParameters().remoteChannel;
const int sepIndex = rc.lastIndexOf(QLatin1Char(':'));
if (sepIndex != -1) {
rc.replace(sepIndex + 1, rc.count() - sepIndex - 1,
QString::number(portOrPid));
}
}
}
startLldb();
}
void LldbEngine::notifyEngineRemoteSetupFailed(const QString &reason)
{
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
DebuggerEngine::notifyEngineRemoteSetupFailed(reason);
showMessage(_("ADAPTER START FAILED"));
if (!reason.isEmpty()) {
const QString title = tr("Adapter start failed");
Core::ICore::showWarningWithOptions(title, reason);
}
notifyEngineSetupFailed();
}
///////////////////////////////////////////////////////////////////////
//