1
0
mirror of synced 2025-02-20 04:01:01 +01:00

sys: Added debug function to crash ImHex

This commit is contained in:
WerWolv 2021-09-20 20:48:08 +02:00
parent c5cd6422c6
commit 46f196cb3f

View File

@ -222,8 +222,15 @@
ImGui::SetCursorPosX(ImGui::GetWindowWidth() - buttonSize.x * 6);
#if defined(DEBUG)
if (ImGui::TitleBarButton(ICON_VS_DEBUG, buttonSize))
hex::openWebpage("https://imhex.werwolv.net/debug");
if (ImGui::TitleBarButton(ICON_VS_DEBUG, buttonSize)) {
if (ImGui::GetIO().KeyCtrl && ImGui::GetIO().KeyShift) {
// Explicitly trigger a segfault by writing to an invalid memory location
// Used for debugging crashes
*reinterpret_cast<u8*>(0x10) = 0x10;
} else {
hex::openWebpage("https://imhex.werwolv.net/debug");
}
}
ImGui::InfoTooltip("hex.menu.debug_build"_lang);
#endif
if (ImGui::TitleBarButton(ICON_VS_SMILEY, buttonSize))