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

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

On Tue, 21 Aug 2007, Noah Mercer wrote:

> Please forgive the newbie-ness of this question; I've only recently
> started using PHP debuggers at all and XDebug in specific (most of my
> experience is with Java).
>
> Based on my experiences with Java debuggers,. I'd expect a debugging
> session to go something like this:
>
> (1) I set some breakpoints
> (2) I start the debugger
> (3) I begin using the app in my web browser
> (4) At any point when code that has a breakpoint set executes the
> debug client is triggered and execution halted
>
> It doesn't seem to work that way with a multi-page PHP application,
> though. Imagine a SubmitInput.php page that has a form which calls a
> ShowResults.php page. If I call
> http://example.com/SubmitInput.php?XDEBUG_SESSION_START=SOMETHING&KEY=1,
> the debug client (I'm using debugclient-0.9.0) triggers. I set a
> breakpoint somewhere in the ShowResults.php page (but none in the
> SubmitInput page) and I type "run -i 2" the status that comes back is
> "stopped". And it really does seem to be stopped: If I go to my
> browser and submit the form the breakpoint in ShowResults.php is never
> triggered. (And I've tried using xdebug_break() as well as the
> breakpoint_set command; neither one stops in this scenario.)
>
> 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.

regards,
Derick

-- 
Xdebug | http://xdebug.org | xdebug-general@lists.xdebug.org
Received on Wed Aug 22 2007 - 08:40:42 BST

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