From 9666fbcab891156fb058d6a1b8f427ccc3ffecab Mon Sep 17 00:00:00 2001 From: Sam Estep Date: Wed, 23 Jul 2025 21:34:21 -0400 Subject: Document how to use LLDB in the Slang codebase (#7809) * Document how to use LLDB in the Slang codebase * Include `slang_lldb.py` in `.lldbinit` * Switch from GCC to Clang * Include a VS Code task to build before debugging * Fix clangd --- flake.nix | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index a6ad8f9f5..5b63b0e4c 100644 --- a/flake.nix +++ b/flake.nix @@ -16,12 +16,20 @@ pkgs = import nixpkgs { inherit system; }; in { - devShell = pkgs.mkShell { + # We want to use Clang instead of GCC because it seems to behave better + # with LLDB, so we use `mkShellNoCC` here instead of `mkShell` because + # the latter brings in GCC by default on Linux. + devShell = pkgs.mkShellNoCC { buildInputs = [ + # Must put `clang-tools` before `clang` for clangd to work properly. + # We use `llvmPackages_17.clang-tools` instead of just `clang-tools` + # to match the `clang-format` version used in CI. + pkgs.llvmPackages_17.clang-tools + + pkgs.clang pkgs.cmake pkgs.gersemi - pkgs.llvm - pkgs.llvmPackages_17.clang-tools + pkgs.lldb pkgs.ninja pkgs.nixfmt-rfc-style pkgs.prettier -- cgit v1.2.3