Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zend Debugger for PHP #2936

Closed
wants to merge 62 commits into from
Closed

Zend Debugger for PHP #2936

wants to merge 62 commits into from

Conversation

bartlomiej-laczkowski
Copy link

What does this PR do?

Adds support for debugging applications that runs on PHP with Zend Debugger on board.

What issues does this PR fix or reference?

New behavior

  • Possibility to add and run new PHP - ZEND DEBUGGER debug configuration in Che
  • Possibility to debug local PHP applications in CLI or Web mode

NOTE: Detailed description can be found in plug-in README file.

Bartlomiej Laczkowski added 30 commits October 5, 2016 20:36
Signed-off-by: Bartlomiej Laczkowski <[email protected]>
Signed-off-by: Bartlomiej Laczkowski <[email protected]>
support, removed unnecessary dependencies.

Signed-off-by: Bartlomiej Laczkowski <[email protected]>
Signed-off-by: Bartlomiej Laczkowski <[email protected]>
Signed-off-by: Bartlomiej Laczkowski <[email protected]>
support, removed unnecessary dependencies.

Signed-off-by: Bartlomiej Laczkowski <[email protected]>
Signed-off-by: Bartlomiej Laczkowski <[email protected]>
Signed-off-by: Bartlomiej Laczkowski <[email protected]>
Signed-off-by: Bartlomiej Laczkowski <[email protected]>
support, removed unnecessary dependencies.

Signed-off-by: Bartlomiej Laczkowski <[email protected]>
Signed-off-by: Bartlomiej Laczkowski <[email protected]>
Signed-off-by: Bartlomiej Laczkowski <[email protected]>
connection handling.

Signed-off-by: Bartlomiej Laczkowski <[email protected]>
Signed-off-by: Bartlomiej Laczkowski <[email protected]>
Signed-off-by: Bartlomiej Laczkowski <[email protected]>
Signed-off-by: Bartlomiej Laczkowski <[email protected]>
support, removed unnecessary dependencies.

Signed-off-by: Bartlomiej Laczkowski <[email protected]>
Signed-off-by: Bartlomiej Laczkowski <[email protected]>
Signed-off-by: Bartlomiej Laczkowski <[email protected]>
connection handling.

Signed-off-by: Bartlomiej Laczkowski <[email protected]>
Signed-off-by: Bartlomiej Laczkowski <[email protected]>
@bartlomiej-laczkowski
Copy link
Author

@tolusha
Hello, I have added a few improvements that should in general fix all of the issues that I could notice in the log file provided by you. I think that the current state is ready for the next review. Thanks in advance!

@slemeur
Copy link
Contributor

slemeur commented Nov 9, 2016

@bartlomiej-laczkowski Thanks!

In general we try to keep names of components as short as possible.
I understand that PHP devs are familiar with those names, but in the "Debug Configurations" wizard, having the "PHP [ZEND]" should be self explicit.
The square brackets are a proposal. "PHP - ZEND" would be good as well?

@kaloyan-raev
Copy link
Contributor

The name of the debugger is "Zend Debugger". "PHP - ZEND" does not really mean anything.

Perhaps, as we have only one PHP debugger integrated for now, we can just name it "PHP". The configuration page already says that it is about configuration of Zend Debugger. So, hopefully, PHP developers who used to work with Xdebug won't be confused.

When we introduce another PHP debugger in Che, we can discuss again how we can name them.

@tolusha
Copy link
Contributor

tolusha commented Nov 9, 2016

@bartlomiej-laczkowski
Thx. I am checking.

@slemeur
Copy link
Contributor

slemeur commented Nov 9, 2016

Yes, I agree, would be better solution for the time being.
+1 to @kaloyan-raev proposal.

Thanks

@bartlomiej-laczkowski
Copy link
Author

@slemeur @kaloyan-raev
Alrighty then, let's make it just 'PHP' for now.

@tolusha
Copy link
Contributor

tolusha commented Nov 9, 2016

I've faced with some NPEs on logs. But it seems everything works well.

che-wksp-1tnb 2016-11-09 15-46-23.log.zip

@tolusha
Copy link
Contributor

tolusha commented Nov 10, 2016

@bartlomiej-laczkowski
let me know when I can try a new version :)

@bartlomiej-laczkowski
Copy link
Author

@tolusha
Hello, you can try it now. I have added two more fixes that should do the job (NPEs while deleting breakpoint and setting variable value).

@tolusha
Copy link
Contributor

tolusha commented Nov 11, 2016

@bartlomiej-laczkowski
Nice work.

It is possible to have some tests for server-side?

@bartlomiej-laczkowski
Copy link
Author

@tolusha
Thanks! I will apply some basic tests for the server side soon,

@bartlomiej-laczkowski
Copy link
Author

