diff options
| author | Amlal <amlal@nekernel.org> | 2025-04-26 14:55:49 +0200 |
|---|---|---|
| committer | Amlal <amlal@nekernel.org> | 2025-04-26 14:55:49 +0200 |
| commit | e40318e8104b992a9b42f71eeb7b27a36b675c93 (patch) | |
| tree | a800ab3a5574ee39592250af346be590aacbd180 /dev/LibCompiler | |
| parent | c791c2de8bdcd89035dd004b73d05217e40e179c (diff) | |
dev, cxxdrv: add sigsegv handler.
Signed-off-by: Amlal <amlal@nekernel.org>
Diffstat (limited to 'dev/LibCompiler')
| -rw-r--r-- | dev/LibCompiler/src/CPlusPlusCompilerAMD64.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/dev/LibCompiler/src/CPlusPlusCompilerAMD64.cc b/dev/LibCompiler/src/CPlusPlusCompilerAMD64.cc index e58e4f6..6a7f261 100644 --- a/dev/LibCompiler/src/CPlusPlusCompilerAMD64.cc +++ b/dev/LibCompiler/src/CPlusPlusCompilerAMD64.cc @@ -19,7 +19,7 @@ #include <LibCompiler/Backend/Amd64.h> #include <LibCompiler/Parser.h> #include <LibCompiler/UUID.h> - +#include <Vendor/Dialogs.h> #include <LibCompiler/Detail/ClUtils.h> #include <cstdio> @@ -51,6 +51,12 @@ ///////////////////////////////////// /// @internal +static void cxxdrv_chaos_handler(std::int32_t _) { + pfd::notify("NeKernel C++ Compiler Driver", "CxxDrv just crashed, please report this to the developers."); + std::exit(LIBCOMPILER_EXEC_ERROR); +} + +/// @internal namespace Detail { std::filesystem::path expand_home(const std::filesystem::path& p) { if (!p.empty() && p.string()[0] == '~') { @@ -932,6 +938,8 @@ LIBCOMPILER_MODULE(CompilerCPlusPlusAMD64) { kFactory.Mount(new AssemblyCPlusPlusInterface()); kCompilerFrontend = new CompilerFrontendCPlusPlus(); + ::signal(SIGSEGV, cxxdrv_chaos_handler); + for (auto index = 1UL; index < argc; ++index) { if (argv[index][0] == '-') { if (skip) { |
