summaryrefslogtreecommitdiff
path: root/platform/windows/os_windows.cpp
diff options
context:
space:
mode:
authorMax Hilbrunner <mhilbrunner@users.noreply.github.com>2018-05-08 07:00:45 +0200
committerGitHub <noreply@github.com>2018-05-08 07:00:45 +0200
commitaf128f6d39b06779b094f409393c9640b400e2d7 (patch)
tree04f97168d999f5b3292f402d1435ca21fbcf5c43 /platform/windows/os_windows.cpp
parentc32b24da70ebf345a2c6aa4092ee7b96c1a2a6ac (diff)
parentc45f44d85635a1d16a93c00cd8cb17f60dfa6336 (diff)
Merge pull request #16573 from StateOff/more_console_debugging
Local debugging fix & extensions
Diffstat (limited to 'platform/windows/os_windows.cpp')
-rw-r--r--platform/windows/os_windows.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index bed5781ae4..7b46608c55 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -152,6 +152,25 @@ void RedirectIOToConsole() {
// point to console as well
}
+BOOL WINAPI HandlerRoutine(_In_ DWORD dwCtrlType) {
+ if (ScriptDebugger::get_singleton() == NULL)
+ return FALSE;
+
+ switch (dwCtrlType) {
+ case CTRL_C_EVENT:
+ ScriptDebugger::get_singleton()->set_depth(-1);
+ ScriptDebugger::get_singleton()->set_lines_left(1);
+ return TRUE;
+ default:
+ return FALSE;
+ }
+}
+
+void OS_Windows::initialize_debugging() {
+
+ SetConsoleCtrlHandler(HandlerRoutine, TRUE);
+}
+
void OS_Windows::initialize_core() {
crash_handler.initialize();