From f79c1d9d2a389fde7c60cb9f1a2038ca7f4cb9ef Mon Sep 17 00:00:00 2001 From: Jake Ehrlich <96448973+JakeSiFive@users.noreply.github.com> Date: Thu, 29 Jun 2023 11:14:46 -0500 Subject: [PATCH] Always coredump on crash if we're allowed to (#1327) --- tools/wake/main.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/wake/main.cpp b/tools/wake/main.cpp index 1535c23bf..3b139d419 100644 --- a/tools/wake/main.cpp +++ b/tools/wake/main.cpp @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -190,6 +191,14 @@ class TerminalReporter : public DiagnosticReporter { }; int main(int argc, char **argv) { + // Make sure we always get core dumps but don't fail + // if that fails for some reason. + struct rlimit core_lim; + getrlimit(RLIMIT_CORE, &core_lim); + core_lim.rlim_cur = core_lim.rlim_max; + setrlimit(RLIMIT_CORE, &core_lim); + + // Get the start time for wake auto start = std::chrono::steady_clock::now(); TerminalReporter terminalReporter;