How to debug emacs crashes


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: