title: JDB debugging of Groovy/Grails code
body: <p>I'm attempting to debug some issues in some (rather bletcherous) Grails code that I inherited.  I'm a relative noob in Groovy and Grails although an old Java guy.</p>
  
  <p>Here's the problem: I have this thing running with jconsole and jdb hooks in, but it's tough to use the debugger because so much of the code is in closures.  So, for example, </p>
  
  <pre><code>def niftyMethod = {
      // do something nifty
      anObject.doSomethingThatBreaks()
  }
  </code></pre>
  
  <p>as the implementation of a single method on a controller.</p>
  
  <p>Being a closure, the name (by the time the debugger sees it) is TheController.closure527 (or something like that), and notably hard to find.</p>
  
  <p>So, how can one find the map from the block name to the closure?</p>
  
  <p>More generally, are there any good tutorials on doing this sort of thing?</p>
  
  <p>Ideally the answer won't involve changing over to IntelliJ, as if God had meant us to use IDEs like that She wouldn't have given us EMACS.</p>