Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qtestcrashhandler_p.h
Go to the documentation of this file.
1
// Copyright (C) 2024 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4
//
5
// W A R N I N G
6
// -------------
7
//
8
// This file is not part of the Qt API. It exists purely as an
9
// implementation detail. This header file may change from version to
10
// version without notice, or even be removed.
11
//
12
// We mean it.
13
//
14
15
#
ifndef
QTESTCRASHHANDLER_H
16
#
define
QTESTCRASHHANDLER_H
17
18
#
include
<
QtCore
/
qnamespace
.
h
>
19
#
include
<
QtTest
/
qttestglobal
.
h
>
20
21
#
include
<
QtCore
/
private
/
qtools_p
.
h
>
22
23
#
ifdef
Q_OS_UNIX
24
#
include
<
sys
/
mman
.
h
>
// for MAP_FAILED
25
#
endif
26
27
QT_BEGIN_NAMESPACE
28
namespace
QTest
{
29
namespace
CrashHandler
{
30
enum
DebuggerProgram
{
31
None
,
32
Gdb
,
33
Lldb
,
34
#
ifdef
Q_OS_WIN
35
Cdb
,
36
#
endif
37
};
38
39
bool
alreadyDebugging
();
40
void
blockUnixSignals
();
41
42
#
if
!
defined
(
Q_OS_WASM
)
||
QT_CONFIG
(
thread
)
43
void
printTestRunTime
();
44
void
generateStackTrace
(
quintptr
ip
= 0);
45
#
endif
46
47
void
maybeDisableCoreDump
();
48
Q_TESTLIB_EXPORT
void
prepareStackTrace
();
49
50
#
if
defined
(
Q_OS_WIN
)
51
class
Q_TESTLIB_EXPORT
WindowsFaultHandler
52
{
53
public
:
54
WindowsFaultHandler
();
55
};
56
using
FatalSignalHandler
=
WindowsFaultHandler
;
57
#
elif
defined
(
Q_OS_UNIX
)
&&
!
defined
(
Q_OS_WASM
)
58
class
Q_TESTLIB_EXPORT
FatalSignalHandler
59
{
60
public
:
61
FatalSignalHandler
();
62
~
FatalSignalHandler
();
63
64
private
:
65
Q_DISABLE_COPY_MOVE
(
FatalSignalHandler
)
66
67
int
setupAlternateStack
();
68
void
freeAlternateStack
();
69
void
*
alternateStackBase
=
MAP_FAILED
;
70
};
71
#
else
// Q_OS_WASM or weird systems
72
class
Q_TESTLIB_EXPORT
FatalSignalHandler
{};
73
inline
void
blockUnixSignals
() {}
74
#
endif
// Q_OS_* choice
75
}
// namespace CrashHandler
76
}
// namespace QTest
77
QT_END_NAMESPACE
78
79
#
endif
// QTESTCRASHHANDLER_H
QTest::CrashHandler::FatalSignalHandler
Definition
qtestcrashhandler_p.h:72
QTest::CrashHandler
Definition
qtestcrashhandler_unix.cpp:211
QTest::CrashHandler::blockUnixSignals
void blockUnixSignals()
Definition
qtestcrashhandler_unix.cpp:492
QTest::CrashHandler::alreadyDebugging
bool alreadyDebugging()
Definition
qtestcrashhandler_unix.cpp:217
QTest::CrashHandler::maybeDisableCoreDump
void maybeDisableCoreDump()
Definition
qtestcrashhandler_unix.cpp:273
QTest::CrashHandler::prepareStackTrace
void prepareStackTrace()
Definition
qtestcrashhandler_unix.cpp:289
QTest::CrashHandler::DebuggerProgram
DebuggerProgram
Definition
qtestcrashhandler_p.h:30
QTest::CrashHandler::None
@ None
Definition
qtestcrashhandler_p.h:31
QTest::CrashHandler::Gdb
@ Gdb
Definition
qtestcrashhandler_p.h:32
QTest::CrashHandler::Lldb
@ Lldb
Definition
qtestcrashhandler_p.h:33
QTest
[15]
Definition
qtestsupport_core.h:14
qtbase
src
testlib
qtestcrashhandler_p.h
Generated on
for Qt by
1.14.0