gee*_*del 5 php debugging exception xdebug visual-studio-code
我刚开始在Visual Studio Code(Ubuntu 14.04)中使用PHP Debug扩展.它对我来说效果很好,但我有一个问题,每次抛出异常时,调试器会自动中断.我们有许多异常,这些异常在我们的代码中被内部捕获和处理,因此我不想逐步完成这些异常.
我一直试图找到类似Visual Studio 2015中的异常设置,但在Visual Studio Code中找不到任何等效选项.
php.ini设置:
[debug]
xdebug.remote_autostart=on
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=localhost
xdebug.remote_port=9000
Run Code Online (Sandbox Code Playgroud)
Visual Studio Code launch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 9000,
"args": ["some arguments"]
}
]
}
Run Code Online (Sandbox Code Playgroud)
请注意,当我使用相同的xdebug设置和相同的代码库来使用Netbeans进行调试时,没有违反异常的行为,因此我认为这必须是Visual Studio Code和/或PHP Debug扩展中的内容.
谁能建议如何在不破坏的情况下通过异常?
gee*_*del 24
我自己就找到了答案(现在感觉有点蠢!).
在Visual Studio Code中,转到View-> Debug,然后取消选中Breakpoints部分中的'Everything'按钮.该选项将自动中断PHP Notices,Warnings和Exceptions.
归档时间: |
|
查看次数: |
2255 次 |
最近记录: |