mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-30 21:05:56 -05:00
sys: Trigger breakpoint in debug mode when a signal is raised
This commit is contained in:
@@ -319,10 +319,14 @@
|
||||
ImGui::SetCursorPosX(ImGui::GetWindowWidth() - buttonSize.x * 6);
|
||||
#if defined(DEBUG)
|
||||
if (ImGui::TitleBarButton(ICON_VS_DEBUG, buttonSize)) {
|
||||
if (ImGui::GetIO().KeyCtrl && ImGui::GetIO().KeyShift) {
|
||||
if (ImGui::GetIO().KeyCtrl) {
|
||||
// Explicitly trigger a segfault by writing to an invalid memory location
|
||||
// Used for debugging crashes
|
||||
*reinterpret_cast<u8*>(0x10) = 0x10;
|
||||
} else if (ImGui::GetIO().KeyShift) {
|
||||
// Explicitly trigger an abort by throwing an uncaught exception
|
||||
// Used for debugging exception errors
|
||||
throw std::runtime_error("Debug Error");
|
||||
} else {
|
||||
hex::openWebpage("https://imhex.werwolv.net/debug");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user