From 733c5a68a37ae0ae2ce8fee64ef86c90837ce8a9 Mon Sep 17 00:00:00 2001 From: taynpg Date: Wed, 16 Apr 2025 22:55:46 +0800 Subject: [PATCH] =?UTF-8?q?rec=EF=BC=9A=E6=9C=8D=E5=8A=A1=E7=AB=AF?= =?UTF-8?q?=E7=BB=88=E6=AD=A2=E6=81=A2=E5=A4=8D=E7=BB=88=E7=AB=AF=E9=A2=9C?= =?UTF-8?q?=E8=89=B2=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/settings.json | 90 ++++++++++++++++++++++++++++++++++++++++++- crashelper | 2 +- server/main.cpp | 9 +++++ 3 files changed, 99 insertions(+), 2 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 7525efd..cefedf9 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -40,6 +40,94 @@ "files.associations": { ".clang-tidy": "yaml", "filesystem": "cpp", - "regex": "cpp" + "regex": "cpp", + "functional": "cpp", + "algorithm": "cpp", + "any": "cpp", + "array": "cpp", + "atomic": "cpp", + "bit": "cpp", + "bitset": "cpp", + "cctype": "cpp", + "charconv": "cpp", + "chrono": "cpp", + "clocale": "cpp", + "cmath": "cpp", + "codecvt": "cpp", + "compare": "cpp", + "complex": "cpp", + "concepts": "cpp", + "condition_variable": "cpp", + "coroutine": "cpp", + "csignal": "cpp", + "cstdarg": "cpp", + "cstddef": "cpp", + "cstdint": "cpp", + "cstdio": "cpp", + "cstdlib": "cpp", + "cstring": "cpp", + "ctime": "cpp", + "cwchar": "cpp", + "deque": "cpp", + "exception": "cpp", + "expected": "cpp", + "resumable": "cpp", + "format": "cpp", + "forward_list": "cpp", + "fstream": "cpp", + "future": "cpp", + "initializer_list": "cpp", + "iomanip": "cpp", + "ios": "cpp", + "iosfwd": "cpp", + "iostream": "cpp", + "istream": "cpp", + "iterator": "cpp", + "limits": "cpp", + "list": "cpp", + "locale": "cpp", + "map": "cpp", + "memory": "cpp", + "mutex": "cpp", + "new": "cpp", + "numeric": "cpp", + "optional": "cpp", + "ostream": "cpp", + "queue": "cpp", + "random": "cpp", + "ratio": "cpp", + "set": "cpp", + "shared_mutex": "cpp", + "source_location": "cpp", + "sstream": "cpp", + "stack": "cpp", + "stdexcept": "cpp", + "stop_token": "cpp", + "streambuf": "cpp", + "string": "cpp", + "system_error": "cpp", + "thread": "cpp", + "tuple": "cpp", + "type_traits": "cpp", + "typeinfo": "cpp", + "unordered_map": "cpp", + "utility": "cpp", + "variant": "cpp", + "vector": "cpp", + "xfacet": "cpp", + "xhash": "cpp", + "xiosbase": "cpp", + "xlocale": "cpp", + "xlocbuf": "cpp", + "xlocinfo": "cpp", + "xlocmes": "cpp", + "xlocmon": "cpp", + "xlocnum": "cpp", + "xloctime": "cpp", + "xmemory": "cpp", + "xstring": "cpp", + "xtr1common": "cpp", + "xtree": "cpp", + "xutility": "cpp" } } \ No newline at end of file diff --git a/crashelper b/crashelper index eed787c..5ec7814 160000 --- a/crashelper +++ b/crashelper @@ -1 +1 @@ -Subproject commit eed787c1bfc1ed1585843923673e27354be7c0bd +Subproject commit 5ec78141817eef68f92a89b19ea5675f8b5b559b diff --git a/server/main.cpp b/server/main.cpp index 0c1ec5f..3989409 100644 --- a/server/main.cpp +++ b/server/main.cpp @@ -25,6 +25,14 @@ namespace fs = std::filesystem; #include #endif +void signal_handler(int signal) +{ + if (signal == SIGINT) { + fc_recovery_color(); + exit(signal); + } +} + int main(int argc, char* argv[]) { #if defined(GRAB_CRASH) @@ -33,6 +41,7 @@ int main(int argc, char* argv[]) backward::SetDumpFileSavePath(err); backward::SetDumpLogSavePath(err); CRASHELPER_MARK_ENTRY(); + sh.register_user_sig_handler([](int sig) { signal_handler(sig); }); #endif #ifdef _WIN32