View Issue Details

IDProjectCategoryView StatusLast Update
0001067Xdebugpublic2014-11-11 19:48
Reporteraik099 Assigned Toderick  
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionno change required 
Product Version2.2.4 
Summary0001067: No breakpoint validation
Description

Currently it's possible to set breakpoint on a line, where it will never be working.

For example:
$thisLine = array(
'something',
);

won't work no matter where you put a breakpoint.

I see 2 way of solving this:

  1. fix problem, that prevents breakpoints on multi-line statements (where ";" isn't present on a line where breakpoint is set) from working
  2. add validation to the breakpoint setting call, so that breakpoint can't be set where it's technically can't be pressed

Without this PhpStorm is allowing to set breakpoint in lines, that never work and it's very confusing to realize that code was working in that line and it's a breakpoint that wasn't executed.

Associated PhpStorm discussions:
http://youtrack.jetbrains.com/issue/WI-4721
http://youtrack.jetbrains.com/issue/WI-2191

TagsNo tags attached.
Operating System
PHP Version5.4.20-5.4.24

Activities

derick

2014-07-21 21:57

administrator   ~0002873

Hi. I am going to close this as 'no change required', because Xdebug already has functionality for this:

Xdebug implements a non-dbgp command, called "xcmd_get_executable_lines". It has a "-d" option to select the (stack) depth for which to find out which lines have executable code. And with that, PHPStorm can warn when putting a breakpoint on a non-executable line.

This however, only works for code that has been parsed into internal structures (oparray) in PHP, and it is not (easily) possible for Xdebug to do static code analysis on PHP files. However, perhaps PHPStorm can figure it out from its own code scanning analysis as comments on your links to PHPStorm tickets indicate.

I've also added a comment to the two PHPStorm tickets that you linked against.

aik099

2014-07-22 07:06

reporter   ~0002874

Last edited: 2014-07-22 07:06

But in code example I mentioned did the breakpoint really work for you (didn't work for me) not matter on which of 3 lines I place it?

For me it didn't when I've placed it on 1st line.

The code looks like executable one, so the breakpoint should have worked.

derick

2014-11-11 19:48

administrator   ~0002895

Yes, it works just fine. It stops for me on line 3 (which has the 'something')
on it.

Issue History

Date Modified Username Field Change
2014-07-21 10:44 aik099 New Issue
2014-07-21 21:57 derick Note Added: 0002873
2014-07-21 21:57 derick Status new => resolved
2014-07-21 21:57 derick Resolution open => no change required
2014-07-21 21:57 derick Assigned To => derick
2014-07-22 07:06 aik099 Note Added: 0002874
2014-07-22 07:06 aik099 Status resolved => feedback
2014-07-22 07:06 aik099 Resolution no change required => reopened
2014-07-22 07:06 aik099 Note Edited: 0002874
2014-11-11 19:48 derick Note Added: 0002895
2014-11-11 19:48 derick Status feedback => resolved
2014-11-11 19:48 derick Resolution reopened => no change required
2016-07-31 12:35 derick Category Debug client (console) => debugclient (debugging tool)
2016-07-31 12:35 derick Category debugclient (debugging tool) => (No Category)