How to debug emacs crashes

Hi,

My emacs crashes regularly when using lsp-mode with rust-analyzer. I’d like to debug this but it seems that I need a debug build of emacs for this: debugging - How do I debug an emacs crash? - Emacs Stack Exchange

How can I install a debug build of emacs? Fwiw I’m using the emacs-overlay to install emacs with home-manager: https://github.com/little-dude/dotfiles/blob/2a6750bbc769dd368e6ac06176764a15ea3ec462/programs/emacs/default.nix