diff options
| author | Blazej Floch | 2018-02-11 06:08:37 -0500 |
|---|---|---|
| committer | Blazej Floch | 2018-05-07 23:17:06 -0400 |
| commit | c45f44d85635a1d16a93c00cd8cb17f60dfa6336 (patch) | |
| tree | 72075a2ec56dda5d512885e19b28295dbecf7b48 /drivers/unix | |
| parent | 9b1fdad035f226bb7eba3e592083fc40a9e1ab27 (diff) | |
| download | godot-c45f44d85635a1d16a93c00cd8cb17f60dfa6336.tar.gz godot-c45f44d85635a1d16a93c00cd8cb17f60dfa6336.tar.zst godot-c45f44d85635a1d16a93c00cd8cb17f60dfa6336.zip | |
Diffstat (limited to 'drivers/unix')
| -rw-r--r-- | drivers/unix/os_unix.cpp | 17 | ||||
| -rw-r--r-- | drivers/unix/os_unix.h | 1 |
2 files changed, 18 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; diff --git a/drivers/unix/os_unix.h b/drivers/unix/os_unix.h index db0fe1e00..95b74d23f 100644 --- a/drivers/unix/os_unix.h +++ b/drivers/unix/os_unix.h @@ -101,6 +101,7 @@ public: virtual int get_processor_count() const; virtual void debug_break(); + virtual void initialize_debugging(); virtual String get_executable_path() const; virtual String get_user_data_dir() const; |
