[breakpad] enable Solaris crash dumps
Some checks failed
eden-license / license-header (pull_request) Failing after 28s

Signed-off-by: lizzie <lizzie@eden-emu.dev>
This commit is contained in:
lizzie 2025-08-30 07:02:04 +00:00
parent 03b4f57364
commit ca721fdb90
Signed by: Lizzie
GPG key ID: 00287378CADCAB13
3 changed files with 7 additions and 5 deletions

View file

@ -707,7 +707,7 @@ if(ENABLE_QT)
set_target_properties(Qt6::Platform PROPERTIES INTERFACE_COMPILE_FEATURES "") set_target_properties(Qt6::Platform PROPERTIES INTERFACE_COMPILE_FEATURES "")
endif() endif()
if (WIN32 AND YUZU_CRASH_DUMPS) if (YUZU_CRASH_DUMPS)
set(BREAKPAD_VER "breakpad-c89f9dd") set(BREAKPAD_VER "breakpad-c89f9dd")
download_bundled_external("breakpad/" ${BREAKPAD_VER} "breakpad-win" BREAKPAD_PREFIX "c89f9dd") download_bundled_external("breakpad/" ${BREAKPAD_VER} "breakpad-win" BREAKPAD_PREFIX "c89f9dd")

View file

@ -251,9 +251,7 @@ if (YUZU_CRASH_DUMPS)
breakpad.cpp breakpad.cpp
breakpad.h breakpad.h
) )
target_link_libraries(yuzu PRIVATE libbreakpad_client) target_link_libraries(yuzu PRIVATE libbreakpad_client)
target_compile_definitions(yuzu PRIVATE YUZU_CRASH_DUMPS)
endif() endif()
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")

View file

@ -8,6 +8,8 @@
#include <client/windows/handler/exception_handler.h> #include <client/windows/handler/exception_handler.h>
#elif defined(__linux__) #elif defined(__linux__)
#include <client/linux/handler/exception_handler.h> #include <client/linux/handler/exception_handler.h>
#elif defined(__sun__)
#include <client/solaris/handler/exception_handler.h>
#else #else
#error Minidump creation not supported on this platform #error Minidump creation not supported on this platform
#endif #endif
@ -49,7 +51,7 @@ static void PruneDumpDirectory(const std::filesystem::path& dump_path) {
} }
} }
#if defined(__linux__) #ifdef __linux__
[[noreturn]] bool DumpCallback(const google_breakpad::MinidumpDescriptor& descriptor, void* context, [[noreturn]] bool DumpCallback(const google_breakpad::MinidumpDescriptor& descriptor, void* context,
bool succeeded) { bool succeeded) {
// Prevent time- and space-consuming core dumps from being generated, as we have // Prevent time- and space-consuming core dumps from being generated, as we have
@ -63,7 +65,7 @@ void InstallCrashHandler() {
const auto dump_path = GetEdenPath(Common::FS::EdenPath::CrashDumpsDir); const auto dump_path = GetEdenPath(Common::FS::EdenPath::CrashDumpsDir);
PruneDumpDirectory(dump_path); PruneDumpDirectory(dump_path);
#if defined(_WIN32) #ifdef _WIN32
// TODO: If we switch to MinGW builds for Windows, this needs to be wrapped in a C API. // TODO: If we switch to MinGW builds for Windows, this needs to be wrapped in a C API.
static google_breakpad::ExceptionHandler eh{dump_path, nullptr, nullptr, nullptr, static google_breakpad::ExceptionHandler eh{dump_path, nullptr, nullptr, nullptr,
google_breakpad::ExceptionHandler::HANDLER_ALL}; google_breakpad::ExceptionHandler::HANDLER_ALL};
@ -71,6 +73,8 @@ void InstallCrashHandler() {
static google_breakpad::MinidumpDescriptor descriptor{dump_path}; static google_breakpad::MinidumpDescriptor descriptor{dump_path};
static google_breakpad::ExceptionHandler eh{descriptor, nullptr, DumpCallback, static google_breakpad::ExceptionHandler eh{descriptor, nullptr, DumpCallback,
nullptr, true, -1}; nullptr, true, -1};
#elif defined(__sun__)
static google_breakpad::ExceptionHandler eh{dump_path, nullptr, DumpCallback, nullptr, true};
#endif #endif
} }