forked from qt-creator/qt-creator
Debugger: Fix interrupting code.
- Windows: Always use DebugBreakProcess if Qt Creator is compiled 64bit. Else always use win64interrupt.exe if Qt Creator is a WOW64 application. - Remove redundant code (procinterrupt/hostutils, gdb adapters). - Give interruptProcess an errorMessage parameter such that it can be used by all C++ engines and a proper error is displayed. - Improve error messages. - Build win64interrupt if target architecture is 64 bit (clean tools profile, add a profile), borrowing the check from qtcreatorcdbext.pro. Change-Id: I2a6caf98e46051c49c84e1f3aac4c8d2aba66e8b Reviewed-by: David Schulz <david.schulz@nokia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
#include "gdbengine.h"
|
||||
#include "debuggerstartparameters.h"
|
||||
#include "abstractgdbprocess.h"
|
||||
#include "procinterrupt.h"
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
@@ -158,5 +159,21 @@ void AbstractGdbAdapter::handleRemoteSetupFailed(const QString &reason)
|
||||
Q_UNUSED(reason);
|
||||
}
|
||||
|
||||
void AbstractGdbAdapter::interruptLocalInferior(qint64 pid)
|
||||
{
|
||||
QTC_ASSERT(state() == InferiorStopRequested, qDebug() << state(); return);
|
||||
if (pid <= 0) {
|
||||
showMessage(QLatin1String("TRYING TO INTERRUPT INFERIOR BEFORE PID WAS OBTAINED"), LogError);
|
||||
return;
|
||||
}
|
||||
QString errorMessage;
|
||||
if (interruptProcess(pid, GdbEngineType, &errorMessage)) {
|
||||
showMessage(QLatin1String("Interrupted ") + QString::number(pid));
|
||||
} else {
|
||||
showMessage(errorMessage, LogError);
|
||||
m_engine->notifyInferiorStopFailed();
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Debugger
|
||||
|
||||
Reference in New Issue
Block a user