forked from qt-creator/qt-creator
debugger: work on trk integration
This commit is contained in:
@@ -563,11 +563,11 @@ void CdbDebugEnginePrivate::clearDisplay()
|
|||||||
m_debuggerManagerAccess->registerHandler()->removeAll();
|
m_debuggerManagerAccess->registerHandler()->removeAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CdbDebugEngine::startDebugger(const QSharedPointer<DebuggerStartParameters> &sp)
|
void CdbDebugEngine::startDebugger(const QSharedPointer<DebuggerStartParameters> &sp)
|
||||||
{
|
{
|
||||||
if (m_d->m_hDebuggeeProcess) {
|
if (m_d->m_hDebuggeeProcess) {
|
||||||
warning(QLatin1String("Internal error: Attempt to start debugger while another process is being debugged."));
|
warning(QLatin1String("Internal error: Attempt to start debugger while another process is being debugged."));
|
||||||
return false;
|
emit startFailed();
|
||||||
}
|
}
|
||||||
m_d->clearDisplay();
|
m_d->clearDisplay();
|
||||||
|
|
||||||
@@ -627,7 +627,11 @@ bool CdbDebugEngine::startDebugger(const QSharedPointer<DebuggerStartParameters>
|
|||||||
} else {
|
} else {
|
||||||
warning(errorMessage);
|
warning(errorMessage);
|
||||||
}
|
}
|
||||||
return rc;
|
|
||||||
|
if (rc)
|
||||||
|
emit startSuccessful();
|
||||||
|
else
|
||||||
|
emit startFailed();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CdbDebugEngine::startAttachDebugger(qint64 pid, DebuggerStartMode sm, QString *errorMessage)
|
bool CdbDebugEngine::startAttachDebugger(qint64 pid, DebuggerStartMode sm, QString *errorMessage)
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ public:
|
|||||||
|
|
||||||
virtual void shutdown();
|
virtual void shutdown();
|
||||||
virtual void setToolTipExpression(const QPoint &mousePos, TextEditor::ITextEditor *editor, int cursorPos);
|
virtual void setToolTipExpression(const QPoint &mousePos, TextEditor::ITextEditor *editor, int cursorPos);
|
||||||
virtual bool startDebugger(const QSharedPointer<DebuggerStartParameters> &startParameters);
|
virtual void startDebugger(const QSharedPointer<DebuggerStartParameters> &startParameters);
|
||||||
virtual void exitDebugger();
|
virtual void exitDebugger();
|
||||||
virtual void detachDebugger();
|
virtual void detachDebugger();
|
||||||
virtual void updateWatchData(const WatchData &data);
|
virtual void updateWatchData(const WatchData &data);
|
||||||
|
|||||||
@@ -182,9 +182,10 @@ void DebuggerStartParameters::clear()
|
|||||||
///////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
static IDebuggerEngine *gdbEngine = 0;
|
static IDebuggerEngine *gdbEngine = 0;
|
||||||
static IDebuggerEngine *winEngine = 0;
|
|
||||||
static IDebuggerEngine *scriptEngine = 0;
|
static IDebuggerEngine *scriptEngine = 0;
|
||||||
|
static IDebuggerEngine *symbianEngine = 0;
|
||||||
static IDebuggerEngine *tcfEngine = 0;
|
static IDebuggerEngine *tcfEngine = 0;
|
||||||
|
static IDebuggerEngine *winEngine = 0;
|
||||||
|
|
||||||
DebuggerManager::DebuggerManager()
|
DebuggerManager::DebuggerManager()
|
||||||
: m_startParameters(new DebuggerStartParameters),
|
: m_startParameters(new DebuggerStartParameters),
|
||||||
@@ -197,9 +198,10 @@ DebuggerManager::~DebuggerManager()
|
|||||||
{
|
{
|
||||||
#define doDelete(ptr) delete ptr; ptr = 0
|
#define doDelete(ptr) delete ptr; ptr = 0
|
||||||
doDelete(gdbEngine);
|
doDelete(gdbEngine);
|
||||||
doDelete(winEngine);
|
|
||||||
doDelete(scriptEngine);
|
doDelete(scriptEngine);
|
||||||
|
doDelete(symbianEngine);
|
||||||
doDelete(tcfEngine);
|
doDelete(tcfEngine);
|
||||||
|
doDelete(winEngine);
|
||||||
#undef doDelete
|
#undef doDelete
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -446,6 +448,8 @@ QList<Core::IOptionsPage*> DebuggerManager::initializeEngines(unsigned enabledTy
|
|||||||
QList<Core::IOptionsPage*> rc;
|
QList<Core::IOptionsPage*> rc;
|
||||||
if (enabledTypeFlags & GdbEngineType)
|
if (enabledTypeFlags & GdbEngineType)
|
||||||
gdbEngine = createGdbEngine(this, &rc);
|
gdbEngine = createGdbEngine(this, &rc);
|
||||||
|
if (enabledTypeFlags & SymbianEngineType)
|
||||||
|
symbianEngine = createSymbianEngine(this, &rc);
|
||||||
winEngine = createWinEngine(this, (enabledTypeFlags & CdbEngineType), &rc);
|
winEngine = createWinEngine(this, (enabledTypeFlags & CdbEngineType), &rc);
|
||||||
if (enabledTypeFlags & ScriptEngineType)
|
if (enabledTypeFlags & ScriptEngineType)
|
||||||
scriptEngine = createScriptEngine(this, &rc);
|
scriptEngine = createScriptEngine(this, &rc);
|
||||||
@@ -695,9 +699,10 @@ void DebuggerManager::updateWatchData(const WatchData &data)
|
|||||||
m_engine->updateWatchData(data);
|
m_engine->updateWatchData(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline QString msgEngineNotAvailable(const char *engine)
|
static QString msgEngineNotAvailable(const char *engine)
|
||||||
{
|
{
|
||||||
return DebuggerManager::tr("The application requires the debugger engine '%1', which is disabled.").arg(QLatin1String(engine));
|
return DebuggerManager::tr("The application requires the debugger engine '%1', "
|
||||||
|
"which is disabled.").arg(QLatin1String(engine));
|
||||||
}
|
}
|
||||||
|
|
||||||
static IDebuggerEngine *debuggerEngineForToolChain(ProjectExplorer::ToolChain::ToolChainType tc)
|
static IDebuggerEngine *debuggerEngineForToolChain(ProjectExplorer::ToolChain::ToolChainType tc)
|
||||||
@@ -739,7 +744,16 @@ static IDebuggerEngine *determineDebuggerEngine(const QString &executable,
|
|||||||
return scriptEngine;
|
return scriptEngine;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IDebuggerEngine *tce = debuggerEngineForToolChain(static_cast<ProjectExplorer::ToolChain::ToolChainType>(toolChainType)))
|
if (executable.endsWith(_(".sym"))) {
|
||||||
|
if (!symbianEngine) {
|
||||||
|
*errorMessage = msgEngineNotAvailable("Symbian Engine");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return symbianEngine;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (IDebuggerEngine *tce = debuggerEngineForToolChain(
|
||||||
|
static_cast<ProjectExplorer::ToolChain::ToolChainType>(toolChainType)))
|
||||||
return tce;
|
return tce;
|
||||||
|
|
||||||
#ifndef Q_OS_WIN
|
#ifndef Q_OS_WIN
|
||||||
@@ -774,7 +788,8 @@ static IDebuggerEngine *determineDebuggerEngine(int /* pid */,
|
|||||||
int toolChainType,
|
int toolChainType,
|
||||||
QString *errorMessage)
|
QString *errorMessage)
|
||||||
{
|
{
|
||||||
if (IDebuggerEngine *tce = debuggerEngineForToolChain(static_cast<ProjectExplorer::ToolChain::ToolChainType>(toolChainType)))
|
if (IDebuggerEngine *tce = debuggerEngineForToolChain(
|
||||||
|
static_cast<ProjectExplorer::ToolChain::ToolChainType>(toolChainType)))
|
||||||
return tce;
|
return tce;
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
// Preferably Windows debugger
|
// Preferably Windows debugger
|
||||||
@@ -846,11 +861,15 @@ void DebuggerManager::startNewDebugger(DebuggerRunControl *runControl,
|
|||||||
|
|
||||||
setBusyCursor(false);
|
setBusyCursor(false);
|
||||||
setStatus(DebuggerProcessStartingUp);
|
setStatus(DebuggerProcessStartingUp);
|
||||||
if (!m_engine->startDebugger(m_startParameters)) {
|
connect(m_engine, SIGNAL(startFailed()), this, SLOT(startFailed()));
|
||||||
|
m_engine->startDebugger(m_startParameters);
|
||||||
|
}
|
||||||
|
|
||||||
|
void DebuggerManager::startFailed()
|
||||||
|
{
|
||||||
|
disconnect(m_engine, SIGNAL(startFailed()), this, SLOT(startFailed()));
|
||||||
setStatus(DebuggerProcessNotReady);
|
setStatus(DebuggerProcessNotReady);
|
||||||
debuggingFinished();
|
debuggingFinished();
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DebuggerManager::cleanupViews()
|
void DebuggerManager::cleanupViews()
|
||||||
|
|||||||
@@ -172,12 +172,18 @@ class CdbDebugEngine;
|
|||||||
struct CdbDebugEnginePrivate;
|
struct CdbDebugEnginePrivate;
|
||||||
|
|
||||||
// Flags for initialization
|
// Flags for initialization
|
||||||
enum DebuggerEngineTypeFlags {
|
enum DebuggerEngineTypeFlags
|
||||||
GdbEngineType = 0x1,
|
{
|
||||||
ScriptEngineType = 0x2,
|
GdbEngineType = 0x01,
|
||||||
CdbEngineType = 0x4,
|
ScriptEngineType = 0x02,
|
||||||
TcfEngineType = 0x8,
|
CdbEngineType = 0x04,
|
||||||
AllEngineTypes = (GdbEngineType|ScriptEngineType|CdbEngineType|TcfEngineType)
|
TcfEngineType = 0x08,
|
||||||
|
SymbianEngineType = 0x10,
|
||||||
|
AllEngineTypes = GdbEngineType
|
||||||
|
| ScriptEngineType
|
||||||
|
| CdbEngineType
|
||||||
|
| TcfEngineType
|
||||||
|
| SymbianEngineType
|
||||||
};
|
};
|
||||||
|
|
||||||
// The construct below is not nice but enforces a bit of order. The
|
// The construct below is not nice but enforces a bit of order. The
|
||||||
@@ -324,6 +330,8 @@ public slots:
|
|||||||
void showStatusMessage(const QString &msg, int timeout = -1); // -1 forever
|
void showStatusMessage(const QString &msg, int timeout = -1); // -1 forever
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
void showDebuggerOutput(const QString &msg)
|
||||||
|
{ showDebuggerOutput(LogDebug, msg); }
|
||||||
void showDebuggerOutput(int channel, const QString &msg);
|
void showDebuggerOutput(int channel, const QString &msg);
|
||||||
void showDebuggerInput(int channel, const QString &msg);
|
void showDebuggerInput(int channel, const QString &msg);
|
||||||
void showApplicationOutput(const QString &data);
|
void showApplicationOutput(const QString &data);
|
||||||
@@ -343,6 +351,7 @@ private slots:
|
|||||||
void attemptBreakpointSynchronization();
|
void attemptBreakpointSynchronization();
|
||||||
void reloadFullStack();
|
void reloadFullStack();
|
||||||
void stepByInstructionTriggered();
|
void stepByInstructionTriggered();
|
||||||
|
void startFailed();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -180,6 +180,8 @@ void GdbEngine::initializeConnections()
|
|||||||
this, SLOT(readGdbStandardError()));
|
this, SLOT(readGdbStandardError()));
|
||||||
connect(m_gdbProc, SIGNAL(finished(int, QProcess::ExitStatus)),
|
connect(m_gdbProc, SIGNAL(finished(int, QProcess::ExitStatus)),
|
||||||
q, SLOT(exitDebugger()));
|
q, SLOT(exitDebugger()));
|
||||||
|
connect(m_gdbProc, SIGNAL(started()),
|
||||||
|
this, SLOT(startDebugger2()));
|
||||||
|
|
||||||
connect(&m_stubProc, SIGNAL(processError(QString)),
|
connect(&m_stubProc, SIGNAL(processError(QString)),
|
||||||
this, SLOT(stubError(QString)));
|
this, SLOT(stubError(QString)));
|
||||||
@@ -1440,7 +1442,8 @@ void GdbEngine::exitDebugger()
|
|||||||
if (m_gdbProc->state() == QProcess::Starting) {
|
if (m_gdbProc->state() == QProcess::Starting) {
|
||||||
debugMessage(_("WAITING FOR GDB STARTUP TO SHUTDOWN: %1")
|
debugMessage(_("WAITING FOR GDB STARTUP TO SHUTDOWN: %1")
|
||||||
.arg(m_gdbProc->state()));
|
.arg(m_gdbProc->state()));
|
||||||
m_gdbProc->waitForStarted();
|
// FIXME: handle this!
|
||||||
|
//m_gdbProc->waitForStarted();
|
||||||
}
|
}
|
||||||
if (m_gdbProc->state() == QProcess::Running) {
|
if (m_gdbProc->state() == QProcess::Running) {
|
||||||
debugMessage(_("WAITING FOR RUNNING GDB TO SHUTDOWN: %1")
|
debugMessage(_("WAITING FOR RUNNING GDB TO SHUTDOWN: %1")
|
||||||
@@ -1481,8 +1484,9 @@ int GdbEngine::currentFrame() const
|
|||||||
return qq->stackHandler()->currentIndex();
|
return qq->stackHandler()->currentIndex();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GdbEngine::startDebugger(const QSharedPointer<DebuggerStartParameters> &sp)
|
void GdbEngine::startDebugger(const QSharedPointer<DebuggerStartParameters> &sp)
|
||||||
{
|
{
|
||||||
|
m_startParameters = *sp;
|
||||||
// This should be set by the constructor or in exitDebugger().
|
// This should be set by the constructor or in exitDebugger().
|
||||||
QTC_ASSERT(m_debuggingHelperState == DebuggingHelperUninitialized,
|
QTC_ASSERT(m_debuggingHelperState == DebuggingHelperUninitialized,
|
||||||
initializeVariables());
|
initializeVariables());
|
||||||
@@ -1492,7 +1496,8 @@ bool GdbEngine::startDebugger(const QSharedPointer<DebuggerStartParameters> &sp)
|
|||||||
if (m_gdbProc->state() != QProcess::NotRunning) {
|
if (m_gdbProc->state() != QProcess::NotRunning) {
|
||||||
debugMessage(_("GDB IS ALREADY RUNNING, STATE: %1").arg(m_gdbProc->state()));
|
debugMessage(_("GDB IS ALREADY RUNNING, STATE: %1").arg(m_gdbProc->state()));
|
||||||
m_gdbProc->kill();
|
m_gdbProc->kill();
|
||||||
return false;
|
emit startFailed();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//gdbArgs.prepend(_("--quiet"));
|
//gdbArgs.prepend(_("--quiet"));
|
||||||
@@ -1503,37 +1508,42 @@ bool GdbEngine::startDebugger(const QSharedPointer<DebuggerStartParameters> &sp)
|
|||||||
// nothing to do
|
// nothing to do
|
||||||
} else if (q->startMode() == StartRemote) {
|
} else if (q->startMode() == StartRemote) {
|
||||||
// Start the remote server
|
// Start the remote server
|
||||||
if (sp->serverStartScript.isEmpty()) {
|
if (m_startParameters.serverStartScript.isEmpty()) {
|
||||||
q->showStatusMessage(_("No server start script given. "
|
q->showStatusMessage(_("No server start script given. "
|
||||||
"Assuming server runs already."));
|
"Assuming server runs already."));
|
||||||
} else {
|
} else {
|
||||||
if (!sp->workingDir.isEmpty())
|
if (!m_startParameters.workingDir.isEmpty())
|
||||||
m_uploadProc.setWorkingDirectory(sp->workingDir);
|
m_uploadProc.setWorkingDirectory(m_startParameters.workingDir);
|
||||||
if (!sp->environment.isEmpty())
|
if (!m_startParameters.environment.isEmpty())
|
||||||
m_uploadProc.setEnvironment(sp->environment);
|
m_uploadProc.setEnvironment(m_startParameters.environment);
|
||||||
m_uploadProc.start(_("/bin/sh ") + sp->serverStartScript);
|
m_uploadProc.start(_("/bin/sh ") + m_startParameters.serverStartScript);
|
||||||
m_uploadProc.waitForStarted();
|
m_uploadProc.waitForStarted();
|
||||||
}
|
}
|
||||||
} else if (sp->useTerminal) {
|
} else if (m_startParameters.useTerminal) {
|
||||||
m_stubProc.stop(); // We leave the console open, so recycle it now.
|
m_stubProc.stop(); // We leave the console open, so recycle it now.
|
||||||
|
|
||||||
m_stubProc.setWorkingDirectory(sp->workingDir);
|
m_stubProc.setWorkingDirectory(m_startParameters.workingDir);
|
||||||
m_stubProc.setEnvironment(sp->environment);
|
m_stubProc.setEnvironment(m_startParameters.environment);
|
||||||
if (!m_stubProc.start(sp->executable, sp->processArgs))
|
if (!m_stubProc.start(m_startParameters.executable,
|
||||||
return false; // Error message for user is delivered via a signal.
|
m_startParameters.processArgs)) {
|
||||||
|
// Error message for user is delivered via a signal.
|
||||||
|
emit startFailed();
|
||||||
|
return;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!m_outputCollector.listen()) {
|
if (!m_outputCollector.listen()) {
|
||||||
QMessageBox::critical(q->mainWindow(), tr("Debugger Startup Failure"),
|
QMessageBox::critical(q->mainWindow(), tr("Debugger Startup Failure"),
|
||||||
tr("Cannot set up communication with child process: %1")
|
tr("Cannot set up communication with child process: %1")
|
||||||
.arg(m_outputCollector.errorString()));
|
.arg(m_outputCollector.errorString()));
|
||||||
return false;
|
emit startFailed();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
gdbArgs.prepend(_("--tty=") + m_outputCollector.serverName());
|
gdbArgs.prepend(_("--tty=") + m_outputCollector.serverName());
|
||||||
|
|
||||||
if (!sp->workingDir.isEmpty())
|
if (!m_startParameters.workingDir.isEmpty())
|
||||||
m_gdbProc->setWorkingDirectory(sp->workingDir);
|
m_gdbProc->setWorkingDirectory(m_startParameters.workingDir);
|
||||||
if (!sp->environment.isEmpty())
|
if (!m_startParameters.environment.isEmpty())
|
||||||
m_gdbProc->setEnvironment(sp->environment);
|
m_gdbProc->setEnvironment(m_startParameters.environment);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
@@ -1542,13 +1552,18 @@ bool GdbEngine::startDebugger(const QSharedPointer<DebuggerStartParameters> &sp)
|
|||||||
qDebug() << "ScriptFile:" << q->settings()->m_scriptFile;
|
qDebug() << "ScriptFile:" << q->settings()->m_scriptFile;
|
||||||
qDebug() << "Environment:" << m_gdbProc->environment();
|
qDebug() << "Environment:" << m_gdbProc->environment();
|
||||||
qDebug() << "Arguments:" << gdbArgs;
|
qDebug() << "Arguments:" << gdbArgs;
|
||||||
qDebug() << "BuildDir:" << sp->buildDir;
|
qDebug() << "BuildDir:" << m_startParameters.buildDir;
|
||||||
qDebug() << "ExeFile:" << sp->executable;
|
qDebug() << "ExeFile:" << m_startParameters.executable;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QString loc = theDebuggerStringSetting(GdbLocation);
|
QString loc = theDebuggerStringSetting(GdbLocation);
|
||||||
q->showStatusMessage(tr("Starting Debugger: ") + loc + _c(' ') + gdbArgs.join(_(" ")));
|
q->showStatusMessage(tr("Starting Debugger: ") + loc + _c(' ') + gdbArgs.join(_(" ")));
|
||||||
m_gdbProc->start(loc, gdbArgs);
|
m_gdbProc->start(loc, gdbArgs);
|
||||||
|
}
|
||||||
|
|
||||||
|
void GdbEngine::startDebugger2()
|
||||||
|
{
|
||||||
|
#if 0
|
||||||
if (!m_gdbProc->waitForStarted()) {
|
if (!m_gdbProc->waitForStarted()) {
|
||||||
QMessageBox::critical(q->mainWindow(), tr("Debugger Startup Failure"),
|
QMessageBox::critical(q->mainWindow(), tr("Debugger Startup Failure"),
|
||||||
tr("Cannot start debugger: %1").arg(m_gdbProc->errorString()));
|
tr("Cannot start debugger: %1").arg(m_gdbProc->errorString()));
|
||||||
@@ -1556,8 +1571,10 @@ bool GdbEngine::startDebugger(const QSharedPointer<DebuggerStartParameters> &sp)
|
|||||||
m_stubProc.blockSignals(true);
|
m_stubProc.blockSignals(true);
|
||||||
m_stubProc.stop();
|
m_stubProc.stop();
|
||||||
m_stubProc.blockSignals(false);
|
m_stubProc.blockSignals(false);
|
||||||
return false;
|
emit startFailed();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
q->showStatusMessage(tr("Gdb Running..."));
|
q->showStatusMessage(tr("Gdb Running..."));
|
||||||
|
|
||||||
@@ -1639,39 +1656,39 @@ bool GdbEngine::startDebugger(const QSharedPointer<DebuggerStartParameters> &sp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (q->startMode() == AttachExternal || q->startMode() == AttachCrashedExternal) {
|
if (q->startMode() == AttachExternal || q->startMode() == AttachCrashedExternal) {
|
||||||
postCommand(_("attach %1").arg(sp->attachPID), CB(handleAttach));
|
postCommand(_("attach %1").arg(m_startParameters.attachPID), CB(handleAttach));
|
||||||
// Task 254674 does not want to remove them
|
// Task 254674 does not want to remove them
|
||||||
//qq->breakHandler()->removeAllBreakpoints();
|
//qq->breakHandler()->removeAllBreakpoints();
|
||||||
} else if (q->startMode() == AttachCore) {
|
} else if (q->startMode() == AttachCore) {
|
||||||
QFileInfo fi(sp->executable);
|
QFileInfo fi(m_startParameters.executable);
|
||||||
QString fileName = _c('"') + fi.absoluteFilePath() + _c('"');
|
QString fileName = _c('"') + fi.absoluteFilePath() + _c('"');
|
||||||
QFileInfo fi2(sp->coreFile);
|
QFileInfo fi2(m_startParameters.coreFile);
|
||||||
// quoting core name below fails in gdb 6.8-debian
|
// quoting core name below fails in gdb 6.8-debian
|
||||||
QString coreName = fi2.absoluteFilePath();
|
QString coreName = fi2.absoluteFilePath();
|
||||||
postCommand(_("-file-exec-and-symbols ") + fileName, CB(handleFileExecAndSymbols));
|
postCommand(_("-file-exec-and-symbols ") + fileName, CB(handleFileExecAndSymbols));
|
||||||
postCommand(_("target core ") + coreName, CB(handleTargetCore));
|
postCommand(_("target core ") + coreName, CB(handleTargetCore));
|
||||||
qq->breakHandler()->removeAllBreakpoints();
|
qq->breakHandler()->removeAllBreakpoints();
|
||||||
} else if (q->startMode() == StartRemote) {
|
} else if (q->startMode() == StartRemote) {
|
||||||
postCommand(_("set architecture %1").arg(sp->remoteArchitecture));
|
postCommand(_("set architecture %1").arg(m_startParameters.remoteArchitecture));
|
||||||
qq->breakHandler()->setAllPending();
|
qq->breakHandler()->setAllPending();
|
||||||
//QFileInfo fi(sp->executable);
|
//QFileInfo fi(m_startParameters.executable);
|
||||||
//QString fileName = fi.absoluteFileName();
|
//QString fileName = fi.absoluteFileName();
|
||||||
QString fileName = sp->executable;
|
QString fileName = m_startParameters.executable;
|
||||||
postCommand(_("-file-exec-and-symbols \"%1\"").arg(fileName), CB(handleFileExecAndSymbols));
|
postCommand(_("-file-exec-and-symbols \"%1\"").arg(fileName), CB(handleFileExecAndSymbols));
|
||||||
// works only for > 6.8
|
// works only for > 6.8
|
||||||
postCommand(_("set target-async on"), CB(handleSetTargetAsync));
|
postCommand(_("set target-async on"), CB(handleSetTargetAsync));
|
||||||
} else if (sp->useTerminal) {
|
} else if (m_startParameters.useTerminal) {
|
||||||
qq->breakHandler()->setAllPending();
|
qq->breakHandler()->setAllPending();
|
||||||
} else if (q->startMode() == StartInternal || q->startMode() == StartExternal) {
|
} else if (q->startMode() == StartInternal || q->startMode() == StartExternal) {
|
||||||
QFileInfo fi(sp->executable);
|
QFileInfo fi(m_startParameters.executable);
|
||||||
QString fileName = _c('"') + fi.absoluteFilePath() + _c('"');
|
QString fileName = _c('"') + fi.absoluteFilePath() + _c('"');
|
||||||
postCommand(_("-file-exec-and-symbols ") + fileName, CB(handleFileExecAndSymbols));
|
postCommand(_("-file-exec-and-symbols ") + fileName, CB(handleFileExecAndSymbols));
|
||||||
//postCommand(_("file ") + fileName, handleFileExecAndSymbols);
|
//postCommand(_("file ") + fileName, handleFileExecAndSymbols);
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
postCommand(_("sharedlibrary apply-load-rules all"));
|
postCommand(_("sharedlibrary apply-load-rules all"));
|
||||||
#endif
|
#endif
|
||||||
if (!sp->processArgs.isEmpty())
|
if (!m_startParameters.processArgs.isEmpty())
|
||||||
postCommand(_("-exec-arguments ") + sp->processArgs.join(_(" ")));
|
postCommand(_("-exec-arguments ") + m_startParameters.processArgs.join(_(" ")));
|
||||||
#ifndef Q_OS_MAC
|
#ifndef Q_OS_MAC
|
||||||
if (!m_dumperInjectionLoad)
|
if (!m_dumperInjectionLoad)
|
||||||
postCommand(_("set auto-solib-add off"));
|
postCommand(_("set auto-solib-add off"));
|
||||||
@@ -1686,7 +1703,7 @@ bool GdbEngine::startDebugger(const QSharedPointer<DebuggerStartParameters> &sp)
|
|||||||
qq->breakHandler()->setAllPending();
|
qq->breakHandler()->setAllPending();
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
emit startSuccessful();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GdbEngine::continueInferior()
|
void GdbEngine::continueInferior()
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
#define DEBUGGER_GDBENGINE_H
|
#define DEBUGGER_GDBENGINE_H
|
||||||
|
|
||||||
#include "idebuggerengine.h"
|
#include "idebuggerengine.h"
|
||||||
|
#include "debuggermanager.h" // only for StartParameters
|
||||||
#include "gdbmi.h"
|
#include "gdbmi.h"
|
||||||
#include "gdbprocessbase.h"
|
#include "gdbprocessbase.h"
|
||||||
#include "outputcollector.h"
|
#include "outputcollector.h"
|
||||||
@@ -86,6 +87,8 @@ public:
|
|||||||
this, SIGNAL(readyReadStandardOutput()));
|
this, SIGNAL(readyReadStandardOutput()));
|
||||||
connect(&m_proc, SIGNAL(readyReadStandardError()),
|
connect(&m_proc, SIGNAL(readyReadStandardError()),
|
||||||
this, SIGNAL(readyReadStandardError()));
|
this, SIGNAL(readyReadStandardError()));
|
||||||
|
connect(&m_proc, SIGNAL(started()),
|
||||||
|
this, SIGNAL(started()));
|
||||||
connect(&m_proc, SIGNAL(finished(int, QProcess::ExitStatus)),
|
connect(&m_proc, SIGNAL(finished(int, QProcess::ExitStatus)),
|
||||||
this, SIGNAL(finished(int, QProcess::ExitStatus)));
|
this, SIGNAL(finished(int, QProcess::ExitStatus)));
|
||||||
}
|
}
|
||||||
@@ -133,7 +136,8 @@ private:
|
|||||||
|
|
||||||
void shutdown();
|
void shutdown();
|
||||||
void setToolTipExpression(const QPoint &mousePos, TextEditor::ITextEditor *editor, int cursorPos);
|
void setToolTipExpression(const QPoint &mousePos, TextEditor::ITextEditor *editor, int cursorPos);
|
||||||
bool startDebugger(const QSharedPointer<DebuggerStartParameters> &sp);
|
void startDebugger(const QSharedPointer<DebuggerStartParameters> &sp);
|
||||||
|
Q_SLOT void startDebugger2();
|
||||||
void exitDebugger();
|
void exitDebugger();
|
||||||
void detachDebugger();
|
void detachDebugger();
|
||||||
|
|
||||||
@@ -430,6 +434,7 @@ private:
|
|||||||
|
|
||||||
DebuggerManager * const q;
|
DebuggerManager * const q;
|
||||||
IDebuggerManagerAccessForEngines * const qq;
|
IDebuggerManagerAccessForEngines * const qq;
|
||||||
|
DebuggerStartParameters m_startParameters;
|
||||||
// make sure to re-initialize new members in initializeVariables();
|
// make sure to re-initialize new members in initializeVariables();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ public:
|
|||||||
QIODevice::OpenMode mode = QIODevice::ReadWrite) = 0;
|
QIODevice::OpenMode mode = QIODevice::ReadWrite) = 0;
|
||||||
virtual void kill() = 0;
|
virtual void kill() = 0;
|
||||||
virtual void terminate() = 0;
|
virtual void terminate() = 0;
|
||||||
virtual bool waitForStarted(int msecs = 30000) = 0;
|
//virtual bool waitForStarted(int msecs = 30000) = 0;
|
||||||
virtual bool waitForFinished(int msecs = 30000) = 0;
|
virtual bool waitForFinished(int msecs = 30000) = 0;
|
||||||
virtual QProcess::ProcessState state() const = 0;
|
virtual QProcess::ProcessState state() const = 0;
|
||||||
virtual QString errorString() const = 0;
|
virtual QString errorString() const = 0;
|
||||||
@@ -63,6 +63,7 @@ public:
|
|||||||
|
|
||||||
signals:
|
signals:
|
||||||
void error(QProcess::ProcessError);
|
void error(QProcess::ProcessError);
|
||||||
|
void started();
|
||||||
void readyReadStandardOutput();
|
void readyReadStandardOutput();
|
||||||
void readyReadStandardError();
|
void readyReadStandardError();
|
||||||
void finished(int, QProcess::ExitStatus);
|
void finished(int, QProcess::ExitStatus);
|
||||||
|
|||||||
@@ -55,12 +55,14 @@ class WatchData;
|
|||||||
|
|
||||||
class IDebuggerEngine : public QObject
|
class IDebuggerEngine : public QObject
|
||||||
{
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
IDebuggerEngine(QObject *parent = 0) : QObject(parent) {}
|
IDebuggerEngine(QObject *parent = 0) : QObject(parent) {}
|
||||||
|
|
||||||
virtual void shutdown() = 0;
|
virtual void shutdown() = 0;
|
||||||
virtual void setToolTipExpression(const QPoint &mousePos, TextEditor::ITextEditor *editor, int cursorPos) = 0;
|
virtual void setToolTipExpression(const QPoint &mousePos, TextEditor::ITextEditor *editor, int cursorPos) = 0;
|
||||||
virtual bool startDebugger(const QSharedPointer<DebuggerStartParameters> &startParameters) = 0;
|
virtual void startDebugger(const QSharedPointer<DebuggerStartParameters> &startParameters) = 0;
|
||||||
virtual void exitDebugger() = 0;
|
virtual void exitDebugger() = 0;
|
||||||
virtual void detachDebugger() {}
|
virtual void detachDebugger() {}
|
||||||
virtual void updateWatchData(const WatchData &data) = 0;
|
virtual void updateWatchData(const WatchData &data) = 0;
|
||||||
@@ -101,6 +103,10 @@ public:
|
|||||||
virtual void fetchDisassembler(DisassemblerViewAgent *, const StackFrame &) {}
|
virtual void fetchDisassembler(DisassemblerViewAgent *, const StackFrame &) {}
|
||||||
virtual void setRegisterValue(int regnr, const QString &value)
|
virtual void setRegisterValue(int regnr, const QString &value)
|
||||||
{ Q_UNUSED(regnr); Q_UNUSED(value); }
|
{ Q_UNUSED(regnr); Q_UNUSED(value); }
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void startSuccessful();
|
||||||
|
void startFailed();
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -217,7 +217,7 @@ void ScriptEngine::exitDebugger()
|
|||||||
qq->notifyInferiorExited();
|
qq->notifyInferiorExited();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ScriptEngine::startDebugger(const QSharedPointer<DebuggerStartParameters> &sp)
|
void ScriptEngine::startDebugger(const QSharedPointer<DebuggerStartParameters> &sp)
|
||||||
{
|
{
|
||||||
if (!m_scriptEngine)
|
if (!m_scriptEngine)
|
||||||
m_scriptEngine = new QScriptEngine(this);
|
m_scriptEngine = new QScriptEngine(this);
|
||||||
@@ -233,15 +233,17 @@ bool ScriptEngine::startDebugger(const QSharedPointer<DebuggerStartParameters> &
|
|||||||
QFileInfo fi(sp->executable);
|
QFileInfo fi(sp->executable);
|
||||||
m_scriptFileName = fi.absoluteFilePath();
|
m_scriptFileName = fi.absoluteFilePath();
|
||||||
QFile scriptFile(m_scriptFileName);
|
QFile scriptFile(m_scriptFileName);
|
||||||
if (!scriptFile.open(QIODevice::ReadOnly))
|
if (!scriptFile.open(QIODevice::ReadOnly)) {
|
||||||
return false;
|
emit startFailed();
|
||||||
|
return;
|
||||||
|
}
|
||||||
QTextStream stream(&scriptFile);
|
QTextStream stream(&scriptFile);
|
||||||
m_scriptContents = stream.readAll();
|
m_scriptContents = stream.readAll();
|
||||||
scriptFile.close();
|
scriptFile.close();
|
||||||
attemptBreakpointSynchronization();
|
attemptBreakpointSynchronization();
|
||||||
qq->notifyInferiorRunningRequested();
|
qq->notifyInferiorRunningRequested();
|
||||||
QTimer::singleShot(0, this, SLOT(runInferior()));
|
QTimer::singleShot(0, this, SLOT(runInferior()));
|
||||||
return true;
|
emit startSuccessful();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScriptEngine::continueInferior()
|
void ScriptEngine::continueInferior()
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ private:
|
|||||||
|
|
||||||
void shutdown();
|
void shutdown();
|
||||||
void setToolTipExpression(const QPoint &mousePos, TextEditor::ITextEditor *editor, int cursorPos);
|
void setToolTipExpression(const QPoint &mousePos, TextEditor::ITextEditor *editor, int cursorPos);
|
||||||
bool startDebugger(const QSharedPointer<DebuggerStartParameters> &sp);
|
void startDebugger(const QSharedPointer<DebuggerStartParameters> &sp);
|
||||||
|
|
||||||
void exitDebugger();
|
void exitDebugger();
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
HEADERS += \
|
HEADERS += \
|
||||||
|
$$PWD/trkutils.h \
|
||||||
$$PWD/trkclient.h \
|
$$PWD/trkclient.h \
|
||||||
$$PWD/symbianadapter.h \
|
$$PWD/symbianadapter.h \
|
||||||
#$$PWD/gdboptionspage.h \
|
#$$PWD/gdboptionspage.h \
|
||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
|
$$PWD/trkutils.cpp \
|
||||||
$$PWD/trkclient.cpp \
|
$$PWD/trkclient.cpp \
|
||||||
$$PWD/symbianadapter.cpp \
|
$$PWD/symbianadapter.cpp \
|
||||||
$$PWD/symbianengine.cpp \
|
$$PWD/symbianengine.cpp \
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ SymbianAdapter::SymbianAdapter()
|
|||||||
SymbianAdapter::~SymbianAdapter()
|
SymbianAdapter::~SymbianAdapter()
|
||||||
{
|
{
|
||||||
m_gdbServer.close();
|
m_gdbServer.close();
|
||||||
logMessage("Shutting down.\n", true);
|
logMessage("Shutting down.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void SymbianAdapter::trkLogMessage(const QString &msg)
|
void SymbianAdapter::trkLogMessage(const QString &msg)
|
||||||
@@ -193,10 +193,10 @@ void SymbianAdapter::startInferior()
|
|||||||
//sendTrkMessage(TRK_WRITE_QUEUE_NOOP_CODE, TrkCB(startGdbServer));
|
//sendTrkMessage(TRK_WRITE_QUEUE_NOOP_CODE, TrkCB(startGdbServer));
|
||||||
}
|
}
|
||||||
|
|
||||||
void SymbianAdapter::logMessage(const QString &msg, bool force)
|
void SymbianAdapter::logMessage(const QString &msg)
|
||||||
{
|
{
|
||||||
if (m_verbose || force)
|
if (m_verbose)
|
||||||
emit output(QString(), msg);
|
emit output(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -289,17 +289,17 @@ bool SymbianAdapter::sendGdbServerPacket(const QByteArray &packet, bool doFlush)
|
|||||||
{
|
{
|
||||||
if (!m_gdbConnection) {
|
if (!m_gdbConnection) {
|
||||||
logMessage(QString::fromLatin1("Cannot write to gdb: No connection (%1)")
|
logMessage(QString::fromLatin1("Cannot write to gdb: No connection (%1)")
|
||||||
.arg(QString::fromLatin1(packet)), true);
|
.arg(QString::fromLatin1(packet)));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (m_gdbConnection->state() != QAbstractSocket::ConnectedState) {
|
if (m_gdbConnection->state() != QAbstractSocket::ConnectedState) {
|
||||||
logMessage(QString::fromLatin1("Cannot write to gdb: Not connected (%1)")
|
logMessage(QString::fromLatin1("Cannot write to gdb: Not connected (%1)")
|
||||||
.arg(QString::fromLatin1(packet)), true);
|
.arg(QString::fromLatin1(packet)));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (m_gdbConnection->write(packet) == -1) {
|
if (m_gdbConnection->write(packet) == -1) {
|
||||||
logMessage(QString::fromLatin1("Cannot write to gdb: %1 (%2)")
|
logMessage(QString::fromLatin1("Cannot write to gdb: %1 (%2)")
|
||||||
.arg(m_gdbConnection->errorString()).arg(QString::fromLatin1(packet)), true);
|
.arg(m_gdbConnection->errorString()).arg(QString::fromLatin1(packet)));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (doFlush)
|
if (doFlush)
|
||||||
@@ -720,6 +720,7 @@ void SymbianAdapter::handleGdbServerCommand(const QByteArray &cmd)
|
|||||||
if (bp == 0) {
|
if (bp == 0) {
|
||||||
logMessage(QString::fromLatin1("NO RECORDED BP AT 0x%1, %2")
|
logMessage(QString::fromLatin1("NO RECORDED BP AT 0x%1, %2")
|
||||||
.arg(addr, 0, 16).arg(len));
|
.arg(addr, 0, 16).arg(len));
|
||||||
|
sendGdbServerMessage("E00");
|
||||||
} else {
|
} else {
|
||||||
//---IDE------------------------------------------------------
|
//---IDE------------------------------------------------------
|
||||||
// Command: 0x1C Clear Break
|
// Command: 0x1C Clear Break
|
||||||
@@ -748,7 +749,7 @@ void SymbianAdapter::handleGdbServerCommand(const QByteArray &cmd)
|
|||||||
if (ok1 && ok2) {
|
if (ok1 && ok2) {
|
||||||
const QString msg = QString::fromLatin1("Read of OS auxilary "
|
const QString msg = QString::fromLatin1("Read of OS auxilary "
|
||||||
"vector (%1, %2) not implemented.").arg(offset).arg(length);
|
"vector (%1, %2) not implemented.").arg(offset).arg(length);
|
||||||
logMessage(msgGdbPacket(msg), true);
|
logMessage(msgGdbPacket(msg));
|
||||||
sendGdbServerMessage("E20", msg.toLatin1());
|
sendGdbServerMessage("E20", msg.toLatin1());
|
||||||
handled = true;
|
handled = true;
|
||||||
}
|
}
|
||||||
@@ -757,7 +758,7 @@ void SymbianAdapter::handleGdbServerCommand(const QByteArray &cmd)
|
|||||||
if (!handled) {
|
if (!handled) {
|
||||||
const QString msg = QLatin1String("FIXME unknown 'XFER'-request: ")
|
const QString msg = QLatin1String("FIXME unknown 'XFER'-request: ")
|
||||||
+ QString::fromAscii(cmd);
|
+ QString::fromAscii(cmd);
|
||||||
logMessage(msgGdbPacket(msg), true);
|
logMessage(msgGdbPacket(msg));
|
||||||
sendGdbServerMessage("E20", msg.toLatin1());
|
sendGdbServerMessage("E20", msg.toLatin1());
|
||||||
}
|
}
|
||||||
} // qPart/qXfer
|
} // qPart/qXfer
|
||||||
@@ -820,7 +821,7 @@ void SymbianAdapter::handleTrkResult(const TrkResult &result)
|
|||||||
QString logMsg;
|
QString logMsg;
|
||||||
QTextStream(&logMsg) << prefix << "NAK: for token=" << result.token
|
QTextStream(&logMsg) << prefix << "NAK: for token=" << result.token
|
||||||
<< " ERROR: " << errorMessage(result.data.at(0)) << ' ' << str;
|
<< " ERROR: " << errorMessage(result.data.at(0)) << ' ' << str;
|
||||||
logMessage(logMsg, true);
|
logMessage(logMsg);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 0x90: { // Notified Stopped
|
case 0x90: { // Notified Stopped
|
||||||
@@ -1221,7 +1222,7 @@ void SymbianAdapter::handleTrkVersions(const TrkResult &result)
|
|||||||
|
|
||||||
void SymbianAdapter::handleDisconnect(const TrkResult & /*result*/)
|
void SymbianAdapter::handleDisconnect(const TrkResult & /*result*/)
|
||||||
{
|
{
|
||||||
logMessage(QLatin1String("Trk disconnected"), true);
|
logMessage(QLatin1String("Trk disconnected"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void SymbianAdapter::readMemory(uint addr, uint len)
|
void SymbianAdapter::readMemory(uint addr, uint len)
|
||||||
@@ -1284,9 +1285,9 @@ void SymbianAdapter::connectProcess(QProcess *proc)
|
|||||||
void SymbianAdapter::sendOutput(QObject *sender, const QString &data)
|
void SymbianAdapter::sendOutput(QObject *sender, const QString &data)
|
||||||
{
|
{
|
||||||
if (sender)
|
if (sender)
|
||||||
emit output(sender->objectName() + " : ", data);
|
emit output(sender->objectName() + " : " + data);
|
||||||
else
|
else
|
||||||
emit output(QString(), data);
|
emit output(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SymbianAdapter::handleProcError(QProcess::ProcessError error)
|
void SymbianAdapter::handleProcError(QProcess::ProcessError error)
|
||||||
@@ -1328,13 +1329,13 @@ void SymbianAdapter::startGdb()
|
|||||||
{
|
{
|
||||||
if (!m_gdbServer.listen(QHostAddress(gdbServerIP()), gdbServerPort())) {
|
if (!m_gdbServer.listen(QHostAddress(gdbServerIP()), gdbServerPort())) {
|
||||||
logMessage(QString("Unable to start the gdb server at %1: %2.")
|
logMessage(QString("Unable to start the gdb server at %1: %2.")
|
||||||
.arg(m_gdbServerName).arg(m_gdbServer.errorString()), true);
|
.arg(m_gdbServerName).arg(m_gdbServer.errorString()));
|
||||||
QCoreApplication::exit(5);
|
QCoreApplication::exit(5);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
logMessage(QString("Gdb server running on %1.\nRegister endianness: %3.")
|
logMessage(QString("Gdb server running on %1.\nRegister endianness: %3.")
|
||||||
.arg(m_gdbServerName).arg(m_registerEndianness), true);
|
.arg(m_gdbServerName).arg(m_registerEndianness));
|
||||||
|
|
||||||
connect(&m_gdbServer, SIGNAL(newConnection()),
|
connect(&m_gdbServer, SIGNAL(newConnection()),
|
||||||
this, SLOT(handleGdbConnection()));
|
this, SLOT(handleGdbConnection()));
|
||||||
@@ -1379,12 +1380,12 @@ void SymbianAdapter::startGdb()
|
|||||||
sendGdbMessage("symbol-file filebrowseapp.sym");
|
sendGdbMessage("symbol-file filebrowseapp.sym");
|
||||||
|
|
||||||
// -symbol-info-address not implemented in cs-gdb 6.4-6.8 (at least)
|
// -symbol-info-address not implemented in cs-gdb 6.4-6.8 (at least)
|
||||||
sendGdbMessage("info address E32Main",
|
//sendGdbMessage("info address E32Main",
|
||||||
GdbCB(handleInfoMainAddress));
|
// GdbCB(handleInfoMainAddress));
|
||||||
sendGdbMessage("info address CFileBrowseAppUi::HandleCommandL",
|
//sendGdbMessage("info address CFileBrowseAppUi::HandleCommandL",
|
||||||
GdbCB(handleInfoMainAddress));
|
// GdbCB(handleInfoMainAddress));
|
||||||
|
|
||||||
#if 1
|
#if 0
|
||||||
// FIXME: Gdb based version. That's the goal
|
// FIXME: Gdb based version. That's the goal
|
||||||
//sendGdbMessage("break E32Main");
|
//sendGdbMessage("break E32Main");
|
||||||
//sendGdbMessage("continue");
|
//sendGdbMessage("continue");
|
||||||
@@ -1392,8 +1393,11 @@ void SymbianAdapter::startGdb()
|
|||||||
// trkContinueMessage(), "CONTINUE");
|
// trkContinueMessage(), "CONTINUE");
|
||||||
#else
|
#else
|
||||||
// Directly talk to TRK. Works for now...
|
// Directly talk to TRK. Works for now...
|
||||||
sendGdbMessage("break E32Main");
|
//sendGdbMessage("break E32Main");
|
||||||
sendGdbMessage("break filebrowseappui.cpp:39");
|
sendGdbMessage("-break-insert E32Main");
|
||||||
|
sendGdbMessage("-break-insert filebrowseappui.cpp:39");
|
||||||
|
sendGdbMessage("target remote " + m_gdbServerName);
|
||||||
|
//sendGdbMessage("break filebrowseappui.cpp:39");
|
||||||
// sendTrkMessage(0x18, TrkCallback(), trkContinueMessage(), "CONTINUE");
|
// sendTrkMessage(0x18, TrkCallback(), trkContinueMessage(), "CONTINUE");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -1441,6 +1445,7 @@ void SymbianAdapter::handleGdbReadyReadStandardOutput()
|
|||||||
if (!cmd.callback.isNull())
|
if (!cmd.callback.isNull())
|
||||||
cmd.callback(result);
|
cmd.callback(result);
|
||||||
#else
|
#else
|
||||||
|
/*
|
||||||
bool ok;
|
bool ok;
|
||||||
QRegExp re(QString("Symbol .._Z7E32Mainv.. is a function at address 0x(.*)\\."));
|
QRegExp re(QString("Symbol .._Z7E32Mainv.. is a function at address 0x(.*)\\."));
|
||||||
if (re.indexIn(str) != -1) {
|
if (re.indexIn(str) != -1) {
|
||||||
@@ -1459,6 +1464,7 @@ void SymbianAdapter::handleGdbReadyReadStandardOutput()
|
|||||||
sendGdbMessage("target remote " + m_gdbServerName);
|
sendGdbMessage("target remote " + m_gdbServerName);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
logMessage(QString("-> GDB: %1").arg(str));
|
logMessage(QString("-> GDB: %1").arg(str));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -1505,6 +1511,8 @@ void SymbianAdapter::handleRfcommReadyReadStandardOutput()
|
|||||||
void SymbianAdapter::start(const QString &program, const QStringList &args,
|
void SymbianAdapter::start(const QString &program, const QStringList &args,
|
||||||
QIODevice::OpenMode mode)
|
QIODevice::OpenMode mode)
|
||||||
{
|
{
|
||||||
|
qDebug() << "SYMBIAN START";
|
||||||
|
run();
|
||||||
//m_gdbProc.start(program, args, mode);
|
//m_gdbProc.start(program, args, mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1518,12 +1526,6 @@ void SymbianAdapter::terminate()
|
|||||||
//m_gdbProc.terminate();
|
//m_gdbProc.terminate();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SymbianAdapter::waitForStarted(int msecs)
|
|
||||||
{
|
|
||||||
//return m_gdbProc.waitForStarted(msecs);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool SymbianAdapter::waitForFinished(int msecs)
|
bool SymbianAdapter::waitForFinished(int msecs)
|
||||||
{
|
{
|
||||||
//return m_gdbProc.waitForFinished(msecs);
|
//return m_gdbProc.waitForFinished(msecs);
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ public slots:
|
|||||||
void startInferior();
|
void startInferior();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void output(const QString &senderName, const QString &data);
|
void output(const QString &msg);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void handleProcError(QProcess::ProcessError error);
|
void handleProcError(QProcess::ProcessError error);
|
||||||
@@ -126,7 +126,6 @@ public:
|
|||||||
QIODevice::OpenMode mode = QIODevice::ReadWrite);
|
QIODevice::OpenMode mode = QIODevice::ReadWrite);
|
||||||
void kill();
|
void kill();
|
||||||
void terminate();
|
void terminate();
|
||||||
bool waitForStarted(int msecs = 30000);
|
|
||||||
bool waitForFinished(int msecs = 30000);
|
bool waitForFinished(int msecs = 30000);
|
||||||
QProcess::ProcessState state() const;
|
QProcess::ProcessState state() const;
|
||||||
QString errorString() const;
|
QString errorString() const;
|
||||||
@@ -213,7 +212,7 @@ public:
|
|||||||
|
|
||||||
Q_SLOT void handleGdbReadyReadStandardError();
|
Q_SLOT void handleGdbReadyReadStandardError();
|
||||||
Q_SLOT void handleGdbReadyReadStandardOutput();
|
Q_SLOT void handleGdbReadyReadStandardOutput();
|
||||||
void logMessage(const QString &msg, bool force = false);
|
void logMessage(const QString &msg); // triggers output() if m_verbose
|
||||||
Q_SLOT void trkLogMessage(const QString &msg);
|
Q_SLOT void trkLogMessage(const QString &msg);
|
||||||
|
|
||||||
void handleInfoAddress(const GdbResult &result);
|
void handleInfoAddress(const GdbResult &result);
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
|
|
||||||
#include "gdb/gdbengine.h"
|
#include "gdb/gdbengine.h"
|
||||||
#include "symbianadapter.h"
|
#include "symbianadapter.h"
|
||||||
|
#include "debuggermanager.h"
|
||||||
|
|
||||||
//#include "debuggerdialogs.h"
|
//#include "debuggerdialogs.h"
|
||||||
|
|
||||||
@@ -40,24 +41,20 @@
|
|||||||
#include <coreplugin/dialogs/ioptionspage.h>
|
#include <coreplugin/dialogs/ioptionspage.h>
|
||||||
|
|
||||||
#include <QtCore/QDebug>
|
#include <QtCore/QDebug>
|
||||||
#include <QtCore/QDir>
|
|
||||||
#include <QtCore/QFileInfo>
|
|
||||||
#include <QtCore/QMetaObject>
|
|
||||||
#include <QtCore/QTime>
|
|
||||||
#include <QtCore/QTimer>
|
|
||||||
#include <QtCore/QTextStream>
|
|
||||||
|
|
||||||
|
|
||||||
namespace Debugger {
|
namespace Debugger {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
|
|
||||||
IDebuggerEngine *createSymbianEngine(DebuggerManager *parent,
|
IDebuggerEngine *createSymbianEngine(DebuggerManager *parent,
|
||||||
QList<Core::IOptionsPage*> *opts)
|
QList<Core::IOptionsPage*> *opts)
|
||||||
{
|
{
|
||||||
Q_UNUSED(opts);
|
Q_UNUSED(opts);
|
||||||
//opts->push_back(new GdbOptionsPage);
|
//opts->push_back(new GdbOptionsPage);
|
||||||
return new GdbEngine(parent, new SymbianAdapter);
|
SymbianAdapter *adapter = new SymbianAdapter;
|
||||||
|
QObject::connect(adapter, SIGNAL(output(QString)),
|
||||||
|
parent, SLOT(showDebuggerOutput(QString)));
|
||||||
|
return new GdbEngine(parent, adapter);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -220,7 +220,7 @@ void TcfEngine::exitDebugger()
|
|||||||
qq->notifyInferiorExited();
|
qq->notifyInferiorExited();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TcfEngine::startDebugger(const QSharedPointer<DebuggerStartParameters> &sp)
|
void TcfEngine::startDebugger(const QSharedPointer<DebuggerStartParameters> &sp)
|
||||||
{
|
{
|
||||||
qq->notifyInferiorRunningRequested();
|
qq->notifyInferiorRunningRequested();
|
||||||
const int pos = sp->remoteChannel.indexOf(QLatin1Char(':'));
|
const int pos = sp->remoteChannel.indexOf(QLatin1Char(':'));
|
||||||
@@ -228,7 +228,7 @@ bool TcfEngine::startDebugger(const QSharedPointer<DebuggerStartParameters> &sp)
|
|||||||
const quint16 port = sp->remoteChannel.mid(pos + 1).toInt();
|
const quint16 port = sp->remoteChannel.mid(pos + 1).toInt();
|
||||||
//QTimer::singleShot(0, this, SLOT(runInferior()));
|
//QTimer::singleShot(0, this, SLOT(runInferior()));
|
||||||
m_socket->connectToHost(host, port);
|
m_socket->connectToHost(host, port);
|
||||||
return true;
|
emit startSuccessful();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TcfEngine::continueInferior()
|
void TcfEngine::continueInferior()
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ private:
|
|||||||
|
|
||||||
void shutdown();
|
void shutdown();
|
||||||
void setToolTipExpression(const QPoint &mousePos, TextEditor::ITextEditor *editor, int cursorPos);
|
void setToolTipExpression(const QPoint &mousePos, TextEditor::ITextEditor *editor, int cursorPos);
|
||||||
bool startDebugger(const QSharedPointer<DebuggerStartParameters> &sp);
|
void startDebugger(const QSharedPointer<DebuggerStartParameters> &sp);
|
||||||
void exitDebugger();
|
void exitDebugger();
|
||||||
|
|
||||||
void continueInferior();
|
void continueInferior();
|
||||||
|
|||||||
@@ -53,9 +53,9 @@ signals:
|
|||||||
void executeCommand(QString);
|
void executeCommand(QString);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void handleOutput(const QString &senderName, const QString &data)
|
void handleOutput(const QString &str0)
|
||||||
{
|
{
|
||||||
QString str = senderName + data;
|
QString str = str0;
|
||||||
str.replace("\\t", QString(QChar(0x09)));
|
str.replace("\\t", QString(QChar(0x09)));
|
||||||
str.replace("\\n", QString("\n"));
|
str.replace("\\n", QString("\n"));
|
||||||
append(str);
|
append(str);
|
||||||
@@ -137,8 +137,8 @@ RunnerGui::RunnerGui(SymbianAdapter *adapter)
|
|||||||
connectAction(m_disassIAction, "Disass Inst", SLOT(executeDisassICommand()));
|
connectAction(m_disassIAction, "Disass Inst", SLOT(executeDisassICommand()));
|
||||||
connectAction(m_continueAction, "Continue", SLOT(executeContinueCommand()));
|
connectAction(m_continueAction, "Continue", SLOT(executeContinueCommand()));
|
||||||
|
|
||||||
connect(adapter, SIGNAL(output(QString,QString)),
|
connect(adapter, SIGNAL(output(QString)),
|
||||||
&m_textEdit, SLOT(handleOutput(QString,QString)));
|
&m_textEdit, SLOT(handleOutput(QString)));
|
||||||
connect(&m_textEdit, SIGNAL(executeCommand(QString)),
|
connect(&m_textEdit, SIGNAL(executeCommand(QString)),
|
||||||
m_adapter, SLOT(executeCommand(QString)));
|
m_adapter, SLOT(executeCommand(QString)));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user