If you’ve read the section on Hyper in the Terse Guide to the GLASS Tools, then you realize that you have to go through a hoop or two to debug your Seaside application in GLASS. With 3 gems serving Seaside pages in the appliance, any one of the gems can get a walkback while processing a request.
Until today, we didn’t have a good story for remote debugging.
Last night, I was mulling over the different approaches that we could take for doing remote debugging. As I thought about it, I realized that when the ‘Debug’ link is pressed in a Seaside, it wouldn’t be hard to snap off a continuation and stash it in a persistent collection and then in a development vm (one with Squeak attached), the continuation can be activated in a debugger.
Persistent continuations are used throughout GLASS, so it isn’t a big stretch to use them for remote debugging.
I spent a couple of hours this afternoon on an initial implementation. The end result at this point is somewhat crude, but functional.
If you want to give the remote debugger a try, just load up the package GLASS-dkh.83.mcz. Then head over to http://glass/seaside/tests/alltests in your browser:
- Click on the Error tab
- Click on the ‘Raise zero divide’ link
- Click on the ‘Remote Debug’ link on the walkback page.
- Follow the instructions on the page for bringing up the debugger in your development image.
You can save code in the debugger, set breakpoints and step around. There are a couple of problems with proceed, so unless you’ve set a breakpoint that prevents flying off the end of the stack, you shouldn’t use proceed. By implication there are certain points in a stack that you can’t step over. Don’t press the ‘Halt Execution’ link, because the halt is not caught by the remote debugger. These problems and a cleaner interface will be taken care of as we move forward.[Updated 4/10/2009: Halts have been safely caught for about a year now:)].
Finally, the remote debugging code won’t interfere with the the interactive debugging as described in the Terse Guide to the GLASS Tools.