[xdebug-general] Re: AW: Re: Find out whether breakpoint is valid

From: Derick Rethans <derick[@]xdebug.org>
Date: Sun, 26 Apr 2009 19:40:26 +0300 (EEST)

On Sun, 26 Apr 2009, André Hänsel wrote:

> > Derick Rethans wrote:
> >
> > On Fri, 24 Apr 2009, André Hänsel wrote:
> >
> > > is there any way to determine whether a breakpoint is a valid
> > > breakpoint?
> > >
> > > I have continued development of xdebugclient and I'd like to prevent
> > > lines to be marked as breakpoint when there cannot be halted.
> > >
> > > Especially in the following example I find it rather counterintuitive
> > > that the second line is the only valid breakpoint:
> > >
> > > $v = array(
> > > 'a' => foo(), // This line is the only valid breakpoint
> > > 'b' => bar(),
> > > );
> >
> > Xdebug has code for this, in the form of the code coverage analysis
> > code, but the DBGp protocol does not provide means of conveying that
> > information back to the client at the moment.
>
> Isn't this the case the 203 error code was made for as described in
> http://www.xdebug.org/docs-dbgp.php#debugger-engine-errors?

Yes, it is... and it reads:

203 - no code on breakpoint line (the IDE tried to set a breakpoint
      on a line which does not have any executable code. The
      debugger engine is NOT required to return this type if it
      is impossible to determine if there is code on a given
      location. (For example, in the PHP debugger backend this
      will only be returned in some special cases where the current
      scope falls into the scope of the breakpoint to be set)).

I would like to support this though, but it's a bit tricky cause I can
only test for the code, when the file is actually loaded as (part of a)
running script already.

regards,
Derick

-- 
Like Xdebug? Send a postcard: http://derickrethans.nl/xdebug_2_released.php
Xdebug | http://xdebug.org | xdebug-general@lists.xdebug.org
twitter: @derickr and @xdebug
Received on Sun Apr 26 2009 - 18:40:30 BST

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