forked from qt-creator/qt-creator
Get attaching to a crashed Windows process right (CDB).
Handle the 2nd parameter correctly as a event id to be used for a handshake. Introduce a special mode when attaching to crashed processes. Code cleanup, pass StartParameters along to startDebugger.
This commit is contained in:
@@ -30,6 +30,6 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license>
|
|||||||
<argument name="-disable-sdb">Disable Qt Script debugger engine</argument>
|
<argument name="-disable-sdb">Disable Qt Script debugger engine</argument>
|
||||||
<argument name="-disable-tcf">Disable Tcf debugger engine</argument>
|
<argument name="-disable-tcf">Disable Tcf debugger engine</argument>
|
||||||
<argument name="-debug" parameter="process-id">Attach to Process-Id</argument>
|
<argument name="-debug" parameter="process-id">Attach to Process-Id</argument>
|
||||||
<argument name="-winexception" parameter="exception-code">Exception code</argument>
|
<argument name="-wincrashevent" parameter="event-handle">Event handle used for attaching to crashed processes</argument>
|
||||||
</argumentList>
|
</argumentList>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|||||||
@@ -526,15 +526,16 @@ void CdbDebugEnginePrivate::clearDisplay()
|
|||||||
m_debuggerManagerAccess->registerHandler()->removeAll();
|
m_debuggerManagerAccess->registerHandler()->removeAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CdbDebugEngine::startDebugger()
|
bool CdbDebugEngine::startDebugger(const QSharedPointer<DebuggerStartParameters> &sp)
|
||||||
{
|
{
|
||||||
m_d->clearDisplay();
|
m_d->clearDisplay();
|
||||||
|
|
||||||
const DebuggerStartMode mode = m_d->m_debuggerManager->startMode();
|
const DebuggerStartMode mode = m_d->m_debuggerManager->startMode();
|
||||||
const QSharedPointer<DebuggerStartParameters> sp = m_d->m_debuggerManager->startParameters();
|
|
||||||
// Figure out dumper. @TODO: same in gdb...
|
// Figure out dumper. @TODO: same in gdb...
|
||||||
const QString dumperLibName = QDir::toNativeSeparators(m_d->m_debuggerManagerAccess->qtDumperLibraryName());
|
const QString dumperLibName = QDir::toNativeSeparators(m_d->m_debuggerManagerAccess->qtDumperLibraryName());
|
||||||
bool dumperEnabled = mode != AttachCore && !dumperLibName.isEmpty()
|
bool dumperEnabled = mode != AttachCore
|
||||||
|
&& mode != AttachCrashedExternal
|
||||||
|
&& !dumperLibName.isEmpty()
|
||||||
&& m_d->m_debuggerManagerAccess->qtDumperLibraryEnabled();
|
&& m_d->m_debuggerManagerAccess->qtDumperLibraryEnabled();
|
||||||
if (dumperEnabled) {
|
if (dumperEnabled) {
|
||||||
const QFileInfo fi(dumperLibName);
|
const QFileInfo fi(dumperLibName);
|
||||||
@@ -552,8 +553,9 @@ bool CdbDebugEngine::startDebugger()
|
|||||||
m_d->clearForRun();
|
m_d->clearForRun();
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case AttachExternal:
|
case AttachExternal:
|
||||||
rc = startAttachDebugger(sp->attachPID, &errorMessage);
|
case AttachCrashedExternal:
|
||||||
needWatchTimer = true;
|
rc = startAttachDebugger(sp->attachPID, mode, &errorMessage);
|
||||||
|
needWatchTimer = true; // Fetch away module load, etc. even if crashed
|
||||||
break;
|
break;
|
||||||
case StartInternal:
|
case StartInternal:
|
||||||
case StartExternal:
|
case StartExternal:
|
||||||
@@ -585,7 +587,7 @@ bool CdbDebugEngine::startDebugger()
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CdbDebugEngine::startAttachDebugger(qint64 pid, QString *errorMessage)
|
bool CdbDebugEngine::startAttachDebugger(qint64 pid, DebuggerStartMode sm, QString *errorMessage)
|
||||||
{
|
{
|
||||||
// Need to attrach invasively, otherwise, no notification signals
|
// Need to attrach invasively, otherwise, no notification signals
|
||||||
// for for CreateProcess/ExitProcess occur.
|
// for for CreateProcess/ExitProcess occur.
|
||||||
@@ -597,7 +599,7 @@ bool CdbDebugEngine::startAttachDebugger(qint64 pid, QString *errorMessage)
|
|||||||
*errorMessage = tr("Attaching to a process failed for process id %1: %2").arg(pid).arg(msgDebugEngineComResult(hr));
|
*errorMessage = tr("Attaching to a process failed for process id %1: %2").arg(pid).arg(msgDebugEngineComResult(hr));
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
m_d->m_mode = AttachExternal;
|
m_d->m_mode = sm;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -679,6 +681,17 @@ void CdbDebugEnginePrivate::processCreatedAttached(ULONG64 processHandle, ULONG6
|
|||||||
m_engine->executeDebuggerCommand(QLatin1String("bc"));
|
m_engine->executeDebuggerCommand(QLatin1String("bc"));
|
||||||
if (m_debuggerManagerAccess->breakHandler()->hasPendingBreakpoints())
|
if (m_debuggerManagerAccess->breakHandler()->hasPendingBreakpoints())
|
||||||
m_engine->attemptBreakpointSynchronization();
|
m_engine->attemptBreakpointSynchronization();
|
||||||
|
// Attaching to crashed: This handshake (signalling an event) is required for
|
||||||
|
// the exception to be delivered to the debugger
|
||||||
|
if (m_mode == AttachCrashedExternal) {
|
||||||
|
const QString crashParameter = m_debuggerManager->startParameters()->crashParameter;
|
||||||
|
if (!crashParameter.isEmpty()) {
|
||||||
|
ULONG64 evtNr = crashParameter.toULongLong();
|
||||||
|
const HRESULT hr = m_cif.debugControl->SetNotifyEventHandle(evtNr);
|
||||||
|
if (FAILED(hr))
|
||||||
|
m_engine->warning(QString::fromLatin1("Handshake failed on event #%1: %2").arg(evtNr).arg(msgComFailed("SetNotifyEventHandle", hr)));
|
||||||
|
}
|
||||||
|
}
|
||||||
if (debugCDB)
|
if (debugCDB)
|
||||||
qDebug() << Q_FUNC_INFO << '\n' << executionStatusString(m_cif.debugControl);
|
qDebug() << Q_FUNC_INFO << '\n' << executionStatusString(m_cif.debugControl);
|
||||||
}
|
}
|
||||||
@@ -707,7 +720,8 @@ void CdbDebugEnginePrivate::endDebugging(EndDebuggingMode em)
|
|||||||
Action action;
|
Action action;
|
||||||
switch (em) {
|
switch (em) {
|
||||||
case EndDebuggingAuto:
|
case EndDebuggingAuto:
|
||||||
action = m_mode == AttachExternal ? Detach : Terminate;
|
action = (m_mode == AttachExternal || m_mode == AttachCrashedExternal) ?
|
||||||
|
Detach : Terminate;
|
||||||
break;
|
break;
|
||||||
case EndDebuggingDetach:
|
case EndDebuggingDetach:
|
||||||
action = Detach;
|
action = Detach;
|
||||||
@@ -1417,7 +1431,7 @@ void CdbDebugEngine::slotConsoleStubStarted()
|
|||||||
qDebug() << Q_FUNC_INFO << appPid;
|
qDebug() << Q_FUNC_INFO << appPid;
|
||||||
// Attach to console process
|
// Attach to console process
|
||||||
QString errorMessage;
|
QString errorMessage;
|
||||||
if (startAttachDebugger(appPid, &errorMessage)) {
|
if (startAttachDebugger(appPid, AttachExternal, &errorMessage)) {
|
||||||
startWatchTimer();
|
startWatchTimer();
|
||||||
m_d->m_debuggerManagerAccess->notifyInferiorPidChanged(appPid);
|
m_d->m_debuggerManagerAccess->notifyInferiorPidChanged(appPid);
|
||||||
m_d->m_debuggerManagerAccess->notifyInferiorRunning();
|
m_d->m_debuggerManagerAccess->notifyInferiorRunning();
|
||||||
@@ -1436,6 +1450,12 @@ void CdbDebugEngine::slotConsoleStubTerminated()
|
|||||||
exitDebugger();
|
exitDebugger();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CdbDebugEngine::slotAttachedCrashed()
|
||||||
|
{
|
||||||
|
m_d->m_debuggerManagerAccess->showDebuggerOutput("A","A");
|
||||||
|
m_d->handleDebugEvent();
|
||||||
|
}
|
||||||
|
|
||||||
void CdbDebugEngine::warning(const QString &w)
|
void CdbDebugEngine::warning(const QString &w)
|
||||||
{
|
{
|
||||||
static const QString prefix = QLatin1String("warning:");
|
static const QString prefix = QLatin1String("warning:");
|
||||||
|
|||||||
@@ -61,7 +61,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();
|
virtual bool startDebugger(const QSharedPointer<DebuggerStartParameters> &startParameters);
|
||||||
virtual void exitDebugger();
|
virtual void exitDebugger();
|
||||||
virtual void detachDebugger();
|
virtual void detachDebugger();
|
||||||
virtual void updateWatchModel();
|
virtual void updateWatchModel();
|
||||||
@@ -107,10 +107,11 @@ private slots:
|
|||||||
void slotConsoleStubStarted();
|
void slotConsoleStubStarted();
|
||||||
void slotConsoleStubError(const QString &msg);
|
void slotConsoleStubError(const QString &msg);
|
||||||
void slotConsoleStubTerminated();
|
void slotConsoleStubTerminated();
|
||||||
|
void slotAttachedCrashed();
|
||||||
void warning(const QString &w);
|
void warning(const QString &w);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool startAttachDebugger(qint64 pid, QString *errorMessage);
|
bool startAttachDebugger(qint64 pid, DebuggerStartMode sm, QString *errorMessage);
|
||||||
bool startDebuggerWithExecutable(DebuggerStartMode sm, QString *errorMessage);
|
bool startDebuggerWithExecutable(DebuggerStartMode sm, QString *errorMessage);
|
||||||
void startWatchTimer();
|
void startWatchTimer();
|
||||||
void killWatchTimer();
|
void killWatchTimer();
|
||||||
|
|||||||
@@ -192,6 +192,7 @@ void DebuggerStartParameters::clear()
|
|||||||
buildDir.clear();
|
buildDir.clear();
|
||||||
attachPID = -1;
|
attachPID = -1;
|
||||||
useTerminal = false;
|
useTerminal = false;
|
||||||
|
crashParameter.clear();
|
||||||
remoteChannel.clear();
|
remoteChannel.clear();
|
||||||
remoteArchitecture.clear();
|
remoteArchitecture.clear();
|
||||||
serverStartScript.clear();
|
serverStartScript.clear();
|
||||||
@@ -892,6 +893,7 @@ void DebuggerManager::startNewDebugger(DebuggerRunControl *runControl, const QSh
|
|||||||
QString settingsIdHint;
|
QString settingsIdHint;
|
||||||
switch (startMode()) {
|
switch (startMode()) {
|
||||||
case AttachExternal:
|
case AttachExternal:
|
||||||
|
case AttachCrashedExternal:
|
||||||
m_engine = determineDebuggerEngine(m_startParameters->attachPID, &errorMessage);
|
m_engine = determineDebuggerEngine(m_startParameters->attachPID, &errorMessage);
|
||||||
break;
|
break;
|
||||||
case AttachTcf:
|
case AttachTcf:
|
||||||
@@ -919,7 +921,7 @@ void DebuggerManager::startNewDebugger(DebuggerRunControl *runControl, const QSh
|
|||||||
|
|
||||||
setBusyCursor(false);
|
setBusyCursor(false);
|
||||||
setStatus(DebuggerProcessStartingUp);
|
setStatus(DebuggerProcessStartingUp);
|
||||||
if (!m_engine->startDebugger()) {
|
if (!m_engine->startDebugger(m_startParameters)) {
|
||||||
setStatus(DebuggerProcessNotReady);
|
setStatus(DebuggerProcessNotReady);
|
||||||
debuggingFinished();
|
debuggingFinished();
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -118,12 +118,13 @@ enum DebuggerStatus
|
|||||||
|
|
||||||
enum DebuggerStartMode
|
enum DebuggerStartMode
|
||||||
{
|
{
|
||||||
StartInternal, // Start current start project's binary
|
StartInternal, // Start current start project's binary
|
||||||
StartExternal, // Start binary found in file system
|
StartExternal, // Start binary found in file system
|
||||||
AttachExternal, // Attach to running process
|
AttachExternal, // Attach to running process by process id
|
||||||
AttachTcf, // Attach to a running Target Communication Framework agent
|
AttachCrashedExternal, // Attach to crashed process by process id
|
||||||
AttachCore, // Attach to a core file
|
AttachTcf, // Attach to a running Target Communication Framework agent
|
||||||
StartRemote // Start and attach to a remote process
|
AttachCore, // Attach to a core file
|
||||||
|
StartRemote // Start and attach to a remote process
|
||||||
};
|
};
|
||||||
|
|
||||||
struct DebuggerStartParameters {
|
struct DebuggerStartParameters {
|
||||||
@@ -138,6 +139,7 @@ struct DebuggerStartParameters {
|
|||||||
QString buildDir;
|
QString buildDir;
|
||||||
qint64 attachPID;
|
qint64 attachPID;
|
||||||
bool useTerminal;
|
bool useTerminal;
|
||||||
|
QString crashParameter; // for AttachCrashedExternal
|
||||||
// for remote debugging
|
// for remote debugging
|
||||||
QString remoteChannel;
|
QString remoteChannel;
|
||||||
QString remoteArchitecture;
|
QString remoteArchitecture;
|
||||||
|
|||||||
@@ -404,7 +404,7 @@ DebuggerPlugin::DebuggerPlugin()
|
|||||||
m_gdbRunningContext(0),
|
m_gdbRunningContext(0),
|
||||||
m_cmdLineEnabledEngines(AllEngineTypes),
|
m_cmdLineEnabledEngines(AllEngineTypes),
|
||||||
m_cmdLineAttachPid(0),
|
m_cmdLineAttachPid(0),
|
||||||
m_cmdLineWinException(0),
|
m_cmdLineWinCrashEvent(0),
|
||||||
m_toggleLockedAction(0)
|
m_toggleLockedAction(0)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@@ -465,15 +465,16 @@ bool DebuggerPlugin::parseArgument(QStringList::const_iterator &it,
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// -winexception <exception code>, passed in by Windows System
|
// -wincrashevent <event-handle>. A handle used for
|
||||||
if (*it == QLatin1String("-winexception")) {
|
// a handshake when attaching to a crashed Windows process.
|
||||||
|
if (*it == QLatin1String("-wincrashevent")) {
|
||||||
++it;
|
++it;
|
||||||
if (it == cend) {
|
if (it == cend) {
|
||||||
*errorMessage = msgParameterMissing(*it);
|
*errorMessage = msgParameterMissing(*it);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
bool ok;
|
bool ok;
|
||||||
m_cmdLineWinException = it->toULong(&ok);
|
m_cmdLineWinCrashEvent = it->toULongLong(&ok);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
*errorMessage = msgInvalidNumericParameter(option, *it);
|
*errorMessage = msgInvalidNumericParameter(option, *it);
|
||||||
return false;
|
return false;
|
||||||
@@ -515,8 +516,12 @@ bool DebuggerPlugin::parseArguments(const QStringList &args, QString *errorMessa
|
|||||||
|
|
||||||
bool DebuggerPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
bool DebuggerPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||||
{
|
{
|
||||||
if (!parseArguments(arguments, errorMessage))
|
// Do not fail the whole plugin if something goes wrong here
|
||||||
return false;
|
if (!parseArguments(arguments, errorMessage)) {
|
||||||
|
*errorMessage = tr("Error evaluating command line arguments: %1").arg(*errorMessage);
|
||||||
|
qWarning("%s\n", qPrintable(*errorMessage));
|
||||||
|
errorMessage->clear();
|
||||||
|
}
|
||||||
|
|
||||||
m_manager = new DebuggerManager;
|
m_manager = new DebuggerManager;
|
||||||
const QList<Core::IOptionsPage *> engineOptionPages = m_manager->initializeEngines(m_cmdLineEnabledEngines);
|
const QList<Core::IOptionsPage *> engineOptionPages = m_manager->initializeEngines(m_cmdLineEnabledEngines);
|
||||||
@@ -915,11 +920,9 @@ void DebuggerPlugin::extensionsInitialized()
|
|||||||
|
|
||||||
void DebuggerPlugin::attachCmdLinePid()
|
void DebuggerPlugin::attachCmdLinePid()
|
||||||
{
|
{
|
||||||
const QString msg = m_cmdLineWinException ?
|
m_manager->showStatusMessage(tr("Attaching to PID %1.").arg(m_cmdLineAttachPid));
|
||||||
tr("Attaching to PID %1 (exception code %2).").arg(m_cmdLineAttachPid).arg(m_cmdLineWinException) :
|
const QString crashParameter = m_cmdLineWinCrashEvent ? QString::number(m_cmdLineWinCrashEvent) : QString();
|
||||||
tr("Attaching to PID %1.").arg(m_cmdLineAttachPid);
|
attachExternalApplication(m_cmdLineAttachPid, crashParameter);
|
||||||
m_manager->showStatusMessage(msg);
|
|
||||||
attachExternalApplication(m_cmdLineAttachPid);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! Activates the previous mode when the current mode is the debug mode. */
|
/*! Activates the previous mode when the current mode is the debug mode. */
|
||||||
@@ -1215,7 +1218,7 @@ void DebuggerPlugin::attachExternalApplication()
|
|||||||
attachExternalApplication(dlg.attachPID());
|
attachExternalApplication(dlg.attachPID());
|
||||||
}
|
}
|
||||||
|
|
||||||
void DebuggerPlugin::attachExternalApplication(qint64 pid)
|
void DebuggerPlugin::attachExternalApplication(qint64 pid, const QString &crashParameter)
|
||||||
{
|
{
|
||||||
if (pid == 0) {
|
if (pid == 0) {
|
||||||
QMessageBox::warning(m_manager->mainWindow(), tr("Warning"), tr("Cannot attach to PID 0"));
|
QMessageBox::warning(m_manager->mainWindow(), tr("Warning"), tr("Cannot attach to PID 0"));
|
||||||
@@ -1223,9 +1226,11 @@ void DebuggerPlugin::attachExternalApplication(qint64 pid)
|
|||||||
}
|
}
|
||||||
const QSharedPointer<DebuggerStartParameters> sp(new DebuggerStartParameters);
|
const QSharedPointer<DebuggerStartParameters> sp(new DebuggerStartParameters);
|
||||||
sp->attachPID = pid;
|
sp->attachPID = pid;
|
||||||
|
sp->crashParameter = crashParameter;
|
||||||
|
const DebuggerStartMode dsm = crashParameter.isEmpty() ? AttachExternal : AttachCrashedExternal;
|
||||||
QSharedPointer<RunConfiguration> rc = activeRunConfiguration();
|
QSharedPointer<RunConfiguration> rc = activeRunConfiguration();
|
||||||
if (RunControl *runControl = m_debuggerRunner
|
if (RunControl *runControl = m_debuggerRunner
|
||||||
->run(rc, ProjectExplorer::Constants::DEBUGMODE, sp, AttachExternal))
|
->run(rc, ProjectExplorer::Constants::DEBUGMODE, sp, dsm))
|
||||||
runControl->start();
|
runControl->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ private:
|
|||||||
inline bool parseArgument(QStringList::const_iterator &it,
|
inline bool parseArgument(QStringList::const_iterator &it,
|
||||||
const QStringList::const_iterator& end,
|
const QStringList::const_iterator& end,
|
||||||
QString *errorMessage);
|
QString *errorMessage);
|
||||||
void attachExternalApplication(qint64 pid);
|
void attachExternalApplication(qint64 pid, const QString &crashParameter = QString());
|
||||||
|
|
||||||
friend class DebuggerManager;
|
friend class DebuggerManager;
|
||||||
friend class GdbOptionPage;
|
friend class GdbOptionPage;
|
||||||
@@ -131,8 +131,8 @@ private:
|
|||||||
int m_gdbRunningContext;
|
int m_gdbRunningContext;
|
||||||
unsigned m_cmdLineEnabledEngines;
|
unsigned m_cmdLineEnabledEngines;
|
||||||
quint64 m_cmdLineAttachPid;
|
quint64 m_cmdLineAttachPid;
|
||||||
// Exception that crashed an app passed on by Windows
|
// Event handle for attaching to crashed Windows processes.
|
||||||
unsigned long m_cmdLineWinException;
|
quint64 m_cmdLineWinCrashEvent;
|
||||||
QAction *m_toggleLockedAction;
|
QAction *m_toggleLockedAction;
|
||||||
|
|
||||||
QAction *m_startExternalAction;
|
QAction *m_startExternalAction;
|
||||||
|
|||||||
@@ -1327,7 +1327,7 @@ void GdbEngine::exitDebugger()
|
|||||||
qDebug() << "STATUS ON EXITDEBUGGER:" << q->status());
|
qDebug() << "STATUS ON EXITDEBUGGER:" << q->status());
|
||||||
interruptInferior();
|
interruptInferior();
|
||||||
}
|
}
|
||||||
if (q->startMode() == AttachExternal)
|
if (q->startMode() == AttachExternal || q->startMode() == AttachCrashedExternal)
|
||||||
postCommand(_("detach"));
|
postCommand(_("detach"));
|
||||||
else
|
else
|
||||||
postCommand(_("kill"));
|
postCommand(_("kill"));
|
||||||
@@ -1355,7 +1355,7 @@ int GdbEngine::currentFrame() const
|
|||||||
return qq->stackHandler()->currentIndex();
|
return qq->stackHandler()->currentIndex();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GdbEngine::startDebugger()
|
bool GdbEngine::startDebugger(const QSharedPointer<DebuggerStartParameters> &sp)
|
||||||
{
|
{
|
||||||
debugMessage(DebuggerSettings::instance()->dump());
|
debugMessage(DebuggerSettings::instance()->dump());
|
||||||
QStringList gdbArgs;
|
QStringList gdbArgs;
|
||||||
@@ -1369,9 +1369,7 @@ bool GdbEngine::startDebugger()
|
|||||||
gdbArgs.prepend(_("mi"));
|
gdbArgs.prepend(_("mi"));
|
||||||
gdbArgs.prepend(_("-i"));
|
gdbArgs.prepend(_("-i"));
|
||||||
|
|
||||||
const QSharedPointer<DebuggerStartParameters> sp = q->startParameters();
|
if (q->startMode() == AttachCore || q->startMode() == AttachExternal || q->startMode() == AttachCrashedExternal) {
|
||||||
|
|
||||||
if (q->startMode() == AttachCore || q->startMode() == AttachExternal) {
|
|
||||||
// nothing to do
|
// nothing to do
|
||||||
} else if (q->startMode() == StartRemote) {
|
} else if (q->startMode() == StartRemote) {
|
||||||
// Start the remote server
|
// Start the remote server
|
||||||
@@ -1510,7 +1508,7 @@ bool GdbEngine::startDebugger()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (q->startMode() == AttachExternal) {
|
if (q->startMode() == AttachExternal || q->startMode() == AttachCrashedExternal) {
|
||||||
postCommand(_("attach %1").arg(sp->attachPID), CB(handleAttach));
|
postCommand(_("attach %1").arg(sp->attachPID), CB(handleAttach));
|
||||||
qq->breakHandler()->removeAllBreakpoints();
|
qq->breakHandler()->removeAllBreakpoints();
|
||||||
} else if (q->startMode() == AttachCore) {
|
} else if (q->startMode() == AttachCore) {
|
||||||
|
|||||||
@@ -97,7 +97,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();
|
bool startDebugger(const QSharedPointer<DebuggerStartParameters> &sp);
|
||||||
void exitDebugger();
|
void exitDebugger();
|
||||||
void detachDebugger();
|
void detachDebugger();
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
|
|
||||||
#include <QtCore/QObject>
|
#include <QtCore/QObject>
|
||||||
#include <QtCore/QList>
|
#include <QtCore/QList>
|
||||||
|
#include <QtCore/QSharedPointer>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
class QPoint;
|
class QPoint;
|
||||||
@@ -46,6 +47,7 @@ namespace Debugger {
|
|||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class Symbol;
|
class Symbol;
|
||||||
|
struct DebuggerStartParameters;
|
||||||
|
|
||||||
class IDebuggerEngine : public QObject
|
class IDebuggerEngine : public QObject
|
||||||
{
|
{
|
||||||
@@ -54,7 +56,7 @@ public:
|
|||||||
|
|
||||||
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() = 0;
|
virtual bool startDebugger(const QSharedPointer<DebuggerStartParameters> &startParameters) = 0;
|
||||||
virtual void exitDebugger() = 0;
|
virtual void exitDebugger() = 0;
|
||||||
virtual void detachDebugger() {}
|
virtual void detachDebugger() {}
|
||||||
virtual void updateWatchModel() = 0;
|
virtual void updateWatchModel() = 0;
|
||||||
|
|||||||
@@ -219,12 +219,12 @@ void ScriptEngine::exitDebugger()
|
|||||||
qq->notifyInferiorExited();
|
qq->notifyInferiorExited();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ScriptEngine::startDebugger()
|
bool ScriptEngine::startDebugger(const QSharedPointer<DebuggerStartParameters> &sp)
|
||||||
{
|
{
|
||||||
m_stopped = false;
|
m_stopped = false;
|
||||||
m_stopOnNextLine = false;
|
m_stopOnNextLine = false;
|
||||||
m_scriptEngine->abortEvaluation();
|
m_scriptEngine->abortEvaluation();
|
||||||
const QSharedPointer<DebuggerStartParameters> sp = q->startParameters();
|
|
||||||
QFileInfo fi(sp->executable);
|
QFileInfo fi(sp->executable);
|
||||||
m_scriptFileName = fi.absoluteFilePath();
|
m_scriptFileName = fi.absoluteFilePath();
|
||||||
QFile scriptFile(m_scriptFileName);
|
QFile scriptFile(m_scriptFileName);
|
||||||
|
|||||||
@@ -76,7 +76,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();
|
bool startDebugger(const QSharedPointer<DebuggerStartParameters> &sp);
|
||||||
|
|
||||||
void exitDebugger();
|
void exitDebugger();
|
||||||
|
|
||||||
void continueInferior();
|
void continueInferior();
|
||||||
|
|||||||
@@ -221,10 +221,9 @@ void TcfEngine::exitDebugger()
|
|||||||
qq->notifyInferiorExited();
|
qq->notifyInferiorExited();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TcfEngine::startDebugger()
|
bool TcfEngine::startDebugger(const QSharedPointer<DebuggerStartParameters> &sp)
|
||||||
{
|
{
|
||||||
qq->notifyInferiorRunningRequested();
|
qq->notifyInferiorRunningRequested();
|
||||||
const QSharedPointer<DebuggerStartParameters> sp = qq->startParameters();
|
|
||||||
const int pos = sp->remoteChannel.indexOf(QLatin1Char(':'));
|
const int pos = sp->remoteChannel.indexOf(QLatin1Char(':'));
|
||||||
const QString host = sp->remoteChannel.left(pos);
|
const QString host = sp->remoteChannel.left(pos);
|
||||||
const quint16 port = sp->remoteChannel.mid(pos + 1).toInt();
|
const quint16 port = sp->remoteChannel.mid(pos + 1).toInt();
|
||||||
|
|||||||
@@ -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();
|
bool startDebugger(const QSharedPointer<DebuggerStartParameters> &sp);
|
||||||
void exitDebugger();
|
void exitDebugger();
|
||||||
|
|
||||||
void continueInferior();
|
void continueInferior();
|
||||||
|
|||||||
Reference in New Issue
Block a user