We don't have a fully customizable fatalError/trap system for embedded swift but this definitely is something we want to improve.
That said, you might want to try -assert-config Debug. This flag has helped me while debugging traps as it makes precondition messages actually be emitted (among other things).
Does your code run in the browser? If so, you can get stack traces in browser developer tools and also use the debugging extension from SwiftWasm. If a crash is in Swift stdlib or runtime, you might need to build your own with release-debuginfo setting to be able to step through source code and possibly inspect variables.
It does, and I briefly looked into this kind of thing, but I am very annoyed by how Chrome installs itself and always auto starts in the background to access the network, so I'd probably rather work on my build system to cross compile natively and debug there
I'm developing on the browser build to avoid having to make my makefile even more complicated, but that's a bad idea in the first place