使用XDebug + PHPStorm进行调试迫使我总是步入 [英] Debugging with XDebug + PHPStorm force me to always step into

查看:135
本文介绍了使用XDebug + PHPStorm进行调试迫使我总是步入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试调试 Codeception 测试.

我的使用 PHPStorm + XDebug 的调试平台在从带有正确 IDE-KEY 作为cookie的浏览器中使用时可以很好地工作.

My debug platform using PHPStorm + XDebug is working great when using from browser with the right IDE-KEY as cookie.

但是,当尝试使用 CLI 调试codecept时,遇到以下问题:

However, when trying to debug codecept using the CLI I encounter the following problem:

  • 如果我在Cest类中设置了一个断点,则行为是正常的.我可以跳过功能,然后单击恢复"以停止调试.
  • 但是每当我在 my 代码(IE控制器或命名空间类)中放置一个断点时,xdebug都不可用:
  • If I put a breakpoint in my Cest class, behavior is normal. I am able to skip functions and click "Resume" to stop debugging.
  • But whenever I put a breakpoint that is in my code (I.E controllers or my namespace classes), xdebug becomes unusable:

如果我尝试继续退出跳过,则xdebug会忽略我的请求,并始终进入 >当前行.

If I try to Resume, Step Out or Step Over, xdebug ignores my request and always Steps Into the current line.

这使我的测试真的很难继续进行.

This makes my testing really difficult to go on with.

我尝试使用两个平台:既是我平常的流浪者+ nginx + php5-fpm(带有远程调试),也是wamp(本地调试).

I have tried using two platforms: Both my usual vagrant + nginx + php5-fpm (with remote debug), and also wamp (local debug).

任何帮助将不胜感激!

-

更新: 好吧,这与Codeception无关.我尝试仅使用 PHPUnit 进行测试,并且发生了同样的情况. CLI也似乎不是问题,因为我尝试从浏览器调试PHPUnit时没有运气.

Update: Well, this has nothing to do with Codeception. I tried testing just with PHPUnit and the same happens. Doesn't seem to be an issue with the CLI also, since I tried debugging PHPUnit from the browser, with no luck.

我以为这可能是PHPStorm错误,但查看xdebug日志,我发现正确的方法称为:

I thought maybe it's a PHPStorm bug, but looking at the xdebug log, I see the correct methods are called:

<- step_over -i 41
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="step_over" transaction_id="41" status="break" reason="ok">

step_over被调用,而不是step_into.那么也许是xdebug的错误?

step_over is called, not step_into. So maybe a bug with xdebug?

奇怪的是,这并不总是发生.更改配置后,有时有时不会发生,但随后该错误似乎又回来了……

Weird thing is, this isn't always happening. After changing configurations it sometimes doesn't happen, but then the bug seems to be coming back...

推荐答案

我也遇到了类似的问题.对我来说,无论我发出什么请求,PHPStorm总是跳出来.

I ran also into a similar problem. For me, PHPStorm always jumps out, no matter what request I made.

卸下所有手表也可以为我解决问题!

Removing all watches also fixes the problem for me!

这篇关于使用XDebug + PHPStorm进行调试迫使我总是步入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