You get debug mode after defeating the temporary final boss.
Which is in dungeon final. Don't know what floor though.
As a bonus note. If you have beaten the game on one save file. Other saved files as long as that. File is still there. We'll also have debug mode by default. I'm pretty sure it's still like that. Unless the developers patched that out.