[xdebug-general] Re: debugging multi-page applications

From: Derick Rethans <derick[@]xdebug.org>
Date: Wed, 22 Aug 2007 10:43:07 +0200 (CEST)

On Wed, 22 Aug 2007, Damjan Cvetko wrote:

> Derick Rethans wrote:
> > On Tue, 21 Aug 2007, Noah Mercer wrote:
> >
> > > Is there a way to configure XDebug/debugclient so that I can wander
> > > through the pages of my application at will and have it stop on any
> > > breakpoint set in any file, regardless of which page I entered the
> > > application on? Or will it always go to a "stopped" state when the current
> > > script finishes execution?
> >
> > The debugclient itself does not support this, it is a *very* simple client
> > just meant for debugging the protocol interaction. Most other clients
> > listed[1] will re-issue breakpoints when a new connection is made. It can
> > not be done in Xdebug itself-as you never know to which apache process the
> > request goes and there is nothing shared between apache processes.
> >
> > [1] http://www.xdebug.org/docs/remote#clients
> >
> > It could be an addition to the debugclient client though, but then it needs
> > quite a bit of modifications.
>
> Another thing that I think you should watch out here for: If I
> understand correctly you have a SubmitInput.php that displays a form.
> Then you press SUBMIT and the browser posts the data to
> ShowResult.php. This are two scripts and as PHP works, two requests
> and thus two separate worlds. (You need to change your way of thinking
> if you worked with java before).
>
> The problem is, that you want to debug ShowResult.php, but the debugger doesnt
> kick in, because the second request does not get a XDEBUG_SESSION_START
> parameter. So you need to change SubmitInput.php so it adds a
> XDEBUG_SESSION_START to the form (either via a hidden input...) or as a GET
> parameter.

That's not true. XDEBUG_SESSION_START=1 will set a cookie. If this
cookie is present it will keep making connections to the debug client
until XDEBUG_SESSION_STOP is used.

> A far better solution is to use the FireFox XDEBUG helper. You can add the
> XDEBUG_SESSION_START cookie with just a click.
> https://addons.mozilla.org/en-US/firefox/addon/3960

That's a useful tool though :)

Derick

-- 
Xdebug | http://xdebug.org | xdebug-general@lists.xdebug.org
Received on Wed Aug 22 2007 - 10:43:07 BST

This archive was generated by hypermail 2.2.0 : Mon Jun 25 2018 - 06:00:04 BST