Bug 169408 - Support for XDebug
Summary: Support for XDebug
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: PDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 enhancement with 29 votes (vote)
Target Milestone: ---   Edit
Assignee: Shalom Gibly CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 172798
  Show dependency tree
 
Reported: 2007-01-03 05:17 EST by D Kelsey CLA
Modified: 2020-05-14 13:20 EDT (History)
18 users (show)

See Also:


Attachments
Source files for XDebug support for PHP IDE (466.11 KB, application/zip)
2007-01-03 05:19 EST, D Kelsey CLA
no flags Details
Prebuilt Binary which provides XDebug Support for PHP IDE (493.25 KB, application/zip)
2007-01-03 05:20 EST, D Kelsey CLA
no flags Details
Source Files for XDebug V0.1.2 for PDT RC1 (464.44 KB, patch)
2007-01-16 09:20 EST, D Kelsey CLA
no flags Details | Diff
Prebuilt Binary for XDebug V0.1.2 for PDT RC1 (490.64 KB, patch)
2007-01-16 09:21 EST, D Kelsey CLA
no flags Details | Diff
Source Files for XDebug V0.1.2 for PDT RC1 (464.44 KB, application/octet-stream)
2007-01-16 09:23 EST, D Kelsey CLA
no flags Details
Prebuilt Binary for XDebug V0.1.2 for PDT RC1 (490.64 KB, application/octet-stream)
2007-01-16 09:24 EST, D Kelsey CLA
no flags Details
Prebuilt Binary of XDebug V0.1.3 support for PDT RC2 only (491.00 KB, application/zip)
2007-02-06 09:48 EST, D Kelsey CLA
no flags Details
Source files of XDebug V0.1.3 support for PDT RC2 only (464.85 KB, application/zip)
2007-02-06 09:50 EST, D Kelsey CLA
no flags Details
Prebuilt Binary of XDebug With Path Mapper V0.1.3 (PDT RC2) (125.76 KB, application/octet-stream)
2007-02-11 05:52 EST, Maxim Tikhonov CLA
no flags Details
Source files of XDebug With Path Mapper V0.1.3 (PDT RC2) (364.33 KB, application/octet-stream)
2007-02-11 05:54 EST, Maxim Tikhonov CLA
no flags Details
Prebuilt Binary of XDebug With Path Mapper V0.1.3 (PDT RC2) [.ZIP] (126.99 KB, application/zip)
2007-02-11 06:22 EST, Maxim Tikhonov CLA
no flags Details
Source files of XDebug With Path Mapper V0.1.3 (PDT RC2) [.ZIP] (392.65 KB, application/zip)
2007-02-11 06:24 EST, Maxim Tikhonov CLA
no flags Details
Patch to fix the watch variables problem (127.11 KB, patch)
2007-03-08 18:35 EST, Andres CLA
no flags Details | Diff
Source code for patch. (521.02 KB, patch)
2007-03-08 18:36 EST, Andres CLA
no flags Details | Diff
Prebuilt Binary of XDebug With Path Mapper V0.1.4 (PDT RC2) [.ZIP] (145.94 KB, application/x-zip-compressed)
2007-03-14 18:38 EDT, Maxim Tikhonov CLA
no flags Details
Source files of XDebug With Path Mapper V0.1.4 (PDT RC2) [.ZIP] (425.14 KB, application/x-zip-compressed)
2007-03-14 18:47 EDT, Maxim Tikhonov CLA
no flags Details
Prebuilt Binary of XDebug V0.2.0 support for PDT RC3 only (535.51 KB, application/x-zip-compressed)
2007-04-12 06:40 EDT, D Kelsey CLA
no flags Details
Example Mapper for XDebug 0.2.0 Support (8.05 KB, application/java-archive)
2007-04-12 06:41 EDT, D Kelsey CLA
no flags Details
Source files of XDebug V0.2.0 support for PDT RC3 only (525.59 KB, application/x-zip-compressed)
2007-04-12 06:42 EDT, D Kelsey CLA
no flags Details
Prebuilt Binary of XDebug Support V0.2.1 for PDT RC3 only (543.42 KB, application/x-zip-compressed)
2007-05-10 08:54 EDT, D Kelsey CLA
no flags Details
Source files for XDebug Support V0.2.1 for PDT RC3 only (535.37 KB, application/x-zip-compressed)
2007-05-10 08:55 EDT, D Kelsey CLA
no flags Details
Prebuilt Binary of XDebug Support V0.2.2 for PDT RC3 only (545.36 KB, application/force-download)
2007-06-19 09:13 EDT, D Kelsey CLA
no flags Details
Source files for XDebug Support V0.2.2 for PDT 0.7RC3 only (539.43 KB, application/force-download)
2007-06-19 09:14 EDT, D Kelsey CLA
no flags Details
Prebuilt Binary of XDebug Support for V0.2.3 for PDT 1.0 I20070712 (555.69 KB, application/force-download)
2007-07-21 15:23 EDT, D Kelsey CLA
no flags Details
Example Mapper V0.0.2 for XDebug 0.2.3 (8.13 KB, application/java-archive)
2007-07-21 15:25 EDT, D Kelsey CLA
no flags Details
Source files for XDebug Support V0.2.3 for PDT 1.0 I20070712 (548.59 KB, application/force-download)
2007-07-21 15:27 EDT, D Kelsey CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description D Kelsey CLA 2007-01-03 05:17:03 EST
PHP IDE currently only supports the Zend Debug protocol. XDebug is a popular alternative Debug solution for PHP which is open source.
Adding support for XDebug and would allow users of PHP IDE to select which debug solution they prefer.
Comment 1 D Kelsey CLA 2007-01-03 05:19:19 EST
Created attachment 56321 [details]
Source files for XDebug support for PHP IDE

