Stars: 340
Forks: 41
Pull Requests: 77
Issues: 102
Watchers: 11
Last Updated: 2023-03-24 01:38:26
Yet Another Swoole Debugger
License: Apache License 2.0
Languages: M4, C, C++, PHP, Shell
English | 中文
Swoole 5.0.1 + PHP 8.1 already support xdebug, so there is no need to use the yasd debugger!
Yet Another Swoole Debugger. document
Notice: if you use Swoole\Server, set the worker_num to 1, otherwise the breakpoint may fail.
You'll need to install the Boost library first.
macOS:
brew install boostUbuntu:
apt-get install libboost-all-devCentOS:
yum install boost boost-develphpize --clean && \
phpize && \
./configure && \
make clean && \
make && \
make installset the ini file:
zend_extension=yasdsee the extension info:
php --ri yasdzend_extension=yasd
yasd.debug_mode=remote
yasd.remote_host=127.0.0.1
yasd.remote_port=9000All command supports fuzzy matching of priorities.
set the ini file:
zend_extension=yasd
yasd.debug_mode=cmdphp -e test.phpllist source code
b absolute-file-path linenoThis will also save the breakpoint information in the cache file -- .breakpoints_file.log
You can change this file name by the ini file, e.g.
yasd.breakpoints_file="yasd.log"If the cache file exists, the breakpoints in the file are automatically loaded when debug is started.
d numberIf a breakpoint is set or deleted without specifying absolute-file-path, It will set breakpoint in the current file.
We can monitor the variable changes or expression, for example:
watch $awatch $a > 10watch $name == 'swoole'unwatch numberrnsfbtshow all breakpoints:
info breakpointsshow all watchpoints:
info watchpointscqp $a
p $this
p $this->proplethe port phpstorm listens on should be the one used for xdebug, also make sure remote connections are allowed:

do NOT forget to use -e option when running scripts, debugging will not work otherwise
ensure that phpstorm listens on incoming connections:
When using yasd, if the framework starts slowly (most of the time it's because the framework is scanning a lot of files), you can execute the following command.
composer dump-autoload -oThen modify the following configuration config/config.php:
'scan_cacheable' => env('SCAN_CACHEABLE', true)We did not find a slow start problem.
We did not find a slow start problem.
We did not find a slow start problem.
We did not find a slow start problem.
We did not find a slow start problem.