diff --git a/Common/GPU/Vulkan/VulkanDebug.cpp b/Common/GPU/Vulkan/VulkanDebug.cpp index c0bf235677..0bda4815ca 100644 --- a/Common/GPU/Vulkan/VulkanDebug.cpp +++ b/Common/GPU/Vulkan/VulkanDebug.cpp @@ -21,6 +21,7 @@ #include #include "Common/Log.h" +#include "Common/System/System.h" #include "Common/GPU/Vulkan/VulkanContext.h" #include "Common/GPU/Vulkan/VulkanDebug.h" @@ -139,7 +140,7 @@ VKAPI_ATTR VkBool32 VKAPI_CALL VulkanDebugUtilsCallback( #ifdef _WIN32 OutputDebugStringA(msg.c_str()); if (messageSeverity & VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT) { - if (options->breakOnError && IsDebuggerPresent()) { + if (options->breakOnError && System_GetPropertyBool(SYSPROP_DEBUGGER_PRESENT)) { DebugBreak(); } if (options->msgBoxOnError) { @@ -147,7 +148,7 @@ VKAPI_ATTR VkBool32 VKAPI_CALL VulkanDebugUtilsCallback( } } else if (messageSeverity & VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT) { // Don't break on perf warnings for now, even with a debugger. We log them at least. - if (options->breakOnWarning && IsDebuggerPresent() && 0 == (messageType & VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT)) { + if (options->breakOnWarning && System_GetPropertyBool(SYSPROP_DEBUGGER_PRESENT) && 0 == (messageType & VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT)) { DebugBreak(); } } diff --git a/Common/System/System.h b/Common/System/System.h index 2b59d52ce2..5b009c5718 100644 --- a/Common/System/System.h +++ b/Common/System/System.h @@ -139,6 +139,8 @@ enum SystemProperty { SYSPROP_SUPPORTS_HTTPS, + SYSPROP_DEBUGGER_PRESENT, + // Available as Int: SYSPROP_SYSTEMVERSION, SYSPROP_DISPLAY_XRES, diff --git a/UI/DevScreens.cpp b/UI/DevScreens.cpp index 46e396bfd5..a4c4fb98a9 100644 --- a/UI/DevScreens.cpp +++ b/UI/DevScreens.cpp @@ -510,11 +510,9 @@ void SystemInfoScreen::CreateTabs() { if (!board.empty()) systemInfo->Add(new InfoItem(si->T("Board"), board)); systemInfo->Add(new InfoItem(si->T("ABI"), GetCompilerABI())); -#ifdef _WIN32 - if (IsDebuggerPresent()) { + if (System_GetPropertyBool(SYSPROP_DEBUGGER_PRESENT)) { systemInfo->Add(new InfoItem(si->T("Debugger Present"), di->T("Yes"))); } -#endif CollapsibleSection *cpuInfo = deviceSpecs->Add(new CollapsibleSection(si->T("CPU Information"))); diff --git a/UWP/PPSSPP_UWPMain.cpp b/UWP/PPSSPP_UWPMain.cpp index f9a0798d78..4293ac2a0b 100644 --- a/UWP/PPSSPP_UWPMain.cpp +++ b/UWP/PPSSPP_UWPMain.cpp @@ -431,6 +431,8 @@ bool System_GetPropertyBool(SystemProperty prop) { // I don't know any possible way to display input dialog in non-xaml apps return isKeyboardAvailable() || isTouchAvailable(); } + case SYSPROP_DEBUGGER_PRESENT: + return IsDebuggerPresent(); default: return false; } diff --git a/Windows/MainWindowMenu.cpp b/Windows/MainWindowMenu.cpp index cc5ea9a407..9f5b89253f 100644 --- a/Windows/MainWindowMenu.cpp +++ b/Windows/MainWindowMenu.cpp @@ -418,7 +418,7 @@ namespace MainWindow { } static void RestartApp() { - if (IsDebuggerPresent()) { + if (System_GetPropertyBool(SYSPROP_DEBUGGER_PRESENT)) { PostMessage(MainWindow::GetHWND(), WM_USER_RESTART_EMUTHREAD, 0, 0); } else { g_Config.bRestartRequired = true; diff --git a/Windows/main.cpp b/Windows/main.cpp index 5e651e019a..762d5a747e 100644 --- a/Windows/main.cpp +++ b/Windows/main.cpp @@ -381,6 +381,8 @@ bool System_GetPropertyBool(SystemProperty prop) { return true; // FileUtil.cpp: OpenFileInEditor case SYSPROP_SUPPORTS_HTTPS: return !g_Config.bDisableHTTPS; + case SYSPROP_DEBUGGER_PRESENT: + return IsDebuggerPresent(); default: return false; } @@ -494,7 +496,7 @@ bool System_MakeRequest(SystemRequestType type, int requestId, const std::string restartArgs = param1; if (!restartArgs.empty()) AddDebugRestartArgs(); - if (IsDebuggerPresent()) { + if (System_GetPropertyBool(SYSPROP_DEBUGGER_PRESENT)) { PostMessage(MainWindow::GetHWND(), MainWindow::WM_USER_RESTART_EMUTHREAD, 0, 0); } else { g_Config.bRestartRequired = true;