Best method of debugging .jsm files when building Firefox?

I’ve been playing around with the FF source code, with the eventual goal of building a custom version. I’ve been mostly unable to figure out an effective debugging solution. So far, I’ve mostly been using alert() calls as a kind of printf debugging. I can add these calls to .js files, which work as expected, but adding those calls to .jsm files does not create a popup window with my alert. I know the alert() is getting called since the code breaks at those points, but since I don’t see a window I can’t close it to continue execution. I haven’t found much about working with .jsm files online; is there a preferred method in the community for working with these files?