QTest::CrashHandler: move the enum definition to the header

It's common between the two implementations, though currently completely
unused on Windows because we don't start debuggers.

Change-Id: I7a42db2db35cf6191693fffd3e4e46d482032630
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
This commit is contained in:
Thiago Macieira 2025-05-15 08:03:16 -07:00
parent 0409fa9edd
commit cf0c73e9fe
3 changed files with 9 additions and 4 deletions

View File

@ -27,6 +27,15 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
namespace QTest { namespace QTest {
namespace CrashHandler { namespace CrashHandler {
enum DebuggerProgram {
None,
Gdb,
Lldb,
#ifdef Q_OS_WIN
Cdb,
#endif
};
bool alreadyDebugging(); bool alreadyDebugging();
void blockUnixSignals(); void blockUnixSignals();

View File

@ -244,8 +244,6 @@ bool alreadyDebugging()
#endif #endif
} }
namespace {
enum DebuggerProgram { None, Gdb, Lldb };
static bool hasSystemCrashReporter() static bool hasSystemCrashReporter()
{ {
#if defined(Q_OS_MACOS) #if defined(Q_OS_MACOS)
@ -254,7 +252,6 @@ static bool hasSystemCrashReporter()
return false; return false;
#endif #endif
} }
} // unnamed namespaced
void maybeDisableCoreDump() void maybeDisableCoreDump()
{ {

View File

@ -33,7 +33,6 @@ void maybeDisableCoreDump()
{ {
} }
enum DebuggerProgram { None, Gdb, Lldb, Cdb };
static DebuggerProgram debugger = None; static DebuggerProgram debugger = None;
void prepareStackTrace() void prepareStackTrace()
{ {