【发布时间】:2017-11-16 05:10:09
【问题描述】:
我刚刚开始在 Visual Studio Code (Ubuntu 14.04) 中使用 PHP Debug 扩展。它对我来说大部分都很好,但是我有一个问题,每次抛出异常时,调试器都会自动中断。我们有很多异常在我们的代码中被内部捕获和处理,所以我不想单步执行这些异常。
我一直试图在 Visual Studio 2015 中找到类似 Exception Settings 的内容,但在 Visual Studio 代码中找不到任何等效选项。
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
Visual Studio 代码启动.json:
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 9000,
"args": ["some arguments"]
}
]
}
请注意,当我使用 Netbeans 使用相同的 xdebug 设置和相同的代码库进行调试时,不会出现异常中断行为,因此我认为这一定是 Visual Studio Code 和/或 PHP 调试扩展中的内容。
谁能建议如何在不中断的情况下通过异常?
【问题讨论】:
标签: php debugging exception visual-studio-code xdebug