aboutsummaryrefslogtreecommitdiff
path: root/drivers/unix/os_unix.cpp
diff options
context:
space:
mode:
authorMax Hilbrunner2018-05-08 07:00:45 +0200
committerGitHub2018-05-08 07:00:45 +0200
commitaf128f6d39b06779b094f409393c9640b400e2d7 (patch)
tree04f97168d999f5b3292f402d1435ca21fbcf5c43 /drivers/unix/os_unix.cpp
parentc32b24da70ebf345a2c6aa4092ee7b96c1a2a6ac (diff)
parentc45f44d85635a1d16a93c00cd8cb17f60dfa6336 (diff)
downloadgodot-af128f6d39b06779b094f409393c9640b400e2d7.tar.gz
godot-af128f6d39b06779b094f409393c9640b400e2d7.tar.zst
godot-af128f6d39b06779b094f409393c9640b400e2d7.zip
Merge pull request #16573 from StateOff/more_console_debugging
Local debugging fix & extensions
Diffstat (limited to 'drivers/unix/os_unix.cpp')
-rw-r--r--drivers/unix/os_unix.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp
index eeb3b31fc..1e34d63b1 100644
--- a/drivers/unix/os_unix.cpp
+++ b/drivers/unix/os_unix.cpp
@@ -73,6 +73,23 @@ void OS_Unix::debug_break() {
assert(false);
};
+static void handle_interrupt(int sig) {
+ if (ScriptDebugger::get_singleton() == NULL)
+ return;
+
+ ScriptDebugger::get_singleton()->set_depth(-1);
+ ScriptDebugger::get_singleton()->set_lines_left(1);
+}
+
+void OS_Unix::initialize_debugging() {
+
+ if (ScriptDebugger::get_singleton() != NULL) {
+ struct sigaction action;
+ action.sa_handler = handle_interrupt;
+ sigaction(SIGINT, &action, NULL);
+ }
+}
+
int OS_Unix::unix_initialize_audio(int p_audio_driver) {
return 0;