From ac31e2dd4f66c322e1a492d1bd6db3a5e965f92d Mon Sep 17 00:00:00 2001 From: Mihai Fufezan Date: Thu, 7 Nov 2024 16:14:50 +0200 Subject: [PATCH] Nix: add info on stacktraces --- pages/Nix/Contributing and Debugging.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pages/Nix/Contributing and Debugging.md b/pages/Nix/Contributing and Debugging.md index 7283bf5..cf15acf 100644 --- a/pages/Nix/Contributing and Debugging.md +++ b/pages/Nix/Contributing and Debugging.md @@ -41,6 +41,22 @@ Run `nix develop` first, then follow the [Building with ASan](https://wiki.hyprland.org/Crashes-and-Bugs/#building-the-wayland-stack-with-asan) guide. +## Getting a debug stacktrace + +Debug stacktraces provide useful info on why a program crashed. To get proper +stacktraces from Hyprland, make sure it was [built in debug mode](#build-in-debug-mode). + +After a crash, perform the following steps: + +```sh +nix shell nixpkgs#gdb # get gdb temporarily +coredumpctl # check the PID of the recent crash +coredumpctl debug # using the PID found in the previous step +``` + +The rest of the process is the same as +[here](../../Crashes-and-Bugs#obtaining-a-debug-stacktrace), from step 3 onwards. + ## Manual building Nix works differently than other build systems, so it has its own abstractions