From 992d99592f1022593e4df276e39e8f4f65822f74 Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Fri, 8 Mar 2024 09:19:15 +0100 Subject: `:quit` in the debugger should quit the whole program (cherry picked from commit 2a8fe9a93837733e9dd9ed5c078734a35b203e14) Change-Id: I71dadfef6b24d9272b206e9e2c408040559d8a1c --- src/libutil/exit.cc | 7 +++++++ src/libutil/exit.hh | 19 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 src/libutil/exit.cc create mode 100644 src/libutil/exit.hh (limited to 'src/libutil') diff --git a/src/libutil/exit.cc b/src/libutil/exit.cc new file mode 100644 index 000000000..73cd8b04e --- /dev/null +++ b/src/libutil/exit.cc @@ -0,0 +1,7 @@ +#include "exit.hh" + +namespace nix { + +Exit::~Exit() {} + +} diff --git a/src/libutil/exit.hh b/src/libutil/exit.hh new file mode 100644 index 000000000..55f33e62f --- /dev/null +++ b/src/libutil/exit.hh @@ -0,0 +1,19 @@ +#pragma once + +#include + +namespace nix { + +/** + * Exit the program with a given exit code. + */ +class Exit : public std::exception +{ +public: + int status; + Exit() : status(0) { } + explicit Exit(int status) : status(status) { } + virtual ~Exit(); +}; + +} -- cgit v1.2.3