[xdebug-general] how breakpoints relate to filenames when remote debugging

From: David Bradley <mail.david.bradley[@]gmail.com>
Date: Wed, 2 May 2018 10:42:35 -0600

Dear xdebug.org

It seems the user community struggles significantly when trying to get
breakpoints to work in their favorite IDE when debugging with xdebug

The posts show the frustrations they have better than the solutions they
come up with. I believe this is mostly due to the fact they try many many
many configuration changes and then suddenly things start working - and
they aren't really sure which combination of changes is responsible.

The other thing that makes their reported solutions less than valuable is
that there are a lot of possible differences in development environments
all which might have something to do with the correct configuration they

For example, I run a multi-docker container Linux, Nginx, PHP7 environment
inside VirtualBox on Windows 10 using Eclipse Oxygen with PDT.

(After a little effort) most of us seem to get to the point in remote
debugging where the debugger can talk to the IDE, get the script to pause
at the first line and can step through and into files. This means all the
ports and commands can flow between IDE debugger, I believe.

It's just that any breakpoints we set don't work.

So I thought it might be helpful if we understood the principles of how
breakpoints work.

From the DBgp docs I gleaned that:
1) (file) breakpoints commands take a filename and a line number
2) file names have to be absolute paths
3) probably shouldn't have spaces (whoever thinks spaces in paths are a
good idea is nuts)
4) may have some case sensitivity issues when crossing Windows -> linux VM
5) some kind of mapping from server, debugger, and IDE views of filenames
is required.

Could you give the community an explanation of the steps from a user asking
for a breakpoint to be created in an IDE, through all path mappings to the
debugger - being careful to identify which component has the responsibility
of mapping

In the general case for remote debugging the root location of the files in
the IDE and the webserver are different names and inaccessible to one
another (hence the term "remote").

If you could also identify the canonical perspective and format of the
filenames in the debugger (if there is one)

Moreover (just in case this matters) URLs passed from the webserver are not
guaranteed to map via a simple root prefix to any file name ( eg "
https://foo/inbox" might map to
<someroot>/<someintermediatepath>/inbox-xxx.php) - this would mean web
URLs are not relevant for breakpoints

Hopefully with this information I will be able to figure out what my IDE is
supposed to be doing and configure it correctly according to some
methodology rather than from random posts of desperate developers

David Bradley
Received on Wed May 02 2018 - 17:42:38 BST

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