This file contains the source projects that provide XDebug support for PHP IDE. It is currently for 0.7 Milestone 4 only.
Comment 2 D Kelsey CLA 2007-01-03 05:20:58 EST
Created attachment 56322 [details]
Prebuilt Binary which provides XDebug Support for PHP IDE

This file contains the prebuilt plugins plus a user guide which provides XDebug Support for PHP IDE
Comment 3 Andrey Platov CLA 2007-01-03 13:29:02 EST
DLTK Project also implemented DBGp-based debugger (protocol used by XDebug). Now in DLTK it works with TCL debugger from ActiveState and we plan to implement DBGp-based debuggers for Python and Ruby as well.

Is there any thoughts to share DBGp-related stuff as common component? Orbit Project, etc? 
Comment 4 D Kelsey CLA 2007-01-04 05:46:58 EST
(In reply to comment #3)
> DLTK Project also implemented DBGp-based debugger (protocol used by XDebug).
> Now in DLTK it works with TCL debugger from ActiveState and we plan to
> implement DBGp-based debuggers for Python and Ruby as well.
> 
> Is there any thoughts to share DBGp-related stuff as common component? Orbit
> Project, etc? 
> 

I think a separate component which provides common DBGp support is a right long term goal to strive for. I did start to make an effort to separate out DBGp from XDebug and PHP specifics but only got a little way into that. I don't know how that might be initiated within the eclipse community though. 
 
Comment 5 Andrey Platov CLA 2007-01-04 09:39:23 EST
In DLTK we initially implemented DBGp protocol layer independent of Eclipse so it's potentially could be reused in both projects...

However common component seems to be reasonable if Zend is going to accept your contribution and/or support XDebug in general.
Comment 6 Andrey Platov CLA 2007-01-04 09:53:02 EST
If interested, our Eclipse-independent DBGp implementation could be found here: http://www.eclipsedltk.org/fisheye/browse/DLTK/com.xored.dbgp

Note: it may not fully work with XDebug, because most of available DBGp debuggers like ActiveState ones and various XDebug versions do not strictly follow the specification. 
Comment 7 D Kelsey CLA 2007-01-16 09:20:53 EST
Created attachment 56956 [details]
Source Files for XDebug V0.1.2 for PDT RC1
Comment 8 D Kelsey CLA 2007-01-16 09:21:51 EST
Created attachment 56957 [details]
Prebuilt Binary for XDebug V0.1.2 for PDT RC1
Comment 9 D Kelsey CLA 2007-01-16 09:23:47 EST
Created attachment 56958 [details]
Source Files for XDebug V0.1.2 for PDT RC1 

Corrected attachment
Comment 10 D Kelsey CLA 2007-01-16 09:24:36 EST
Created attachment 56959 [details]
Prebuilt Binary for XDebug V0.1.2 for PDT RC1

corrected attachment
Comment 11 Dominic Clifton CLA 2007-01-16 13:24:24 EST
I saw this written by Dave in the php newsgroup:

--- snip --

With the breakpoints not being honoured, the most likely problem is that the file you are setting the breakpoints on, is not the same file being run by the PHP interpreter in your web server (XDebug works with absolute file names so the one the break point is set on must match the one xdebug is seeing when run by the PHP interpreter).
The implementation is currently restricted to the fact that the apache document root should point to your active workspace. Break on first line works because it doesn't initially run the code, it invokes a step into. For example my httpd.conf entry is DocumentRoot "/home/dave/workspace"

---

http://www.eclipse.org/newsportal/article.php?id=1123&group=eclipse.tools.php#1123

This pretty much stops me from even trying it out, shame as when I saw this I was looking forward to ditching zend and nusphere in favour of an open source debugger (XDebug).

For any serious php developers who write large applications to seriously consider phpide + xdbug | zend debug a path mapper is needed which is exactly what is used by phpeclipse and phpdbg.

I wrote a long description of the problem and a possible solution/implementation idea as a bug report here:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=160456

I suggest contacting the assignee to see if work has been started on it and if not turn your attention to it at the earliest opportunity otherwise we'll end up with very different ways of configuring a debug environment between XDebug and the Zend debugger when in fact they should have very similar UI's to do this task.

Thanks again Dave for the great work thus far, really hope to see this mature fast!

Comment 12 D Kelsey CLA 2007-01-17 06:05:29 EST
(In reply to comment #11)
> I saw this written by Dave in the php newsgroup:
> 
> --- snip --
> 
> With the breakpoints not being honoured, the most likely problem is that the
> file you are setting the breakpoints on, is not the same file being run by the
> PHP interpreter in your web server (XDebug works with absolute file names so
> the one the break point is set on must match the one xdebug is seeing when run
> by the PHP interpreter).
> The implementation is currently restricted to the fact that the apache document
> root should point to your active workspace. Break on first line works because
> it doesn't initially run the code, it invokes a step into. For example my
> httpd.conf entry is DocumentRoot "/home/dave/workspace"
> 
> ---
> 
> http://www.eclipse.org/newsportal/article.php?id=1123&group=eclipse.tools.php#1123
> 
> This pretty much stops me from even trying it out, shame as when I saw this I
> was looking forward to ditching zend and nusphere in favour of an open source
> debugger (XDebug).
> 
> For any serious php developers who write large applications to seriously
> consider phpide + xdbug | zend debug a path mapper is needed which is exactly
> what is used by phpeclipse and phpdbg.
> 
> I wrote a long description of the problem and a possible
> solution/implementation idea as a bug report here:
> 
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=160456
> 
> I suggest contacting the assignee to see if work has been started on it and if
> not turn your attention to it at the earliest opportunity otherwise we'll end
> up with very different ways of configuring a debug environment between XDebug
> and the Zend debugger when in fact they should have very similar UI's to do
> this task.
> 
> Thanks again Dave for the great work thus far, really hope to see this mature
> fast!
> 

A Path mapper would be one way this issue could be resolved (and is in my list of things I would have liked to do). Also I would really like my XDebug stuff integrated into PHP IDE so that it can share common services and GUIs between it and the Zend Debugger. I really need the PHP IDE folks to accept the contribution so that things can get moving to making PHP IDE a great environment for developing PHP code.

Comment 13 Chris van de Wouw CLA 2007-02-01 05:18:16 EST
request update for PDT RC2
Comment 14 D Kelsey CLA 2007-02-06 09:48:43 EST
Created attachment 58341 [details]
Prebuilt Binary of XDebug V0.1.3 support for PDT RC2 only
Comment 15 D Kelsey CLA 2007-02-06 09:50:05 EST
Created attachment 58343 [details]
Source files of XDebug V0.1.3 support for PDT RC2 only
Comment 16 tolan blundell CLA 2007-02-08 17:45:15 EST
Slight problem with this for me is that it doesn't seem to want to let me set the server URL to anything but 127.0.0.1 (I'm mounting the remote site to my workspace with SSHFS through FUSE). I set the erver URL, but once I close the 'Debug...' window and re-open it its been reset to 127.0.0.1
Comment 17 Maxim Tikhonov CLA 2007-02-11 05:52:20 EST
Created attachment 58727 [details]
Prebuilt Binary of XDebug With Path Mapper V0.1.3 (PDT RC2)

(In reply to comment #12)
> (In reply to comment #11)
> > I saw this written by Dave in the php newsgroup:
> > 
> > --- snip --
> > 
> > With the breakpoints not being honoured, the most likely problem is that the
> > file you are setting the breakpoints on, is not the same file being run by the
> > PHP interpreter in your web server (XDebug works with absolute file names so
> > the one the break point is set on must match the one xdebug is seeing when run
> > by the PHP interpreter).
> > The implementation is currently restricted to the fact that the apache document
> > root should point to your active workspace. Break on first line works because
> > it doesn't initially run the code, it invokes a step into. For example my
> > httpd.conf entry is DocumentRoot "/home/dave/workspace"
> > 
> > ---
> > 
> > http://www.eclipse.org/newsportal/article.php?id=1123&group=eclipse.tools.php#1123
> > 
> > This pretty much stops me from even trying it out, shame as when I saw this I
> > was looking forward to ditching zend and nusphere in favour of an open source
> > debugger (XDebug).
> > 
> > For any serious php developers who write large applications to seriously
> > consider phpide + xdbug | zend debug a path mapper is needed which is exactly
> > what is used by phpeclipse and phpdbg.
> > 
> > I wrote a long description of the problem and a possible
> > solution/implementation idea as a bug report here:
> > 
> > https://bugs.eclipse.org/bugs/show_bug.cgi?id=160456
> > 
> > I suggest contacting the assignee to see if work has been started on it and if
> > not turn your attention to it at the earliest opportunity otherwise we'll end
> > up with very different ways of configuring a debug environment between XDebug
> > and the Zend debugger when in fact they should have very similar UI's to do
> > this task.
> > 
> > Thanks again Dave for the great work thus far, really hope to see this mature
> > fast!
> > 
> 
> A Path mapper would be one way this issue could be resolved (and is in my list
> of things I would have liked to do). Also I would really like my XDebug stuff
> integrated into PHP IDE so that it can share common services and GUIs between
> it and the Zend Debugger. I really need the PHP IDE folks to accept the
> contribution so that things can get moving to making PHP IDE a great
> environment for developing PHP code.
> 

(In reply to comment #12)
> (In reply to comment #11)
> > I saw this written by Dave in the php newsgroup:
> > 
> > --- snip --
> > 
> > With the breakpoints not being honoured, the most likely problem is that the
> > file you are setting the breakpoints on, is not the same file being run by the
> > PHP interpreter in your web server (XDebug works with absolute file names so
> > the one the break point is set on must match the one xdebug is seeing when run
> > by the PHP interpreter).
> > The implementation is currently restricted to the fact that the apache document
> > root should point to your active workspace. Break on first line works because
> > it doesn't initially run the code, it invokes a step into. For example my
> > httpd.conf entry is DocumentRoot "/home/dave/workspace"
> > 
> > ---
> > 
> > http://www.eclipse.org/newsportal/article.php?id=1123&group=eclipse.tools.php#1123
> > 
> > This pretty much stops me from even trying it out, shame as when I saw this I
> > was looking forward to ditching zend and nusphere in favour of an open source
> > debugger (XDebug).
> > 
> > For any serious php developers who write large applications to seriously
> > consider phpide + xdbug | zend debug a path mapper is needed which is exactly
> > what is used by phpeclipse and phpdbg.
> > 
> > I wrote a long description of the problem and a possible
> > solution/implementation idea as a bug report here:
> > 
> > https://bugs.eclipse.org/bugs/show_bug.cgi?id=160456
> > 
> > I suggest contacting the assignee to see if work has been started on it and if
> > not turn your attention to it at the earliest opportunity otherwise we'll end
> > up with very different ways of configuring a debug environment between XDebug
> > and the Zend debugger when in fact they should have very similar UI's to do
> > this task.
> > 
> > Thanks again Dave for the great work thus far, really hope to see this mature
> > fast!
> > 
> 
> A Path mapper would be one way this issue could be resolved (and is in my list
> of things I would have liked to do). Also I would really like my XDebug stuff
> integrated into PHP IDE so that it can share common services and GUIs between
> it and the Zend Debugger. I really need the PHP IDE folks to accept the
> contribution so that things can get moving to making PHP IDE a great
> environment for developing PHP code.
> 

I ran into the same problem myself. I have the web root of my documents separate from where my workspace is... the files are deployed to the web root, so I have a separate copy.

XDebug is a great feature, I have been using it for a week, and absolutely love it, much better than Zend Debugger.

Anyway I have created a temporary path mapper myself, as not being able to have breakpoints where I want was really a show stopper (only break at first line worked). Its not perfect code, but it works (I wasn't going to spend ages on it, just wanted the breakpoints to work).

So if anybody has the same problem, feel free to use my fix (until this is implemented by the original author).

Install & Configure
1. Download the attachement
2. Remove 2 original xdebug files in plugins directory.
3. Copy the files from the archive into your eclipse directory
4. Start eclipse
5. Go to Help/Software Updates/Manage Configuration
6. Enable XDebug Feature
7. Restart Eclipse
8. Go to Window/Preferences. Find the new configuration page under PHP/Xdebug Rewrite
9. There you can configure your path maps.

Example:
your workspace file is in
d:\workspaces\myproject\somefile.php

your web root file is in
e:\wwwroot\webapp\somefile.php

so the paths you have to configure are:
Rewrite From:
d:/workspaces/myproject/

Rewrite To:
e:/wwwroot/webapp/

note that the slashes have to be in linux style.

Thats it, if you have any questions, post here. I will attach the source code as well, if you want to play around or fix something. This is not something I will be supporting, just a quick fix :)

This only works with PDT RC2 and Java 1.5 (generics huh)...

Hope this might someone...


Thanks to the D Kelsey for great work!!!
Comment 18 Maxim Tikhonov CLA 2007-02-11 05:54:44 EST
Created attachment 58728 [details]
Source files of XDebug With Path Mapper V0.1.3 (PDT RC2)

here is the source
Comment 19 Maxim Tikhonov CLA 2007-02-11 06:22:36 EST
Created attachment 58729 [details]
Prebuilt Binary of XDebug With Path Mapper V0.1.3 (PDT RC2) [.ZIP]

this is the zip version
Comment 20 Maxim Tikhonov CLA 2007-02-11 06:24:16 EST
Created attachment 58730 [details]
Source files of XDebug With Path Mapper V0.1.3 (PDT RC2) [.ZIP]
Comment 21 Missing name CLA 2007-02-16 16:07:07 EST
Thanks for your work! I am looking forward to use PDT with XDebug.

I get an error in the debug perspective in the variables view: 'An internal error occurred during: "Computing hasChildren"'. I am doing a remote launch. As long as the variables view is not shown, I can step thruogh the code, but i cannot see the variable contents, not even the hovers in the code view.

Eclipse 3.2.1, PDT 0.7,v20070130, org.eclipse.php.xdebug.y.updatesite.zip.
Comment 22 alex_d77@hotmail.com CLA 2007-02-21 09:34:36 EST
bug in XDebugStringValue, line 46 (getValueString).

Checking of empty string is missing. Base64 crashes then later because of the empty byte array
Comment 23 D Kelsey CLA 2007-02-21 18:16:39 EST
(In reply to comment #22)
> bug in XDebugStringValue, line 46 (getValueString).
> 
> Checking of empty string is missing. Base64 crashes then later because of the
> empty byte array
> 
Hi, thanks for the report. The problem is caused by a change in the way xml is parsed in java 6. before it reported null, now it reports a blank string.
Will fix this in the next update.

Comment 24 Andres CLA 2007-03-08 18:35:45 EST
Created attachment 60457 [details]
Patch to fix the watch variables problem

Adding patch to fix the bug in the XDebugStringValue class. The problem, I believe, was not the changes in JRE6, but that the class was incorrectly determining when the values should be Base64 decoded: resources need to be decoded, not strings; it was doing the opposite.
This patch includes the Maxim's mapper.
Comment 25 Andres CLA 2007-03-08 18:36:29 EST
Created attachment 60458 [details]
Source code for patch.

Attaching source code for patch.
Comment 26 Missing name CLA 2007-03-09 13:58:38 EST
(In reply to comment #24)
> Adding patch to fix the bug in the XDebugStringValue class. The problem, I
> believe, was not the changes in JRE6, but that the class was incorrectly
> determining when the values should be Base64 decoded: resources need to be
> decoded, not strings; it was doing the opposite.
> This patch includes the Maxim's mapper.

Thanks for the patch. The variables view doesn't crash anymore. Unfortunately most variable values shown are (Base64?)encoded now :-(

Comment 27 G Palmer CLA 2007-03-13 13:34:57 EDT
If the path on the web server has a space in it, there appears to be a bug in the way that the breakpoint set command is called.  The space is not quoted, escaped or URL encoded and the breakpoint set fails.

This is using

Prebuilt Binary of XDebug With Path Mapper V0.1.3 (PDT RC2)

on eclipse 3.2.0 (PDT bundle version) with Java 1.5.0_11

I think the issue is that the path mapper is called *after* GeneralUtils.encodeFileName was called earlier in sendBreakpointAddCmd() in org.eclipse.php.xdebug.core/src/org/eclipse/php/xdebug/core/model/XDebugTarget.java.  The path mapped filename is not re-encoded (at least not in sendBreakpointAddCmd())

Would wrapping rewriteTo in GeneralUtils.encodeFileName() work?
Comment 28 D Kelsey CLA 2007-03-13 19:17:19 EDT
Please see Forum append for status of next release of XDebug support for PDT. 
Comment 29 Dominic Clifton CLA 2007-03-14 07:59:15 EDT
Hi again everyone,  I finally got around to installing XDebug and a new version of  PDT (0.7.0.v20070221) in order to test remote web page debugging with a windows xp client machine and a linux machine running apache2, php 4.4.0 and samba.

I report some success, in that when "break on first line" is enable i can step through the code and I can see variables and even switch stack frames which is great (I was unable to do this with phpdbg and phpeclise).

However, the problem is that xdebug (and also the zend debugger) are both not stopping at any breakpoints.

A source file on the linux box is created as:

/home/dominicc/web/grt2/htdocs/index.php

The linux server runs samba, /home/dominicc is shared as "dominicc" and is mapped to P: on my windows box, so i access the above file in eclipse as:

P:\web\grt2\htdocs\index.php

The web pages are served by an apache vhost that has a documentroot of /home/dominicc/web.  it's url is http://dev01.grt.local/~dominicc, so naturally i point my web browser at the following url to run the script.

http://dev01.grt.local/~dominicc/grt2/htdocs/index.php

My eclipse project's root is

P:\web\grt2

I added an XDebug rewrite as follows:

rewrite from: /home/dominicc/web/grt2/
rewrite to: P:/web/grt2/

I also tried without trailing and leading slashes (yes, without leading slashes, see below)

When I start a debug session with 'break at first line' enbaled I see the source code open (which actually isn't the index.php above but actually is an auto-prepended file as defined in an .htaccess file in the same folder as the index.php file, which is good as this indicates at least some source code lookup is working).  Interestingly however if I remove the xdebug rewrite and restart the debugger it still manages to find my auto-prepended file ("/home/dominicc/web/grt2/lib/grt_prepend.inc") and stops at the first line of code in it.

The file names displayed in the debug view have their leading / removed.  so they appear like this (after stepping through the prepended file).

home/dominicc/web/grt2/htdocs/shop.php.include : lineno 41
home/dominicc/web/grt2/htdocs/index.php.{main} : lineno 3

I also note that each time i go into the properties for the "PHP Web Script with XDebug" for my debug configuration the Server URL resets to: "http://localhost" which is an additional problem that needs fixing.

the other xdebug settings are as follows:

script and server: "/grt2/htdocs/index.php"

server url: "http://dev01.grt.local/~dominicc
context root: "grt2" <-- what is this anyway?
the url that is generated is: "http://dev01.grt.local/~dominicc/grt2/htdocs/index.php" which is correct.

I enabled the "override project/workspace 'break at first line' setting" and also "break at first line".  Disabling them had no effect on the problem with ignoring breakpoints.

Can someone tell me if any of my settings are incorrect (and what correct settings should be)?

If they are all correct then can someone please investigate this issue?

If you require screenshots of my configuration or further information please ask.

Keep up the good work so far!
Comment 30 Maxim Tikhonov CLA 2007-03-14 09:03:06 EDT
Hi,

I just been speaking to Mark, who was trying to use Path Mapper to no success.

We did sort it out in the end, and it was the case sensitivity.

I should have warned straight away about this, but in any case:
- Rewrite rules and paths are case sensetive, even if you use windows.
- "C:\myproject" is not the same as "c:\myproject"
- By default on windows large letter is used for drives, so if something isn't working, try changing the letter of the driver to a capital
- Directories are case sensitive as well
- Case sensitivity is required to make it compatible with Linux


Thanks to Mark for helping me to identify and post about this issue.


P.S. I am currently working on a new version of the path mapper which uses a proper encoding as suggested by G Palmer. I wasn't aware of the GeneralUtils.encodeFileName function, so I kind of hacked my way through the encoding, which is why iot might not have played nice with spaces in directories etc.

Now I have a working version, however I am going on a holiday tomorrow, so I don't know if I will have enough time to package it and post it tonight. If not I will post the update in 2 weeks, when I am back.

In any case I do plan on supporting this extension in the future. Dave kindly offered to add an extension hook to his code, so it would make it easier for me to maintain the actual path mapper.

I am also removing generics so it works with java < 1.5 and also adding a debugging console, so you can actually see whats happening and see why the rules might not be working.

This will be in the next update. Hopefully before I leave on my holiday :)
Comment 31 Missing name CLA 2007-03-14 10:40:21 EDT
(In reply to comment #28)
> Please see Forum append for status of next release of XDebug support for PDT. 

I can't find this forum. Can you post a URL, please? Thanks!
Comment 32 Dominic Clifton CLA 2007-03-14 10:54:35 EDT
I tried:

From -> To
/home/dominic/web/grt2 -> p:\web\grt2
/home/dominic/web/grt2 -> P:\web\grt2
/home/dominic/web/grt2 -> p:/web/grt2
/home/dominic/web/grt2 -> P:/web/grt2
home/dominic/web/grt2 -> p:\web\grt2
home/dominic/web/grt2 -> P:\web\grt2
home/dominic/web/grt2 -> p:/web/grt2
home/dominic/web/grt2 -> P:/web/grt2

I also tried again with trailing /'s - 16 tests in total.

I had the same problem in each case: breakpoints ignored

Them I re-read what you wrote and came to the conclusion I was setting up the
path rewrites backwards.

So I then used 

From -> To
P:/web/grt2/ -> /home/dominicc/web/grt2/

And it worked!

I personally feel that current from and to are backwards and illogical as the
path translations happen when paths are given FROM the debugger, TO eclipse.

Now, what I suggest, so that no-one else makes this mistake, is to change the
"Rewrite From" and "Rewrite to" to read "Local path", "Remote path"
respectively.

I still look forward to the new version with the debug/console output of
rewrite information as i'm sure this will be a big help to anyone setting this
up.  I noticed a while ago when i used phpdbg that on one of our servers the I
saw paths like this: "/home/dominicc/web/" but when apache served the pages it
gave a path of "/export/home/dominicc/web/" (it's real path) to the debugger
due to the way the filesystem on the server had been configured.  If I hadn't
of tried telneting to the phpdbg debugger port on the server i'd never of
noticed this issue.  Having a console/debug outout of rewrite rules will
certaintly aid users running into similar issues.
Comment 33 Andres CLA 2007-03-14 11:52:43 EDT
I have to agreed with Dominic, I had exactly the same problem.
Once it worked, though, work like a charm! Thanks for the good job guys!
Comment 34 Maxim Tikhonov CLA 2007-03-14 14:05:17 EDT
Well I am glad it worked :) Really glad...

I wasn't going to support this initially, but since people are actually using, I think it would make sense to.

So I welcome any comments, and I will certainly apply what you have mentioned with regards to renaming the labels. I just couldn't think of a better name myself (remember it was just a fix for myself).

In any case I have packed my suitcase, so I have a couple of hours before I have to go to bed.

So I will try to finish the new version and post it before my holiday tomorrow :) 

Comment 35 Maxim Tikhonov CLA 2007-03-14 18:38:09 EDT
Created attachment 60871 [details]
Prebuilt Binary of XDebug With Path Mapper V0.1.4 (PDT RC2) [.ZIP]

This is the updated version of the XDebug plugin with path mapper.

New Features:
- Included XStringValue patch from Andres [thanks Andres]
- Paths are now properly XDebug encoded (support spaces etc)[thanks G Palmer]
- Renamed "rewrite from" & "rewrite to" to "local path" & "remote path" [thanks Dominic Clifton & Andres]
- Added Debug Console

Other Changes:
- General refactoring
- Removed generics (should now be supported by java < 1.5)


To enable debug console, open "XDebug Rewrite" configuration and enable "Debug Output"... Then open up "XDebug Rewrite Console" using the Console view. If you have problems with path mapper and ask for help here, please include the output of the XDebug Rewrite console here.


Installation:
- Same as the previous version of the path mapper (see above)
  - Unzip the archive into your eclipse directory
  - Start Eclipse
  - Enable XDebug feature
  - Restart Eclipse
  - Configure as per original path mapper post above

Upgrading:
- Remove the old version of xdebug with path mapper / original xdebug version
  - Remove features/org.eclipse.php.xdebug_0.1.3.logik.jar
  - Remove plugins/org.eclipse.php.xdebug.core_0.1.3.logik.jar
  - Remove plugins/org.eclipse.php.xdebug.logik_0.1.3.logik.jar
  - Remove plugins/org.eclipse.php.xdebug.ui_0.1.3.logik.jar
- Install new version


Thanks to all those who contributed comments. If you find the Dave's XDebug feature useful, please register and vote for this bug report, so it can be added to the PDT environment.
Comment 36 Maxim Tikhonov CLA 2007-03-14 18:47:07 EDT
Created attachment 60876 [details]
Source files of XDebug With Path Mapper V0.1.4 (PDT RC2) [.ZIP]

Source files of XDebug With Path Mapper V0.1.4 (PDT RC2) [.ZIP]
Comment 37 Missing name CLA 2007-03-15 17:05:44 EDT
(In reply to comment #36)
> Created an attachment (id=60876) [details]
> Source files of XDebug With Path Mapper V0.1.4 (PDT RC2) [.ZIP]
> 
> Source files of XDebug With Path Mapper V0.1.4 (PDT RC2) [.ZIP]

Thanks for everybody's work.

I still think that the values shown in the variables view should be decoded. 

Changing 

if (isResource) {
    try {
        setValueString(new String(Base64.decode(data.trim().getBytes())));
    } catch (Exception e) {
        setValueString("[cannot decode data]");
    }
} else {
    setValueString(data.trim());
}

to 

// if (isResource) {
    try {
        setValueString(new String(Base64.decode(data.trim().getBytes())));
    } catch (Exception e) {
        setValueString("[cannot decode data]");
    }
// } else {
//     setValueString(data.trim());
// }

in genValueString in XDebugStringValue.java works for me.
Comment 38 Andres CLA 2007-03-15 22:20:08 EDT
> (In reply to comment #37)

The reason I changed it was because I was getting garbage for string values because of the Base64 decoding. If you think about it, resources always need to get encoded if they're transported through xml, strings not, so the code as it is makes more sense.
It seems some people are also getting strings encoded in base64.  So I went and read what the dbgp protocol says: http://xdebug.org/docs-dbgp.php#properties-variables-and-values
It turns out the property xml definition includes whether the value is encoded or not, so what needs to be done is instead of deciding whether to decode a value or not based on the data-type, use the "encode" attribute.

I'll try to provide a fix, but I don't have time right now...
BTW, it might make sense to move the source code to some repository :)

-a.
Comment 39 D Kelsey CLA 2007-03-16 14:36:53 EDT
XDebug doesn't encode resource names by default. The format it provides is
resource(%ld) of type (%s)
if however CDATA tags are present then it will encode it. What type of resource are you using that requires base64 decoding ? I have resources that don't require base 64 decoding.

I will be including in the next release, testing for the encoding property so that it determines it from the xml data passed rather than just blind assumption.

As for a repository, this is a submission to the eclipse PDT project and the eclipse CVS will be the repository for this code if the contribution is accepted.
Comment 40 D Kelsey CLA 2007-03-16 14:38:57 EDT
This Bugzilla entry is getting quite large now. 

Can I suggest that discussions on XDebug support be done on the PDT eclipse forum. As the disccusions here are more applicable to a forum based environment and it would also give more exposure of xdebug support to the PDT community as a whole.

Many thanks
Comment 41 Andres CLA 2007-03-16 16:09:09 EDT
(In reply to comment #40)
I'm all for moving discussion to PDT. What would be the forum URL?
As for the encoding, that seems to be a bug, so I'm reporting it here. The problem is not with the names, but with the values. Not all CDATA must be decoded, it depends on whether in the xml the "encoded" attribute value is "base64". Resources (binary data) values should always come encoded, but others like Strings it seems it actually depends on the server: I don't get them encoded, but other people are reporting they do.
Let me know if you have further questions. Thanks!

Andres.
Comment 42 D Kelsey CLA 2007-03-17 09:29:53 EDT
Strings are always encoded base64. Resources will only be encoded in base64 under certain circumstances.

I have changed the code to support the encoded attribute, and this plus other fixes will be made available some time after PDT version 0.7 is officially released as I will need to update the code to accomodate changes to APIs and behaviour for this release.

Eclipse has a forum server, and I am sure the PDT home page will have a link to their particular forum on that server, sorry can't remember it off hand.



Comment 43 Andres CLA 2007-03-17 21:58:29 EDT
Hi Dan,
I found out that if there are multiple files with the same name and you put a breakpoint on that file, when the breakpoint is reached Eclipse doesn't necessarily open the correct file, but the first one it finds on that project with the given name.
So for example, I have these files
Project/add/index.php
Project/test/index.php
And I put a breakpoint in Project/test/index.php, when the breakpoint is reached, Eclipse shows the source code of "Project/add'index.php"
I am using Maxim's path rewriter.
Is this a known issue? Will it be fixed in the next release? If not any suggestions what might be causing this and where should I start looking to fix it? It's big problem as we use a naming convention so we have multiple files with the same name all over.

Thanks!
Comment 44 Andres CLA 2007-03-18 00:49:57 EDT
Hi,
The link to the newsgroup is:
news://news.eclipse.org/eclipse.tools.php

I'll be posting my questions/issues there.
Comment 45 Andres CLA 2007-03-18 01:13:10 EDT
Correction, 
eclipse.tools.php is an old forum closed for postings.

You can use news://news.eclipse.org/eclipse.tools.pdt to post new comments.


Comment 46 Alejandro González CLA 2007-03-21 10:54:53 EDT
Hi!, first of all thanks for this great plugin.
I would like to know if someone has a compiled version of the plugin
with the variable encoding issue fixed.

Thanks!

Alejandro
Comment 47 Matt Kaatman CLA 2007-04-11 19:12:08 EDT
Is there any official information page/wiki specifically for this plugin?

I've almost got it working I think but my setup is a bit non-standard.
Comment 48 D Kelsey CLA 2007-04-12 06:40:02 EDT
Created attachment 63596 [details]
Prebuilt Binary of XDebug V0.2.0 support for PDT RC3 only
Comment 49 D Kelsey CLA 2007-04-12 06:41:17 EDT
Created attachment 63598 [details]
Example Mapper for XDebug 0.2.0 Support

see documentation in the binary package of Xdebug 0.2.0 for more information
Comment 50 D Kelsey CLA 2007-04-12 06:42:02 EDT
Created attachment 63599 [details]
Source files of XDebug V0.2.0 support for PDT RC3 only
Comment 51 D Kelsey CLA 2007-04-12 10:51:41 EDT
(In reply to comment #47)
> Is there any official information page/wiki specifically for this plugin?
> 
> I've almost got it working I think but my setup is a bit non-standard.
> 
No, sorry. You can discuss XDebug on the eclipse.org PDT forum.
Comment 52 Matt Kaatman CLA 2007-04-12 10:54:02 EDT
How can I manually edit/reset the settings on my PHP->Debug screen?

Anytime I click on it I get the error:
"The currently displayed page contains errors"

Then I can't modify it. I'm guessing I left it with values it didn't like.

Error handling would be nice here.
Comment 53 D Kelsey CLA 2007-04-12 16:21:30 EDT
(In reply to comment #52)
> How can I manually edit/reset the settings on my PHP->Debug screen?
> 
> Anytime I click on it I get the error:
> "The currently displayed page contains errors"
> 
> Then I can't modify it. I'm guessing I left it with values it didn't like.
> 
> Error handling would be nice here.
> 
 Hi. It would be better if you ask questions on the forum, rather than here. 
Thanks
Comment 54 D Kelsey CLA 2007-05-10 08:54:16 EDT
Created attachment 66656 [details]
Prebuilt Binary of XDebug Support V0.2.1 for PDT RC3 only

Example Mapper will work with this version
Comment 55 D Kelsey CLA 2007-05-10 08:55:17 EDT
Created attachment 66658 [details]
Source files for XDebug Support V0.2.1 for PDT RC3 only
Comment 56 Hans Meier CLA 2007-05-16 09:01:41 EDT
Where is Example Mapper for XDebug 0.2.1? 
I've tried example Mapper for XDebug 0.2.0 Support from above (which is actually org.eclipse.php.xdebug.sampleMapper_0.0.1.jar) -- not working with 0.2.1(((
It just disappeared from ui. Any ideas?


Comment 57 D Kelsey CLA 2007-05-17 06:06:47 EDT
I did a fresh install and it works for me. You need to create a PHP Web Script with XDebug launch, you should see the HTDoc tab. The example mapper is not the same as the mapper from the 0.1x versions. This mapper was written by Maxim and modified my code to patch it in. v0.2.x changed the code to allow extension mappers to be created without having to patch the main xdebug source. The example mapper is an example to show how to write your own mappers, and there should be documentation in the PDF.






(In reply to comment #56)
> Where is Example Mapper for XDebug 0.2.1? 
> I've tried example Mapper for XDebug 0.2.0 Support from above (which is
> actually org.eclipse.php.xdebug.sampleMapper_0.0.1.jar) -- not working with
> 0.2.1(((
> It just disappeared from ui. Any ideas?
> 

Comment 58 Hans Meier CLA 2007-05-17 15:38:20 EDT
(In reply to comment #57)
> I did a fresh install and it works for me. You need to create a PHP Web Script
> with XDebug launch, you should see the HTDoc tab.

I've tried fresh install and now I can see HTDoc tab. But I cannot define script and server for web debug. When I press "Browse" button on "PHP Web" tab nothing happens. However, I got these exeptions in Error log:

Error
Thu May 17 22:24:08 EEST 2007
Unhandled event loop exception
(no stack trace)

and 

Error
Thu May 17 22:24:08 EEST 2007
org.eclipse.php.internal.debug.ui.launching.LaunchUtilities.getFileFromDialog(Lorg/eclipse/core/resources/IProject;Lorg/eclipse/swt/widgets/Shell;[Ljava/lang/String;[Ljava/lang/String;)Lorg/eclipse/core/resources/IResource;

java.lang.NoSuchMethodError: org.eclipse.php.internal.debug.ui.launching.LaunchUtilities.getFileFromDialog(Lorg/eclipse/core/resources/IProject;Lorg/eclipse/swt/widgets/Shell;[Ljava/lang/String;[Ljava/lang/String;)Lorg/eclipse/core/resources/IResource;
	at org.eclipse.php.xdebug.ui.launching.XDebugPHPServerTab.getFileFromDialog(XDebugPHPServerTab.java:303)
	at org.eclipse.php.xdebug.ui.launching.XDebugPHPServerTab.handleFileButtonSelected(XDebugPHPServerTab.java:97)
	at org.eclipse.php.xdebug.ui.launching.XDebugPHPServerTab.access$4(XDebugPHPServerTab.java:95)
	at org.eclipse.php.xdebug.ui.launching.XDebugPHPServerTab$WidgetListener.widgetSelected(XDebugPHPServerTab.java:80)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:90)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:820)
	at org.eclipse.jface.window.Window.open(Window.java:796)
	at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog.open(LaunchConfigurationsDialog.java:1086)
	at org.eclipse.debug.ui.DebugUITools$1.run(DebugUITools.java:383)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
	at org.eclipse.debug.ui.DebugUITools.openLaunchConfigurationDialogOnGroup(DebugUITools.java:387)
	at org.eclipse.debug.ui.DebugUITools.openLaunchConfigurationDialogOnGroup(DebugUITools.java:329)
	at org.eclipse.debug.ui.actions.OpenLaunchDialogAction.run(OpenLaunchDialogAction.java:80)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:499)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:539)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1930)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1894)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:422)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
	at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
	at org.eclipse.core.launcher.Main.run(Main.java:977)
	at org.eclipse.core.launcher.Main.main(Main.java:952)

Platform: WinXP sp2, Eclipse 3.2.2
Tried both JRE 1.5.0 and JRE 1.6.01 - no luck

Also what are the prerequisites for manually compiling this plugin?


Comment 59 D Kelsey CLA 2007-05-17 16:21:13 EDT
(In reply to comment #58)
It looks like you are not using PDT 0.7RC3, that is the only version supported by the plug-in.

Hans, please could you direct all further questions about the xdebug plugin to the eclipse PDT newsgroup (more info about these at http://www.eclipse.org/newsgroups/)

I don't monitor this bugzilla much and it has got too large.

Regards
Comment 60 Andreas Goetz CLA 2007-06-08 05:13:05 EDT
Is there any chance of getting xdebug support into the standard PDT distribution? It seems on first glance that PDT has some proprietary touch being so focused on the Zend tools?
Comment 61 D Kelsey CLA 2007-06-19 09:13:08 EDT
Created attachment 71730 [details]
Prebuilt Binary of XDebug Support V0.2.2 for PDT RC3 only
Comment 62 D Kelsey CLA 2007-06-19 09:14:17 EDT
Created attachment 71731 [details]
Source files for XDebug Support V0.2.2 for PDT 0.7RC3 only
Comment 63 lryo CLA 2007-06-19 10:43:09 EDT
Prebuilt Binary of XDebug Support V0.2.2 for PDT RC3 only : 

In my PHP IDE, a preference page for Debug I have a message : "The currently displayed page contains invalid values" why ?
Comment 64 D Kelsey CLA 2007-06-19 12:52:13 EDT
(In reply to comment #60)
> Is there any chance of getting xdebug support into the standard PDT
> distribution? It seems on first glance that PDT has some proprietary touch
> being so focused on the Zend tools?
> 
Suggest you ask the question on the PDT news group rather than here as the newsgroup is monitored by PDT developers.

Comment 65 D Kelsey CLA 2007-06-19 12:56:02 EDT
(In reply to comment #63)
> Prebuilt Binary of XDebug Support V0.2.2 for PDT RC3 only : 
> 
> In my PHP IDE, a preference page for Debug I have a message : "The currently
> displayed page contains invalid values" why ?
> 
Please could you use the PDT newsgroup to discuss any problems found with the XDebug support package. Could you append your environment, ie check you are running 0.7RC3 and not Milestone 1, version of java etc. Thanks
Comment 66 D Kelsey CLA 2007-07-21 15:23:52 EDT
Created attachment 74296 [details]
Prebuilt Binary of XDebug Support for V0.2.3 for PDT 1.0 I20070712
Comment 67 D Kelsey CLA 2007-07-21 15:25:04 EDT
Created attachment 74297 [details]
Example Mapper V0.0.2 for XDebug 0.2.3
Comment 68 D Kelsey CLA 2007-07-21 15:27:35 EDT
Created attachment 74298 [details]
Source files for XDebug Support V0.2.3 for PDT 1.0 I20070712
Comment 69 D Kelsey CLA 2007-09-11 11:31:14 EDT
Functionality is now included in PDT.
Comment 70 D Kelsey CLA 2007-09-11 11:34:09 EDT
Functionality is now part of PDT
Comment 71 Robert de Wilde CLA 2010-01-28 13:20:02 EST
XDebug supprt seems to be broken in the newer releases.
Comment 72 David Kelsey CLA 2010-02-15 05:03:54 EST
Do not use this attachment in PDT anymore. PDT comes with xdebug support built in.