LINUX.ORG.RU

XDebug: exception breakpoint и атрибут state

 


0

1

Здравствуйте!

Устанавливаю брейкпоинту с типом exception атрибут state равным disable.

По логам все корректно устанавливается:

[996] [Step Debug] <- breakpoint_set -i 6 -t exception -s enabled -x Warning
[996] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="6" state="enabled" id="9960002" resolved="resolved"></response>

[996] [Step Debug] <- breakpoint_update -i 14 -d 9960002 -s disabled
[996] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_update" transaction_id="14"><breakpoint type="exception" resolved="resolved" exception="Warning" state="disabled" hit_count="0" hit_value="0" id="9960002"></breakpoint></response>
[1005] [Step Debug] <- breakpoint_set -i 34 -t exception -s disabled -x Warning
[1005] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="34" state="disabled" id="10050002" resolved="resolved"></response>

Несмотря на то, что state установлен в disable, точка останова всегда активна.

Это баг? Exception breakpoint не поддерживает атрибут state? Или я что-то делаю не так?

Пробовал на версиях xdebug: 3.1.6, 3.2.0, 3.2.1

Покопался в коде xdebug. Нашел проверки статуса для брейкпоинтов типа line и function:

https://github.com/xdebug/xdebug/blob/28f528d0efba942c6d4d0dc50699242e2a3e4b98/src/debugger/handler_dbgp.c#L2683

https://github.com/xdebug/xdebug/blob/28f528d0efba942c6d4d0dc50699242e2a3e4b98/src/debugger/debugger.c#L513

Для exception брейкпоинтов проверок не нашел.

troizet
() автор топика

Посмотрел как организована работа с атрибутом state в PHPStorm и VSCode. Данный атрибут там не используется. Отключение брейкпоинта реализовано через удаление командой breakpoint_remove.

troizet
() автор топика