 |
Forums |
Admin Start New Thread
By: David Langston
RE: Debugging rails apps [ reply ] 2006-05-24 05:35
|
mitchell and all,
I have been able to get mr_guid (and the ruby debugger) to do a partial job of web app debugging. one of the problems outlined at the start of this thread is the repeated halting of the debugger when running the webrick server. this is seemingly due to code in that server and rails (as well as nitro, another ruby web framework similar to rails) that causes exceptions that are trapped by the debugger. the default state of the debugger (inherited from the standard ruby debugger) is to trap all "StandardError" exceptions.
This can be 'fixed' by changing line 99 in gdebug.rb to
@catch = nil (rather than @catch = "StandardError")...
regarding the comment in that first message that webrick goes away and never comes back to the debugger, that is simply the fact that unless a breakpoint is set, webrick will run thru a monitor loop forever, awaiting http requests. That is normal behavior. therefore it is essential, that a breakpoint be set somewhere in the code that responds to an http request so that the ensuing code can be stepped thru.
lastly, (and again it may be the behavior of the std Ruby debugger that is inherited) it seems that breakpoints cannot be set once the debugger is running, unless halted at a break... this even further reinforces the last point that a breakpoint must be set in the http response code before starting or continuing into the server code or you won't be able to stop it other than aborting the debugger and app.
One more observation, if you stop the debugger and then exit, it seems that the webrick server does not terminate. So keep your eye on the process list 'cause you may occassionally need to kill off an orphaned ruby process...
hope this helps get us all to a cleaner debug situation,
rgds,
Dave Langston
|
By: mitchell
RE: Debugging rails apps [ reply ] 2006-04-08 21:54
|
|
I have been trying to get Rails to run with Mr. Guid as well for the last few weeks, but I'm afraid support for web applications might not be possible at this point in time. I'm trying my best though...
|
By: Bakki Kudva
Debugging rails apps [ reply ] 2006-03-31 18:23
|
I am trying debug a rails app with mr_guid. Here's what I am experiencing.
I start the debugger with mr_guid script/server to launch webrick in mr_guid.
I add a source file of a controller and set a breakpoint in it. I hit the 'Run' key.
Now I would expect that execution will continute until my breakpoint is hit. Instead mr_guid stops at various points where exceptions are raised as below. I have to hit Run each time.
1. drb.rb -> raise DRbServerNotFound unless server
2. fileutils (line#219) Dir.mkdir path
3 ---- " ----
Now WeBrick is up and running on port 3000.
I now enter the url in the browser for the controler I have set the breakpoint in.
Again I get all the stops and need to hit run each time.
1. filehandler.rb (line#250) raise HTTPStatus::Not found, "'#{req.path} ' not found."
2. filehandler.rb (#34) raise HTTPStatus::NotModified
3. - " -
4. - " -
5. -" -
6. -" -
7. httpserver.rb (#55) raise HTTPStatus::EOFError if time out <=0
Now my page is showing in browser.
I click on the action where I have set the breakpoint.
Stops at ->
base.rb (322) raise ActionView Error "no rhtml, rjs or delegate template found for #{template_path}
I hit continue and mr_guid never returns...Staus shown on the bottom says continuing...
Why does mr-guid stop at every exception raised in the framework which does not stop execution normally? It should only stop at my breakpoint in the source as any debugger would. Zend Studio's php debugger does exactly that and it is lightning quick. I realize that the slowness in this case is that of ruby debugger which you are wrapping with mr_guid.
I think there is great potential here and I love the feel and the user interface of mr_guid. Just a couple of other nitpicks. When the debugger is running the Start Debugger and Run buttons should be unhighlighted ...or the run button should turn into a stop button. Thanks for the debugger and keep up the great work.
-bakki
|
|
 |