@tolusha
Hi Anatoliy, I have added server-side tests. To be able to run them you need to have PHP + Zend Debugger installed on your test/OS environment. Note that the 'skipTests' flag is set to 'true' in server's pom.xml so it also needs to be changed.

All in all I think that everything is ready for the final review.

@tolusha
Copy link
Contributor

tolusha commented Nov 29, 2016

@bartlomiej-laczkowski
The only issue I found when I was trying to change value. Could you have a look pls.

2016-11-29 10:39:39,534[nio-4401-exec-4]  [ERROR] [o.e.c.p.z.server.ZendDebugger 331]   - Could not get debugger engine response for AssignValueRequest [ID=33]
org.eclipse.che.plugin.zdb.server.exceptions.ZendDbgTimeoutException: Response timeout (10 SECONDS) occurred.
	at org.eclipse.che.plugin.zdb.server.connection.ZendDbgConnection$EngineSyncResponse.get(ZendDbgConnection.java:238) ~[che-plugin-zend-debugger-server-5.0.0-M8-SNAPSHOT.jar:5.0.0-M8-SNAPSHOT]
	at org.eclipse.che.plugin.zdb.server.connection.ZendDbgConnection.sendRequest(ZendDbgConnection.java:329) ~[che-plugin-zend-debugger-server-5.0.0-M8-SNAPSHOT.jar:5.0.0-M8-SNAPSHOT]
	at org.eclipse.che.plugin.zdb.server.expressions.ZendDbgExpressionEvaluator.requestAssignment(ZendDbgExpressionEvaluator.java:311) [che-plugin-zend-debugger-server-5.0.0-M8-SNAPSHOT.jar:5.0.0-M8-SNAPSHOT]
	at org.eclipse.che.plugin.zdb.server.expressions.ZendDbgExpressionEvaluator.assign(ZendDbgExpressionEvaluator.java:279) [che-plugin-zend-debugger-server-5.0.0-M8-SNAPSHOT.jar:5.0.0-M8-SNAPSHOT]
	at org.eclipse.che.plugin.zdb.server.expressions.ZendDbgExpression.setValue(ZendDbgExpression.java:67) [che-plugin-zend-debugger-server-5.0.0-M8-SNAPSHOT.jar:5.0.0-M8-SNAPSHOT]
	at org.eclipse.che.plugin.zdb.server.variables.ZendDbgVariable.setValue(ZendDbgVariable.java:94) [che-plugin-zend-debugger-server-5.0.0-M8-SNAPSHOT.jar:5.0.0-M8-SNAPSHOT]
	at org.eclipse.che.plugin.zdb.server.ZendDebugger.setValue(ZendDebugger.java:313) [che-plugin-zend-debugger-server-5.0.0-M8-SNAPSHOT.jar:5.0.0-M8-SNAPSHOT]
	at org.eclipse.che.api.debugger.server.DebuggerService.setValue(DebuggerService.java:188) [che-core-api-debug-5.0.0-M8-SNAPSHOT.jar:5.0.0-M8-SNAPSHOT]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_65]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_65]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_65]

@bartlomiej-laczkowski
Copy link
Author

@tolusha
Which version of PHP + Zend Debugger did you use?
If you were using PHP 7.0.x I then there is a bug in debugger engine related to request for changing variable value that causes PHP to crash and that is why we can not get the response. It works ok when trying to change some of top level variables but it will fail i.e. when trying to change some object's field value. Changing value works fine in PHP 5.x, anyway if you were using PHP 7.0.x then there is nothing I can do about it (I have reported the issue to the engine team and hopefully they will add a fix soon).

@tolusha
Copy link
Contributor

tolusha commented Nov 29, 2016

@bartlomiej-laczkowski
I created project using ZEND stack.

PHP 7.0.11 (cli) (built: Sep 28 2016 11:53:58) ( NTS )                                                                                                                                                                          
Copyright (c) 1997-2016 The PHP Group      

@bartlomiej-laczkowski
Copy link
Author

@tolusha
So unfortunately you faced this issue. As I mentioned before, we can not do anything about it and we need to wait for the fix in the next version of Zend Debugger extension (we will update Zend stack as soon as this fix will be added).

@tolusha
Copy link
Contributor

tolusha commented Nov 29, 2016

@bartlomiej-laczkowski
Ok No prb then.

I've created a new PR with small changes and code formatting. I didn't want to disturb you ^)
#3202

@tolusha
Copy link
Contributor

tolusha commented Nov 29, 2016

I will close this one if you don't mind.

@bartlomiej-laczkowski
Copy link
Author

OK, no problem, thanks!

@tolusha tolusha removed kind/enhancement A feature request - must adhere to the feature request template. status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. labels Nov 29, 2016
@tolusha tolusha closed this Nov 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants