QTest::CrashHandler: reorganize Unix header blocks
Change-Id: Ib45e7e913fcc2e00f198fffdcc216e9f74c97e15 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
parent
cf0c73e9fe
commit
2ef4ea3319
@ -21,12 +21,6 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#if defined(Q_OS_LINUX)
|
|
||||||
#include <sys/prctl.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#if __has_include(<paths.h>)
|
#if __has_include(<paths.h>)
|
||||||
# include <paths.h>
|
# include <paths.h>
|
||||||
@ -41,16 +35,6 @@
|
|||||||
# include <sys/resource.h>
|
# include <sys/resource.h>
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# ifndef _PATH_DEFPATH
|
|
||||||
# define _PATH_DEFPATH "/usr/bin:/bin"
|
|
||||||
# endif
|
|
||||||
# ifndef SIGSTKSZ
|
|
||||||
# define SIGSTKSZ 0 /* we have code to set the minimum */
|
|
||||||
# endif
|
|
||||||
# ifndef SA_RESETHAND
|
|
||||||
# define SA_RESETHAND 0
|
|
||||||
# endif
|
|
||||||
|
|
||||||
#if defined(Q_OS_MACOS)
|
#if defined(Q_OS_MACOS)
|
||||||
#include <QtCore/private/qcore_mac_p.h>
|
#include <QtCore/private/qcore_mac_p.h>
|
||||||
#include <QtTest/private/qtestutil_macos_p.h>
|
#include <QtTest/private/qtestutil_macos_p.h>
|
||||||
@ -59,12 +43,30 @@
|
|||||||
#include <mach/task.h>
|
#include <mach/task.h>
|
||||||
#include <mach/mach_init.h>
|
#include <mach/mach_init.h>
|
||||||
#include <CoreFoundation/CFPreferences.h>
|
#include <CoreFoundation/CFPreferences.h>
|
||||||
|
|
||||||
|
#define CSR_ALLOW_UNRESTRICTED_FS (1 << 1)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(Q_OS_LINUX)
|
||||||
|
#include <sys/prctl.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <fcntl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(Q_OS_WASM)
|
#if defined(Q_OS_WASM)
|
||||||
#include <emscripten.h>
|
#include <emscripten.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef _PATH_DEFPATH
|
||||||
|
# define _PATH_DEFPATH "/usr/bin:/bin"
|
||||||
|
#endif
|
||||||
|
#ifndef SIGSTKSZ
|
||||||
|
# define SIGSTKSZ 0 /* we have code to set the minimum */
|
||||||
|
#endif
|
||||||
|
#ifndef SA_RESETHAND
|
||||||
|
# define SA_RESETHAND 0
|
||||||
|
#endif
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
using namespace Qt::StringLiterals;
|
using namespace Qt::StringLiterals;
|
||||||
@ -285,8 +287,7 @@ void prepareStackTrace()
|
|||||||
// where LLDB will hang and fail to provide a valid stack trace.
|
// where LLDB will hang and fail to provide a valid stack trace.
|
||||||
# if defined(Q_PROCESSOR_ARM)
|
# if defined(Q_PROCESSOR_ARM)
|
||||||
return;
|
return;
|
||||||
#else
|
# else
|
||||||
#define CSR_ALLOW_UNRESTRICTED_FS (1 << 1)
|
|
||||||
std::optional<uint32_t> sipConfiguration = qt_mac_sipConfiguration();
|
std::optional<uint32_t> sipConfiguration = qt_mac_sipConfiguration();
|
||||||
if (!sipConfiguration || !(*sipConfiguration & CSR_ALLOW_UNRESTRICTED_FS))
|
if (!sipConfiguration || !(*sipConfiguration & CSR_ALLOW_UNRESTRICTED_FS))
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user