Skip to content
Snippets Groups Projects
Commit 12bf40db authored by David Schulz's avatar David Schulz Committed by hjk
Browse files

Debugger: DebugBreakApi is always used under 32bit Windows


Change-Id: Iacd672cf38f698912609aeb2d3e7d54101bcfe0d
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent 41cbb6cd
No related branches found
No related tags found
No related merge requests found
...@@ -37,7 +37,6 @@ ...@@ -37,7 +37,6 @@
#include <QProcess> // makes kill visible on Windows. #include <QProcess> // makes kill visible on Windows.
#include <QFile> #include <QFile>
#include <QDir> #include <QDir>
using namespace Debugger::Internal; using namespace Debugger::Internal;
static inline QString msgCannotInterrupt(int pid, const QString &why) static inline QString msgCannotInterrupt(int pid, const QString &why)
...@@ -99,23 +98,38 @@ bool Debugger::Internal::interruptProcess(int pID, int engineType, QString *erro ...@@ -99,23 +98,38 @@ bool Debugger::Internal::interruptProcess(int pID, int engineType, QString *erro
// Try DebugBreakProcess if either Qt Creator is compiled 64 bit or // Try DebugBreakProcess if either Qt Creator is compiled 64 bit or
// both Qt Creator and application are 32 bit. // both Qt Creator and application are 32 bit.
#ifdef Q_OS_WIN64 #ifdef Q_OS_WIN64
Q_UNUSED(engineType) // Qt-Creator compiled 64 bit
// Qt-Creator compiled 64 bit: Always use DebugBreakProcess. // Windows must be 64 bit
const bool useDebugBreakApi = true; // CDB 64 bit: use DebugBreakProcess for 32 an 64 bit processes.
// CDB 32 bit: untested
// GDB: not supported
const bool useDebugBreakApi= true;
#else #else
// Qt-Creator compiled 32 bit: // Qt-Creator compiled 32 bit:
// CDB: If Qt-Creator is a WOW64 process (meaning a 32bit process
// running in emulation), always use win64interrupt.exe for native bool useDebugBreakApi;
// 64 bit processes and WOW64 processes. While DebugBreakProcess() if (isWow64Process(GetCurrentProcess())) {
// works in theory for other WOW64 processes, the break appears // Windows is 64 bit
// as a WOW64 breakpoint, which CDB is configured to ignore since if (engineType == CdbEngineType) {
// it also triggers on module loading. // CDB 64 bit: If Qt-Creator is a WOW64 process (meaning a 32bit process
// GDB: Use win64interrupt for native 64bit processes only (it fails // running in emulation), always use win64interrupt.exe for native
// for WOW64 processes. // 64 bit processes and WOW64 processes. While DebugBreakProcess()
static const bool hostIsWow64Process = isWow64Process(GetCurrentProcess()); // works in theory for other WOW64 processes, the break appears
const bool useDebugBreakApi = engineType == CdbEngineType ? // as a WOW64 breakpoint, which CDB is configured to ignore since
!hostIsWow64Process : // it also triggers on module loading.
!isWow64Process(inferior); // CDB 32 bit: untested
useDebugBreakApi = false;
} else {
// GDB: Use win64interrupt for native 64bit processes only (it fails
// for WOW64 processes.
useDebugBreakApi = isWow64Process(inferior);
}
} else {
// Windows is 32 bit
// All processes are 32 bit, so DebugBreakProcess can be used in all cases.
useDebugBreakApi = true;
}
#endif #endif
if (useDebugBreakApi) { if (useDebugBreakApi) {
ok = DebugBreakProcess(inferior); ok = DebugBreakProcess(inferior);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment