2025-11-03 21:07:30 +01:00
|
|
|
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
2022-04-23 04:59:50 -04:00
|
|
|
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
|
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2021-04-02 08:43:26 +02:00
|
|
|
|
|
|
|
|
#include "common/assert.h"
|
|
|
|
|
#include "common/common_funcs.h"
|
2023-12-25 13:50:22 +01:00
|
|
|
#include "common/logging/backend.h"
|
2021-04-14 16:07:40 -07:00
|
|
|
#include "common/settings.h"
|
2021-04-13 18:38:10 -07:00
|
|
|
|
2025-11-03 21:07:30 +01:00
|
|
|
#ifdef _MSC_VER
|
|
|
|
|
extern "C" {
|
|
|
|
|
__declspec(dllimport) void __stdcall DebugBreak(void);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
void AssertFailSoftImpl() {
|
2022-06-12 18:11:02 -04:00
|
|
|
if (Settings::values.use_debug_asserts) {
|
2023-12-25 13:50:22 +01:00
|
|
|
Common::Log::Stop();
|
2025-11-03 21:07:30 +01:00
|
|
|
#ifndef _MSC_VER
|
|
|
|
|
# if defined(ARCHITECTURE_x86_64)
|
|
|
|
|
__asm__ __volatile__("int $3");
|
|
|
|
|
# elif defined(ARCHITECTURE_arm64)
|
|
|
|
|
__asm__ __volatile__("brk #0");
|
|
|
|
|
# else
|
|
|
|
|
exit(1);
|
|
|
|
|
# endif
|
|
|
|
|
#else // POSIX ^^^ _MSC_VER vvv
|
|
|
|
|
DebugBreak();
|
|
|
|
|
#endif
|
2021-04-13 18:38:10 -07:00
|
|
|
}
|
2021-04-02 08:43:26 +02:00
|
|
|
}
|
2025-11-03 21:07:30 +01:00
|
|
|
void AssertFatalImpl() {
|
2023-12-25 13:50:22 +01:00
|
|
|
Common::Log::Stop();
|
2025-11-03 21:07:30 +01:00
|
|
|
std::abort();
|
2022-06-07 17:02:29 -04:00
|
|
|
}
|