Giter Club home page Giter Club logo

yasd's Introduction

English | 中文

yasd

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

How to use it

Notice: if you use Swoole\Server, set the worker_num to 1, otherwise the breakpoint may fail.

build

You'll need to install the Boost library first.

macOS:

brew install boost

Ubuntu:

apt-get install libboost-all-dev

CentOS:

yum install boost boost-devel
phpize --clean && \
phpize && \
./configure && \
make clean && \
make && \
make install

set the ini file:

zend_extension=yasd

see the extension info:

php --ri yasd

IDE debug mode

zend_extension=yasd
yasd.debug_mode=remote
yasd.remote_host=127.0.0.1
yasd.remote_port=9000

cmd debug mode

All command supports fuzzy matching of priorities.

set the ini file:

zend_extension=yasd
yasd.debug_mode=cmd

start debug

php -e test.php

list

l

list source code

breakpoint

b absolute-file-path lineno

This 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.

Delete breakpoints

d number

If a breakpoint is set or deleted without specifying absolute-file-path, It will set breakpoint in the current file.

watch point

We can monitor the variable changes or expression, for example:

watch $a
watch $a > 10
watch $name == 'swoole'

unwatch point

unwatch number

run

r

step over

n

step into

s

step out

f

backtrace

bt

info

show all breakpoints:

info breakpoints

show all watchpoints:

info watchpoints

continue

c

quit

q

print

p $a
p $this
p $this->prop

level

le

Q&A

Debugging with phpstorm (remote mode)

  • the port phpstorm listens on should be the one used for xdebug, also make sure remote connections are allowed: image

  • do NOT forget to use -e option when running scripts, debugging will not work otherwise

  • ensure that phpstorm listens on incoming connections:

image

Slow Start Framework

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.

Hyperf
composer dump-autoload -o

Then modify the following configuration config/config.php:

'scan_cacheable' => env('SCAN_CACHEABLE', true)
Imi

We did not find a slow start problem.

EasySwoole

We did not find a slow start problem.

MixPHP

We did not find a slow start problem.

Swoft

We did not find a slow start problem.

One

We did not find a slow start problem.

The breakpoint is not triggered

  1. No absolute path to the file is used
  2. The breakpoint is not a valid line, such as a function declaration, blank line, etc
  3. The code is generated with proxy classes, such as Hyperf. So you need to set breakpoints in the proxy class.

yasd's People

Contributors

dlsaint avatar dmitryuk avatar haad avatar hq9000 avatar huanghantao avatar michaelgooden avatar sy-records avatar yangmeishu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

yasd's Issues

PHP 8, Docker and VS Code

I am trying to get yasd running on PHP 8 inside Docker with VS Code in my Docker host.

My Dockerfile:

FROM php:8-cli

# Install yasd (XDebug alternative) and Swoole and use the default development configuration
RUN apt-get update && apt-get install -y dumb-init libboost-all-dev \
    && pecl install swoole \
    && docker-php-ext-enable swoole \
    && cd /tmp \
    && curl -L https://github.com/swoole/yasd/archive/v0.3.7.tar.gz --output yasd.tar.gz \
    && mkdir yasd && tar xzf yasd.tar.gz -C yasd --strip-components 1 \
    && cd yasd \
    && phpize --clean \
    && phpize \
    && ./configure \
    && make clean \
    && make \
    && make install \
    && cd / && rm -rf /tmp/* \
    && mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"

# Add additional php.ini confs
COPY ./res/service-config/php/conf.d/*.ini /usr/local/etc/php/conf.d/

ENTRYPOINT ["/usr/bin/dumb-init", "--", "php", "-e"]

My yasd.ini:

zend_extension=yasd
yasd.debug_mode=remote
yasd.remote_host=host.docker.internal
yasd.remote_port=9000

My launch.json for VS Code:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Listen for XDebug",
            "type": "php",
            "request": "launch",
            "port": 9000,
            "pathMappings": {
                "/opt/my-app": "${workspaceRoot}"
            },
        }
    ]
}

When running my container, I instantly get the error:

Invalid address/ Address not supported: Function not implemented

If I remove the -e argument from the PHP call, my service starts and works fine. However, debugging from VS Code does not work (breakpoints not detected).

Any hints what else I can try?

php -e causes Invalid address/ Address not supported: No error information, when yasd is enabled

Please answer these questions before submitting your issue. Thanks!

  1. What did you do? If possible, provides a simple script and debug step to reproduce the problem.
    I run
php -e test.php

test file: test.php

<?php echo "test";
  1. What did you expect to see?
    I expected to see no problems and it to work without problems.

  2. What did you see instead?

Invalid address/ Address not supported: No error information

  1. What is your machine environment used (show your uname -a & php -v & gcc -v) ?
~ # uname -a
Linux 3ea8ae99125a 4.19.121-linuxkit #1 SMP Tue Dec 1 17:50:32 UTC 2020 x86_64 Linux


~ # php -v
PHP 7.4.15 (cli) (built: Feb 18 2021 00:45:01) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Yasd v0.3.7, Our Copyright, by codinghuang

~ # gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-alpine-linux-musl/10.2.1/lto-wrapper
Target: x86_64-alpine-linux-musl
Configured with: /home/buildozer/aports/main/gcc/src/gcc-10.2.1_pre1/configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --build=x86_64-alpine-linux-musl --host=x86_64-alpine-linux-musl --target=x86_64-alpine-linux-musl --with-pkgversion='Alpine 10.2.1_pre1' --enable-checking=release --disable-fixed-point --disable-libstdcxx-pch --disable-multilib --disable-nls --disable-werror --disable-symvers --enable-__cxa_atexit --enable-default-pie --enable-default-ssp --enable-cloog-backend --enable-languages=c,c++,d,objc,go,fortran,ada --disable-libssp --disable-libmpx --disable-libmudflap --disable-libsanitizer --enable-shared --enable-threads --enable-tls --with-system-zlib --with-linker-hash-style=gnu
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.2.1 20201203 (Alpine 10.2.1_pre1) 


Figured it out... Seems that yasd does not support hostnames, only ips...



Xdebug protocol support / PHPStorm support

Is there any roadmap to support PHPStorm? It seems to me that the easiest way without the need for cooperation from Jetbrains (or other IDEs' developers) would be to implement the same protocol as Xdebug does, but I have no idea whether such thing is at least considered.

Or are there any other considerations how to make Yasd compatible with IDEs?

This problem currently blocks our migration to PHP 8, which is kind of painful. We would gladly migrate to Yasd after there is support for PHPStorm, but until then it feels like there is no workaround. Terminal debugging is quite user unfriendly compared to PHPStorm. Not every developer has enough experience to use CLI debugging.

Thank you in advance for feedback.

Mac环境下编译报错

下载的源码编译报错:

/usr/local/Cellar/[email protected]/7.2.20/include/php/Zend/zend_extensions.h:56:33: note: expanded from macro 'ZEND_EXTENSION_BUILD_ID'
#define ZEND_EXTENSION_BUILD_ID "API" ZEND_TOSTR(ZEND_EXTENSION_API_NO) ZEND_BUILD_TS ZEND_BUILD_DEBUG ZEND_BUILD_SYSTEM ZEND_BUILD_EXTRA
^
/php-extension/yasd/yasd.cc:212:5: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
"Yasd",
^
/php-extension/yasd/yasd.cc:213:5: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
PHP_YASD_VERSION,
^
././php_yasd.h:25:26: note: expanded from macro 'PHP_YASD_VERSION'
#define PHP_YASD_VERSION "0.1.0"
^
/php-ext/ensionyasd/yasd.cc:214:5: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
"codinghuang",
^
/php-extension/yasd/yasd.cc:215:5: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
"https://github.com/huanghantao",
^
/php-extension/yasd/yasd.cc:216:5: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
"Our Copyright",

......

yasd/src/cmder_debugger.cc:24:10: fatal error: 'thirdparty/boost/algorithm/include/boost/algorithm/string.hpp' file not found
#include "thirdparty/boost/algorithm/include/boost/algorithm/string.hpp"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make: *** [src/cmder_debugger.lo] Error 1

The problem that is vscode use yasd

I install yasd.
When I reopen my computer, the vscode cannot use yasd.
However, before I reopen the computer, I can use yasd in vscode.
image
image
image

PS. I install yasd version 0.2.5, but php --ri yasd show 0.1.0

phptorm2020|2021版本里监听不到端口,phpstorm2019没问题

采用virtualBo安装centos7.8操作系统,然后按照文档装机phpstorm2020监听不到,之前安装sdebug2.6时,也有这个问题,但是后来sdebug2.7解决了phpstorm2020监听不到的问题,还请yasd团队,参照sdebug2.7改进点,来兼容下phpstorm2020

备注:据说使用wsl的用户没有这个问题

超全局变量没有显示

Please answer these questions before submitting your issue. Thanks!

  1. What did you do? If possible, provides a simple script and debug step to reproduce the problem.
class Foo
{
    public $a;

    public function __construct($a)
    {
        $this->a = "hello";
    }
}

$GLOBALS['et'] = new Foo(3); 
  1. What did you expect to see?

vscode 中 Superglobals这一栏显示超全局变量

  1. What did you see instead?

vscode 中 Superglobals这一栏一直是空,监视$GLOBALS可以看到值

  1. What is your machine environment used (show your uname -a & php -v & gcc -v) ?

Linux DESKTOP-MQPNMBP 4.19.84-microsoft-standard #1 SMP Wed Nov 13 11:44:37 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

PHP 7.2.24-0ubuntu0.18.04.7 (cli) (built: Oct  7 2020 15:24:25) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.24-0ubuntu0.18.04.7, Copyright (c) 1999-2018, by Zend Technologies
    with Yasd v0.1.0, Our Copyright, by codinghuang
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.5.0-3ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)

调试时遇到错误`double free or corruption (!prev)`

Please answer these questions before submitting your issue. Thanks!

  1. What did you do? If possible, provides a simple script and debug step to reproduce the problem.

debug imi-project

  1. What did you expect to see?

正常调试

  1. What did you see instead?
double free or corruption (!prev)
[2021-03-25 03:20:12 $633238.0] WARNING check_worker_exit_status: worker#3[pid=633246] abnormal exit, status=0, signal=6
  1. What is your machine environment used (show your uname -a & php -v & gcc -v) ?
PHP 7.4.16 (cli) (built: Mar  5 2021 07:54:38) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.16, Copyright (c), by Zend Technologies
Swoole => enabled
Author => Swoole Team <[email protected]>
Version => 4.6.4
Built => Mar 20 2021 02:13:40
coroutine => enabled with boost asm context
epoll => enabled
eventfd => enabled
signalfd => enabled
cpu_affinity => enabled
spinlock => enabled
rwlock => enabled
sockets => enabled
openssl => OpenSSL 1.1.1j  16 Feb 2021
dtls => enabled
http2 => enabled
json => enabled
curl-native => enabled
pcre => enabled
zlib => 1.2.11
mutex_timedlock => enabled
pthread_barrier => enabled
futex => enabled
mysqlnd => enabled
async_redis => enabled

Directive => Local Value => Master Value
swoole.enable_coroutine => On => On
swoole.enable_library => On => On
swoole.enable_preemptive_scheduler => Off => Off
swoole.display_errors => On => On
swoole.use_shortname => On => On
swoole.unixsock_buffer_size => 8388608 => 8388608
Yasd => enabled
Author => codinghuang <[email protected]>
Version => 0.3.7
Built => Mar 19 2021 02:28:16

Directive => Local Value => Master Value
yasd.breakpoints_file => no value => no value
yasd.debug_mode => remote => remote
yasd.remote_host => 192.168.10.1 => 192.168.10.1
yasd.remote_port => 9000 => 9000
yasd.depth => 1 => 1
yasd.log_level => -1 => -1
yasd.max_executed_opline_num => 0 => 0
yasd.init_file => no value => no value
xdebug.coverage_enable => 1 => 1
xdebug.profiler_enable => 1 => 1
xdebug.remote_autostart => 1 => 1
xdebug.remote_connect_back => 0 => 0
xdebug.remote_mode => req => req

编译的是最新分支:7f00cb8ae884b1ed3a02d019eab24ea5c36449c5

最初运行时还出现了个:core dump

Program terminated with signal SIGABRT, Aborted.
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50      ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) l
150     in ../sysdeps/posix/libc_fatal.c
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007f1834cc6859 in __GI_abort () at abort.c:79
#2  0x00007f1834d313ee in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0x7f1834e5b285 "%s\n") at ../sysdeps/posix/libc_fatal.c:155
#3  0x00007f1834d3947c in malloc_printerr (str=str@entry=0x7f1834e5d600 "free(): invalid next size (fast)") at malloc.c:5347
#4  0x00007f1834d3ad2c in _int_free (av=0x7f1834e8cb80 <main_arena>, p=0x55b52a609f50, have_lock=0) at malloc.c:4249
#5  0x00007f1834f11e0e in pcre2_code_free_8 () from /lib/x86_64-linux-gnu/libpcre2-8.so.0
#6  0x000055b5287fc4a6 in ?? ()
#7  0x000055b5289619f2 in zend_hash_destroy ()
#8  0x000055b5287fc388 in ?? ()
#9  0x000055b528957054 in zend_deactivate_modules ()
#10 0x000055b5288f0385 in php_request_shutdown ()
#11 0x000055b5289dcc44 in ?? ()
#12 0x000055b5287b7138 in ?? ()
#13 0x00007f1834cc80b3 in __libc_start_main (main=0x55b5287b6d30, argc=9, argv=0x7ffc976d95a8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffc976d9598) at ../csu/libc-start.c:308
#14 0x000055b5287b72de in _start ()

在phpstorm下关闭调试模式服务器直接502了

相关版本:
--macos 10.14.6
--phpstorm 2019.3.4
--PHP 7.3.18
--- yasd
`
Yasd => enabled
Author => codinghuang [email protected]
Version => 0.3.2-alpha
Built => Jan 4 2021 18:52:55

Directive => Local Value => Master Value
yasd.breakpoints_file => no value => no value
yasd.debug_mode => remote => remote
yasd.remote_host => 127.0.0.1 => 127.0.0.1
yasd.remote_port => 9900 => 9900
yasd.depth => 1 => 1
yasd.log_level => -1 => -1
xdebug.coverage_enable => 1 => 1
xdebug.profiler_enable => 1 => 1
xdebug.remote_autostart => 1 => 1
xdebug.remote_connect_back => 0 => 0
xdebug.remote_mode => req => req
`

开启phpstorm调试模式时,可以正常访问 localhost
但关闭phpstorm调试模式后,再访问就会报下面的错误

`
2021/01/04 20:00:00 [error] 215#0: *2291 kevent() reported about an closed connection (54: Connection reset by peer) while reading response header from upstream, client: 127.0.0.1, server: 127.0.0.1, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "localhost"

`

Where is breakpoints_file

Hi, I want to find the breakpoints_file when I use vscode.
I try to set absolutely path, but I didn't find the file.
Please help me!

This is my set and my folder permission is 777.
yasd.breakpoints_file="/home/<path>/yasd.log"

Yasd hits breakpoint and then just blocks. Hitting continue (F5) in VS Code does not continue the execution.

Please answer these questions before submitting your issue. Thanks!

  1. What did you do? If possible, provides a simple script and debug step to reproduce the problem.

Here is my sample script:

$http = new Swoole\HTTP\Server("0.0.0.0", 9501);

$http->on('start', function ($server) {
    echo "Swoole http server is started at http://127.0.0.1:9501\n";
});

$http->on('request', function ($request, $response) {
    $response->header("Content-Type", "text/plain");
    $response->end("Hello World\n");
});
  1. What did you expect to see?

I expect that when I hit Continue or F5 the debugger should continue execution.

  1. What did you see instead?

The debugger does not continue. The execution is still paused.

  1. What is your machine environment used (show your uname -a & php -v & gcc -v) ?
# uname -a
Linux 0e3189c0aeda 4.9.184-linuxkit #1 SMP Tue Jul 2 22:58:16 UTC 2019 x86_64 GNU/Linux
# php -v
PHP 8.0.3 (cli) (built: Apr 10 2021 13:10:41) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.3, Copyright (c) Zend Technologies
    with Yasd v0.3.7, Our Copyright, by codinghuang
# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/8/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 8.3.0-6' --with-bugurl=file:///usr/share/doc/gcc-8/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-8 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 8.3.0 (Debian 8.3.0-6)

指定php-config方式编译未能通过

安装了 php7.2.24php7.4.12

使用7.4对应的 phpize7.4 以及在configue时候指定对应php-config,make时候报找不到 php/main/php.h

➜ yasd git:(master) phpize7.4 --clean
Cleaning..
➜ yasd git:(master) phpize7.4
Configuring for:
PHP Api Version: 20190902
Zend Module Api No: 20190902
Zend Extension Api No: 320190902
➜ yasd git:(master) ./configure --with-php-config=/usr/bin/php-config7.4
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php/20190902 -I/usr/include/php/20190902/main -I/usr/include/php/20190902/TSRM -I/usr/include/php/20190902/Zend -I/usr/include/php/20190902/ext -I/usr/include/php/20190902/ext/date/lib
checking for PHP extension directory... /usr/lib/php/20190902
checking for PHP installed headers prefix... /usr/include/php/20190902
checking if debug is enabled... no
checking if zts is enabled... no
checking for gawk... no
checking for nawk... nawk
checking if nawk is broken... no
checking whether to enable yasd support... yes, shared
checking whether to enable yasd developer build flags... no
checking if compiling with clang... no
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
checking how to print strings... printf
checking for a sed that does not truncate output... (cached) /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @file support... @
checking for strip... strip
checking for ranlib... ranlib
checking for gawk... (cached) nawk
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC -DPIC
checking if cc PIC flag -fPIC -DPIC works... yes
checking if cc static flag -static works... yes
checking if cc supports -c -o file.o... yes
checking if cc supports -c -o file.o... (cached) yes
checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
configure: patching config.h.in
configure: creating ./config.status
config.status: creating config.h
config.status: executing libtool commands
➜ yasd git:(master) make
/bin/bash /home/jobin/software/yasd/libtool --mode=compile g++ -I. -I/home/jobin/software/yasd -DPHP_ATOM_INC -I/home/jobin/software/yasd/include -I/home/jobin/software/yasd/main -I/home/jobin/software/yasd -I/usr/include/php/20190902 -I/usr/include/php/20190902/main -I/usr/include/php/20190902/TSRM -I/usr/include/php/20190902/Zend -I/usr/include/php/20190902/ext -I/usr/include/php/20190902/ext/date/lib -I/include -DHAVE_CONFIG_H -g -O2 -Wall -Wno-unused-function -Wno-deprecated -Wno-deprecated-declarations -std=c++11 -c /home/jobin/software/yasd/yasd.cc -o yasd.lo
libtool: compile: g++ -I. -I/home/jobin/software/yasd -DPHP_ATOM_INC -I/home/jobin/software/yasd/include -I/home/jobin/software/yasd/main -I/home/jobin/software/yasd -I/usr/include/php/20190902 -I/usr/include/php/20190902/main -I/usr/include/php/20190902/TSRM -I/usr/include/php/20190902/Zend -I/usr/include/php/20190902/ext -I/usr/include/php/20190902/ext/date/lib -I/include -DHAVE_CONFIG_H -g -O2 -Wall -Wno-unused-function -Wno-deprecated -Wno-deprecated-declarations -std=c++11 -c /home/jobin/software/yasd/yasd.cc -fPIC -DPIC -o .libs/yasd.o
/home/jobin/software/yasd/yasd.cc:28:10: fatal error: php/main/php.h: 没有那个文件或目录
#include "php/main/php.h"
^~~~~~~~~~~~~~~~
compilation terminated.
Makefile:192: recipe for target 'yasd.lo' failed
make: *** [yasd.lo] Error 1

hyperf 断点调试,打了断点,但是没有生效

1、如下是代码
image

2、如下是操作过程;
首先使用了b命令在20行处打了断点;
然后使用了r命令;
3、问题:
代码跑起来,发现并没有输出 stop at breakpoint
访问9501端口,代码报错

image

Unable to build

Please answer these questions before submitting your issue. Thanks!

  1. What did you do? If possible, provides a simple script and debug step to reproduce the problem.

Cloned the repo.

  1. What did you expect to see?

Makefile to build solution

  1. What did you see instead?
    N/A

  2. What is your machine environment used (show your uname -a & php -v & gcc -v) ?

I'm unable to follow steps for installation after clone the repo. There's no Makefile.

Any suggestions?

5.4.0-60-generic #67-Ubuntu SMP Tue Jan 5 18:31:36 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

php -v
PHP 7.3.25 (cli) (built: Dec 17 2020 09:49:54) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.25, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.25, Copyright (c) 1999-2018, by Zend Technologies
with Sdebug v2.9.3-dev, Copyright (c) 2002-2020, by Derick Rethans

希望有更多更详细的教程

文档里教程比较少,希望有更多更详细的教程,比如怎么调试 Swoole/Hyperf/Swoft 框架里的 HTTP 请求,和更多场景的调试教程。

另外弱弱的问一下,什么时候能支持 pecl 安装/升级。

make test 失败率94.1%,安装后不能正常使用

Please answer these questions before submitting your issue. Thanks!

  1. What did you do? If possible, provides a simple script and debug step to reproduce the problem.
    命令行和远程都监听不到断点,也没有运行时信息

  2. What did you expect to see?
    程序运行展示运行时信息,断点可用

  3. What did you see instead?
    run make test

Build complete.
Don't forget to run 'make test'.


=====================================================================
PHP         : /usr/local/php-7.2.34/bin/php
PHP_SAPI    : cli
PHP_VERSION : 7.2.34
ZEND_VERSION: 3.2.0
PHP_OS      : Linux - Linux DESKTOP-MQPNMBP 4.19.128-microsoft-standard #1 SMP Tue Jun 23 12:58:10 UTC 2020 x86_64
INI actual  : /tmp/yasd/yasd-0.3.5/tmp-php.ini
More .INIs  :
---------------------------------------------------------------------
PHP         : /usr/local/php-7.2.34/bin/phpdbg
PHP_SAPI    : phpdbg
PHP_VERSION : 7.2.34
ZEND_VERSION: 3.2.0
PHP_OS      : Linux - Linux DESKTOP-MQPNMBP 4.19.128-microsoft-standard #1 SMP Tue Jun 23 12:58:10 UTC 2020 x86_64
INI actual  : /tmp/yasd/yasd-0.3.5/tmp-php.ini
More .INIs  :
---------------------------------------------------------------------
CWD         : /tmp/yasd/yasd-0.3.5
Extra dirs  :
VALGRIND    : Not used
=====================================================================
TIME START 2021-01-15 10:47:57
=====================================================================
FAIL issue: 41 [tests/yasd_debugger/issue/41.phpt]
FAIL remote_mode: breakpoint_list [tests/yasd_debugger/remote_mode/breakpoint_list.phpt]
FAIL remote_mode: breakpoint_set [tests/yasd_debugger/remote_mode/breakpoint_set/breakpoint_set.phpt]
FAIL breakpoint_set: breakpoint_set_conditional_line [tests/yasd_debugger/remote_mode/breakpoint_set/breakpoint_set_conditional_line.phpt]
FAIL remote_mode: context_get [tests/yasd_debugger/remote_mode/context_get.phpt]
FAIL context_get: superglobal_variable [tests/yasd_debugger/remote_mode/context_get/superglobal_variable.phpt]
FAIL remote_mode: context_names [tests/yasd_debugger/remote_mode/context_names.phpt]
FAIL remote_mode: eval [tests/yasd_debugger/remote_mode/eval.phpt]
FAIL remote_mode: feature_set [tests/yasd_debugger/remote_mode/feature_set.phpt]
FAIL phpstorm: compatible_with_phpstorm [tests/yasd_debugger/remote_mode/phpstorm/compatible_with_phpstorm.phpt]
FAIL phpstorm: eval [tests/yasd_debugger/remote_mode/phpstorm/eval.phpt]
FAIL property_get: classnamme_array_key [tests/yasd_debugger/remote_mode/property_get/classnamme_array_key.phpt]
FAIL property_get: nmerical_index_array [tests/yasd_debugger/remote_mode/property_get/nmerical_index_array.phpt]
FAIL remote_mode: stack_get [tests/yasd_debugger/remote_mode/stack_get.phpt]
FAIL remote_mode: stdout [tests/yasd_debugger/remote_mode/stdout.phpt]
FAIL remote_mode: stop [tests/yasd_debugger/remote_mode/stop.phpt]
PASS zval: getRefCount [tests/yasd_debugger/zval/getRefCount.phpt]
=====================================================================
TIME END 2021-01-15 10:47:57

=====================================================================
TEST RESULT SUMMARY
---------------------------------------------------------------------
Exts skipped    :    0
Exts tested     :   35
---------------------------------------------------------------------

Number of tests :   17                17
Tests skipped   :    0 (  0.0%) --------
Tests warned    :    0 (  0.0%) (  0.0%)
Tests failed    :   16 ( 94.1%) ( 94.1%)
Expected fail   :    0 (  0.0%) (  0.0%)
Tests passed    :    1 (  5.9%) (  5.9%)
---------------------------------------------------------------------
Time taken      :    0 seconds
=====================================================================

=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
issue: 41 [tests/yasd_debugger/issue/41.phpt]
remote_mode: breakpoint_list [tests/yasd_debugger/remote_mode/breakpoint_list.phpt]
remote_mode: breakpoint_set [tests/yasd_debugger/remote_mode/breakpoint_set/breakpoint_set.phpt]
breakpoint_set: breakpoint_set_conditional_line [tests/yasd_debugger/remote_mode/breakpoint_set/breakpoint_set_conditional_line.phpt]
remote_mode: context_get [tests/yasd_debugger/remote_mode/context_get.phpt]
context_get: superglobal_variable [tests/yasd_debugger/remote_mode/context_get/superglobal_variable.phpt]
remote_mode: context_names [tests/yasd_debugger/remote_mode/context_names.phpt]
remote_mode: eval [tests/yasd_debugger/remote_mode/eval.phpt]
remote_mode: feature_set [tests/yasd_debugger/remote_mode/feature_set.phpt]
phpstorm: compatible_with_phpstorm [tests/yasd_debugger/remote_mode/phpstorm/compatible_with_phpstorm.phpt]
phpstorm: eval [tests/yasd_debugger/remote_mode/phpstorm/eval.phpt]
property_get: classnamme_array_key [tests/yasd_debugger/remote_mode/property_get/classnamme_array_key.phpt]
property_get: nmerical_index_array [tests/yasd_debugger/remote_mode/property_get/nmerical_index_array.phpt]
remote_mode: stack_get [tests/yasd_debugger/remote_mode/stack_get.phpt]
remote_mode: stdout [tests/yasd_debugger/remote_mode/stdout.phpt]
remote_mode: stop [tests/yasd_debugger/remote_mode/stop.phpt]
=====================================================================

You may have found a problem in PHP.
This report can be automatically sent to the PHP QA team at
http://qa.php.net/reports and http://news.php.net/php.qa.reports
This gives us a better understanding of PHP's behavior.
If you don't want to send the report immediately you can choose
option "s" to save it.  You can then email it to [email protected] later.
Do you want to send this report now? [Yns]: n
make: *** [Makefile:134: test] Error 1
  1. What is your machine environment used (show your uname -a & php -v & gcc -v) ?
  • uname -a
    Linux DESKTOP-MQPNMBP 4.19.128-microsoft-standard #1 SMP Tue Jun 23 12:58:10 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
  • php -v
PHP 7.2.34 (cli) (built: Jan 14 2021 13:52:54) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
  • gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.3.0-17ubuntu1~20.04' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-HskZEa/gcc-9-9.3.0/debian/tmp-nvptx/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)

master分支vscode + remote模式直接segmentation fault

~ php7.4 -v         
PHP 7.4.13 (cli) (built: Nov 28 2020 06:24:43) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Yasd v0.2.6, Our Copyright, by codinghuang
    with Zend OPcache v7.4.13, Copyright (c), by Zend Technologies

➜  ~ php7.4 --ri yasd

yasd

Yasd => enabled
Author => codinghuang <[email protected]>
Version => 0.2.6
Built => Dec 22 2020 18:07:46

Directive => Local Value => Master Value
yasd.breakpoints_file => no value => no value
yasd.debug_mode => remote => remote
yasd.remote_host => 127.0.0.1 => 127.0.0.1
yasd.remote_port => 9000 => 9000
yasd.depth => 1 => 1
➜  yasd git:(master) php7.4 -e test.php
[1]    6544 segmentation fault (core dumped)  php7.4 -e test.php
➜  yasd git:(master) ✗ gdb php7.4 -c core
GNU gdb (Ubuntu 8.1-0ubuntu3.2) 8.1.0.20180409-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from php7.4...(no debugging symbols found)...done.
[New LWP 6544]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `php7.4 -e test.php'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007fcd9a73e34c in yasd::Util::is_hit_watch_point () at /home/jobin/software/yasd/src/util.cc:278
278         zend_function *func = EG(current_execute_data)->func;
(gdb) bt
#0  0x00007fcd9a73e34c in yasd::Util::is_hit_watch_point () at /home/jobin/software/yasd/src/util.cc:278
#1  0x00007fcd9a73c0c3 in yasd_statement_call (frame=<optimized out>) at /home/jobin/software/yasd/yasd.cc:173
#2  0x0000556c79a710a2 in zend_llist_apply_with_argument ()
#3  0x0000556c798d622b in ?? ()
#4  0x0000556c79b03fac in execute_ex ()
#5  0x00007fcd9a73ebbf in yasd_execute_ex (execute_data=0x7fcd9ae13020) at /home/jobin/software/yasd/src/base.cc:96
#6  0x0000556c79b0a4a2 in zend_execute ()
#7  0x0000556c79a7d532 in zend_execute_scripts ()
#8  0x0000556c79a1c070 in php_execute_script ()
#9  0x0000556c79b0c4a3 in ?? ()
#10 0x0000556c798d79e6 in ?? ()
#11 0x00007fcd9daa7b97 in __libc_start_main (main=0x556c798d75d0, argc=3, argv=0x7fffb580d7b8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, 
    stack_end=0x7fffb580d7a8) at ../csu/libc-start.c:310
#12 0x0000556c798d7b8a in _start ()
(gdb) 

image

机器的两个 php 版本 php7.2php7.4 都是这个情况。调试的是项目提供的test.php

在make安装时报错

在make安装时报错,错误信息如下

/bin/sh /root/yasd-master/libtool --mode=compile g++ -I. -I/root/yasd-master -DPHP_ATOM_INC -I/root/yasd-master/include -I/root/yasd-master/main -I/root/yasd-master -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/include -I/root/yasd-master/thirdparty/tinyxml2 -DHAVE_CONFIG_H -g -O2 -Wall -Wno-unused-function -Wno-deprecated -Wno-deprecated-declarations -std=c++11 -c /root/yasd-master/yasd.cc -o yasd.lo
libtool: compile: g++ -I. -I/root/yasd-master -DPHP_ATOM_INC -I/root/yasd-master/include -I/root/yasd-master/main -I/root/yasd-master -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/include -I/root/yasd-master/thirdparty/tinyxml2 -DHAVE_CONFIG_H -g -O2 -Wall -Wno-unused-function -Wno-deprecated -Wno-deprecated-declarations -std=c++11 -c /root/yasd-master/yasd.cc -fPIC -DPIC -o .libs/yasd.o
/root/yasd-master/yasd.cc:272:104: error: macro "ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX" requires 6 arguments, but only 5 given
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_Yasd_Zval_getRefCount, ZEND_RETURN_VALUE, 1, IS_LONG, 1)
^
/root/yasd-master/yasd.cc:289:103: error: macro "ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX" requires 6 arguments, but only 5 given
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_Yasd_getOpcodeByName, ZEND_RETURN_VALUE, 1, IS_LONG, 1)
^
/root/yasd-master/yasd.cc:272:1: error: 'ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX' does not name a type
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_Yasd_Zval_getRefCount, ZEND_RETURN_VALUE, 1, IS_LONG, 1)
^
In file included from /usr/include/php/main/php.h:39:0,
from /root/yasd-master/yasd.cc:27:
/usr/include/php/Zend/zend_API.h:100:107: error: expected unqualified-id before ',' token
#define ZEND_ARG_INFO(pass_by_ref, name) { #name, NULL, 0, pass_by_ref, 0, 0 },
^
/root/yasd-master/yasd.cc:273:1: note: in expansion of macro 'ZEND_ARG_INFO'
ZEND_ARG_INFO(0, zv)
^
/usr/include/php/Zend/zend_API.h:120:30: error: expected unqualified-id before '}' token
#define ZEND_END_ARG_INFO() };
^
/root/yasd-master/yasd.cc:274:1: note: in expansion of macro 'ZEND_END_ARG_INFO'
ZEND_END_ARG_INFO()
^
/usr/include/php/Zend/zend_API.h:120:30: error: expected declaration before '}' token
#define ZEND_END_ARG_INFO() };
^
/root/yasd-master/yasd.cc:274:1: note: in expansion of macro 'ZEND_END_ARG_INFO'
ZEND_END_ARG_INFO()
^
make: *** [yasd.lo] Error 1

Ubantu18.04+php7.2 + yasdv0.2.5 + vscode 存在断点残留

使用 remote 模式与 vscode 对项目下的 test.php 进行断点调试,断点不生效直接将文件执行完。同样使用 cmd 模式也是如此。同时 cmd 模式下每次退出调试重新开始后,上次打的断点还会存在

php -v

PHP 7.2.24-0ubuntu0.18.04.7 (cli) (built: Oct  7 2020 15:24:25) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.24-0ubuntu0.18.04.7, Copyright (c) 1999-2018, by Zend Technologies

php -m

[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
igbinary
intl
json
libxml
mbstring
memcache
memcached
mongodb
msgpack
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
Phar
posix
readline
redis
Reflection
session
shmop
SimpleXML
sockets
sodium
SPL
standard
swoole
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xml
xmlreader
xmlwriter
xsl
yasd
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache

php --ri yasd

yasd

Yasd => enabled
Author => codinghuang <[email protected]>
Version => 0.1.0
Built => Dec 18 2020 10:39:41

Directive => Local Value => Master Value
yasd.breakpoints_file => .breakpoints_file.log => .breakpoints_file.log
yasd.debug_mode => remote => remote
yasd.remote_host => 127.0.0.1 => 127.0.0.1
yasd.remote_port => 9000 => 9000
yasd.depth => 1 => 1

cmd 模式断点残留情况
image

cmd 模式下断点不生效
image

在swoole alpine镜像中make报错

下载了v0.3.2的release,在phpswoole/swoole:4.5.10-php7.3-alpine镜像中 执行apk add boost-dev之后执行docker-php-ext-install报错

如图
image

malloc: can't allocate region

hyperf用view组件,controller中
return $render->render('doc.index');
index.blade.php文件中有引用css和js文件

我打的断点在
image
当第二次走到这个断点时,debug信息就看不到了
image

相应的控制台
php(74495,0x1188b75c0) malloc: can't allocate region
*** mach_vm_map(size=8030604640798470144) failed (error code=3)
php(74495,0x1188b75c0) malloc: *** set a breakpoint in malloc_error_break to debug
libc++abi.dylib: terminating with uncaught exception of type std::bad_alloc: std::bad_alloc
[2021-03-31 14:52:52 $74482.0] WARNING check_worker_exit_status: worker#0[pid=74495] abnormal exit, status=0, signal=6

我机器目前的内存应该是够的
image

Using yasd debugging, when I use the command PHP - e think spool start, I can start the service normally. When I visit the web page, I report an error

[root@localhost test.com]# php -e think swoole start
Starting swoole http server...
Swoole http server started: http://0.0.0.0:8324
You can exit with CTRL-C
*** Error in `swoole_http_server: worker process for ThinkPHP': free(): invalid next size (fast): 0x0000000002464610 ***
======= Backtrace: =========
/usr/lib64/libc.so.6(+0x81299)[0x7fd006f7f299]
/www/server/php/73/lib/php/extensions/no-debug-non-zts-20180731/yasd.so(ZNSt6vectorIPN4yasd10StackFrameESaIS2_EE19_M_emplace_back_auxIJRS2_EEEvDpOT+0x99)[0x7fcfffc8dbc9]
/www/server/php/73/lib/php/extensions/no-debug-non-zts-20180731/yasd.so(_Z21save_prev_stack_frameP18_zend_execute_data+0xf2)[0x7fcfffc8da52]
/www/server/php/73/lib/php/extensions/no-debug-non-zts-20180731/yasd.so(_Z15yasd_execute_exP18_zend_execute_data+0x46)[0x7fcfffc8dac6]
swoole_http_server: worker process for ThinkPHP(execute_ex+0x8fcc)[0x91f78c]
/www/server/php/73/lib/php/extensions/no-debug-non-zts-20180731/yasd.so(_Z15yasd_execute_exP18_zend_execute_data+0x52)[0x7fcfffc8dad2]
swoole_http_server: worker process for ThinkPHP(execute_ex+0x8df5)[0x91f5b5]
/www/server/php/73/lib/php/extensions/no-debug-non-zts-20180731/yasd.so(_Z15yasd_execute_exP18_zend_execute_data+0x52)[0x7fcfffc8dad2]
/www/server/php/73/lib/php/extensions/no-debug-non-zts-20180731/swoole.so(_ZN6swoole12PHPCoroutine9main_funcEPv+0x324)[0x7fcffeb31a04]
/www/server/php/73/lib/php/extensions/no-debug-non-zts-20180731/swoole.so(_ZN6swoole9coroutine7Context12context_funcEPv+0x12)[0x7fcffeba2f32]
/www/server/php/73/lib/php/extensions/no-debug-non-zts-20180731/swoole.so(make_fcontext+0x21)[0x7fcffebffa01]
======= Memory map: ========
00400000-00c78000 r-xp 00000000 fd:00 1161015 /www/server/php/73/bin/php
00e77000-00f3b000 r--p 00877000 fd:00 1161015 /www/server/php/73/bin/php
00f3b000-00f4c000 rw-p 0093b000 fd:00 1161015 /www/server/php/73/bin/php
00f4c000-00f72000 rw-p 00000000 00:00 0
01f01000-02265000 rw-p 00000000 00:00 0 [heap]
02265000-0268f000 rw-p 00000000 00:00 0 [heap]
7fcff4000000-7fcff4021000 rw-p 00000000 00:00 0
7fcff4021000-7fcff8000000 ---p 00000000 00:00 0
7fcff9400000-7fcff9c00000 rw-p 00000000 00:00 0
7fcff9f3e000-7fcffa13f000 rw-s 00000000 00:04 486231 /dev/zero (deleted)
7fcffa13f000-7fcffa340000 rw-s 00000000 00:04 486229 /dev/zero (deleted)
7fcffa340000-7fcffb3c0000 rw-s 00000000 00:04 486220 /dev/zero (deleted)
7fcffb3c0000-7fcffc3c1000 r--s 00000000 00:04 486217 /dev/zero (deleted)
7fcffc3c1000-7fcffd7eb000 rw-s 00000000 00:04 486216 /dev/zero (deleted)
7fcffd7eb000-7fcffe200000 rw-s 00000000 00:04 486215 /dev/zero (deleted)
7fcffe200000-7fcffe600000 rw-p 00000000 00:00 0
7fcffe602000-7fcffe803000 rw-s 00000000 00:04 486171 /dev/zero (deleted)
7fcffe803000-7fcffe811000 r-xp 00000000 fd:00 1774528 /www/server/php/73/lib/php/extensions/no-debug-non-zts-20180731/swoole_loader73.so
7fcffe811000-7fcffe8ba000 r-xp 00000000 00:00 0
7fcffe8ba000-7fcffeab9000 ---p 000b7000 fd:00 1774528 /www/server/php/73/lib/php/extensions/no-debug-non-zts-20180731/swoole_loader73.so
7fcffeab9000-7fcffeabe000 rw-p 0002c000 fd:00 1774528 /www/server/php/73/lib/php/extensions/no-debug-non-zts-20180731/swoole_loader73.so
7fcffeabe000-7fcffec7b000 r-xp 00000000 fd:00 1774536 /www/server/php/73/lib/php/extensions/no-debug-non-zts-20180731/swoole.so
7fcffec7b000-7fcffee7b000 ---p 001bd000 fd:00 1774536 /www/server/php/73/lib/php/extensions/no-debug-non-zts-20180731/swoole.so
7fcffee7b000-7fcffee8b000 r--p 001bd000 fd:00 1774536 /www/server/php/73/lib/php/extensions/no-debug-non-zts-20180731/swoole.so
7fcffee8b000-7fcffee91000 rw-p 001cd000 fd:00 1774536 /www/server/php/73/lib/php/extensions/no-debug-non-zts-20180731/swoole.so
7fcffee91000-7fcffee96000 rw-p 00000000 00:00 0
7fcffee96000-7fcffef1c000 r-xp 00000000 fd:00 1636131 /www/server/php/73/lib/php/extensions/no-debug-non-zts-20180731/redis.so
7fcffef1c000-7fcfff11c000 ---p 00086000 fd:00 1636131 /www/server/php/73/lib/php/extensions/no-debug-non-zts-20180731/redis.so
7fcfff11c000-7fcfff122000 r--p 00086000 fd:00 1636131 /www/server/php/73/lib/php/extensions/no-debug-non-zts-20180731/redis.so
7fcfff122000-7fcfff127000 rw-p 0008c000 fd:00 1636131 /www/server/php/73/lib/php/extensions/no-debug-non-zts-20180731/redis.so
7fcfff127000-7fcfff654000 r-xp 00000000 fd:00 1199796 /www/server/php/73/lib/php/extensions/no-debug-non-zts-20180731/fileinfo.so
7fcfff654000-7fcfff854000 ---p 0052d000 fd:00 1199796 /www/server/php/73/lib/php/extensions/no-debug-non-zts-20180731/fileinfo.so
7fcfff854000-7fcfff855000 r--p 0052d000 fd:00 1199796 /www/server/php/73/lib/php/extensions/no-debug-non-zts-20180731/fileinfo.so
7fcfff855000-7fcfff856000 rw-p 0052e000 fd:00 1199796 /www/server/php/73/lib/php/extensions/no-debug-non-zts-20180731/fileinfo.so
7fcfff856000-7fcfff859000 r-xp 00000000 fd:00 1774571 /usr/lib64/libboost_system.so.1.53.0
7fcfff859000-7fcfffa58000 ---p 00003000 fd:00 1774571 /usr/lib64/libboost_system.so.1.53.0
7fcfffa58000-7fcfffa59000 r--p 00002000 fd:00 1774571 /usr/lib64/libboost_system.so.1.53.0
7fcfffa59000-7fcfffa5a000 rw-p 00003000 fd:00 1774571 /usr/lib64/libboost_system.so.1.53.0
7fcfffa5a000-7fcfffa6f000 r-xp 00000000 fd:00 1774578 /usr/lib64/libboost_filesystem.so.1.53.0
7fcfffa6f000-7fcfffc6f000 ---p 00015000 fd:00 1774578 /usr/lib64/libboost_filesystem.so.1.53.0
7fcfffc6f000-7fcfffc70000 r--p 00015000 fd:00 1774578 /usr/lib64/libboost_filesystem.so.1.53.0PHP Fatal error: Uncaught Error: Call to a member function make() on null in /www/wwwroot/test.com/vendor/topthink/think-swoole/src/concerns/InteractsWithPools.php:25
Stack trace:
#0 /www/wwwroot/test.com/vendor/topthink/think-swoole/src/concerns/InteractsWithPools.php(50): think\swoole\Manager->getPools()
#1 /www/wwwroot/test.com/vendor/topthink/framework/src/think/Container.php(292): think\swoole\Manager->think\swoole\concerns{closure}()
#2 /www/wwwroot/test.com/vendor/topthink/framework/src/think/Container.php(356): think\Container->invokeFunction(Object(Closure), Array)
#3 /www/wwwroot/test.com/vendor/topthink/framework/src/think/Event.php(260): think\Container->invoke(Object(Closure), Array)
#4 /www/wwwroot/test.com/vendor/topthink/framework/src/think/Event.php(221): think\Event->dispatch(Object(Closure), Array)
#5 /www/wwwroot/test.com/vendor/topthink/think-swoole/src/concerns/WithApplication.php(45): think\Event->trigger('swoole.workerEr...', Array)
#6 /www/wwwroot/test.com/vendor/topthink/think-swoole/src/concerns/In in /www/wwwroot/test.com/vendor/topthink/think-swoole/src/concerns/InteractsWithPools.php on line 25

[think\exception\ErrorException]
Uncaught Error: Call to a member function make() on null in /www/wwwroot/test.com/vendor/topthink/think-swoole/src/concerns/InteractsWithPools.php:25
Stack trace:
#0 /www/wwwroot/test.com/vendor/topthink/think-swoole/src/concerns/InteractsWithPools.php(50): think\swoole\Manager->getPools()
#1 /www/wwwroot/test.com/vendor/topthink/framework/src/think/Container.php(292): think\swoole\Manager->think\swoole\concerns{closure}()
#2 /www/wwwroot/test.com/vendor/topthink/framework/src/think/Container.php(356): think\Container->invokeFunction(Object(Closure), Array)
#3 /www/wwwroot/test.com/vendor/topthink/framework/src/think/Event.php(260): think\Container->invoke(Object(Closure), Array)
#4 /www/wwwroot/test.com/vendor/topthink/framework/src/think/Event.php(221): think\Event->dispatch(Object(Closure), Array)
#5 /www/wwwroot/test.com/vendor/topthink/think-swoole/src/concerns/WithApplication.php(45): think\Event->trigger('swoole.workerEr...', Array)
#6 /www/wwwroot/test.com/vendor/topthink/think-swoole/src/concerns/In

Exception trace:
() at /www/wwwroot/test.com/vendor/topthink/think-swoole/src/concerns/InteractsWithPools.php:25
think\initializer\Error->appShutdown() at n/a:n/a

Enable yasd cause some problem

I enable yasd extension.
I use php-cs-fixer in vscode then it will enter the debug mode like enter php -e test.php.
I think it is a bug.
Could you fix it!

Thank you very much^^

PS. I use phpbrew and ubuntu 18.04.
image
image

断点有问题

我 [设置了断点,但是用r就直接运行走了。。
在docker里面运行的fpm
image

mac php7.2.33 php -e bin/hyperf.php start 报错 86691 segmentation fault

➜ ~ php -v
PHP 7.2.33 (cli) (built: Aug 7 2020 18:28:03) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.33, Copyright (c) 1999-2018, by Zend Technologies
with Yasd v0.1.0, Our Copyright, by codinghuang

➜ ~ php --ri yasd

yasd

Yasd => enabled
Author => codinghuang [email protected]
Version => 0.1.0
Built => Dec 17 2020 17:35:30

Directive => Local Value => Master Value
yasd.breakpoints_file => no value => no value
yasd.debug_mode => remote => remote
yasd.remote_host => 127.0.0.1 => 127.0.0.1
yasd.remote_port => 9000 => 9000
yasd.depth => 1 => 1

执行
✗ php -e bin/hyperf.php start
[1] 86691 segmentation fault php -e bin/hyperf.php start

win10 wsl 环境 支持?

root@WIN-RJACNS8A7VM:/usr/local/php/etc# php --ri yasd

yasd

Yasd => enabled
Author => codinghuang <[email protected]>
Version => 0.2.7-alpha
Built => Dec 23 2020 18:11:44

Directive => Local Value => Master Value
yasd.breakpoints_file => no value => no value
yasd.debug_mode => remote => remote
yasd.remote_host => 127.0.0.1 => 127.0.0.1
yasd.remote_port => 8000 => 8000
yasd.depth => 1 => 1
yasd.log_level => -1 => -1

root@WIN-RJACNS8A7VM:/usr/local/php/etc# php -v
PHP 7.2.19 (cli) (built: Jun 23 2019 10:08:57) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Yasd v0.2.7-alpha, Our Copyright, by codinghuang

版本:wsl1

适用于 Linux 的 Windows 子系统:
Ubuntu-18.04 (默认)

启动 php -e t.php
PHPSTORM 报错:无法接受外部 Xdebug 连接: 无法评估表达式 'isset($_SERVER['PHP_IDE_CONFIG'])'

wsl2+docker 环境 下remote模式,开启调试 显示错误

环境 wsl2+docker

PHP 7.4.9 (cli) (built: Aug 6 2020 19:45:55) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Yasd v0.3.7, Our Copyright, by codinghuang

IDE: PHPSTORM

PHP ini 配置

[yasd]
yasd.debug_mode=remote
yasd.remote_host=host.docker.internal
yasd.remote_port=9000

进入目录执行调试
报了 Invalid address/ Address not supported: No error information 错误

/www/2021/mermber-center # php -e bin/hyperf.php start
Invalid address/ Address not supported: No error information

想请教一下,这个错误是指的是我哪个地方的地址配错了? 因为这个错误提示不是很明确,无法确定如何配置?

yasd如何使用

[xdebug]
zend_extension=xdebug.so
xdebug.remote_enable=1
xdebug.remote_autostart=1
xdebug.remote_host=192.168.1.134
xdebug.remote_port=9000
xdebug.idekey="xdebug"

类似这样设置idekey

在phpstorm中运行hyperf有提示过这种错误

[yasd] recv command error, connection closed
[2021-01-15 16:42:00 *25837.0] WARNING swSignal_callback (ERRNO 707): Unable to find callback function for signal Broken pipe: 13
[yasd] recv command error, Connection reset by peer
[2021-01-15 16:42:00 $25589.0] WARNING swManager_check_exit_status: worker#0[pid=25837] abnormal exit, status=0, signal=11
A bug occurred in Swoole-v4.5.2, please report it.
The Swoole developers probably don't know about it,
and unless you report it, chances are it won't be fixed.
You can read How to report a bug doc before submitting any bug reports:

https://github.com/swoole/swoole-src/blob/master/.github/ISSUE.md
Please do not send bug reports in the mailing list or personal letters.
The issue page is also suitable to submit feature requests.

Why it says that is supports phpstorm ide, when tests cases for phpstorm compatability fail

Please answer these questions before submitting your issue. Thanks!

  1. What did you do? If possible, provides a simple script and debug step to reproduce the problem.

make test

  1. What did you expect to see?

All passed

  1. What did you see instead?
Don't forget to run 'make test'.


=====================================================================
PHP         : /usr/local/Cellar/php/8.0.2/bin/php
PHP_SAPI    : cli
PHP_VERSION : 8.0.2
ZEND_VERSION: 4.0.2
PHP_OS      : Darwin - Darwin Linass-MacBook-Pro.local 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:07:06 PST 2021; root:xnu-7195.81.3~1/RELEASE_X86_64 x86_64
INI actual  : /Users/juslintek/yasd/tmp-php.ini
More .INIs  :
---------------------------------------------------------------------
PHP         : /usr/local/Cellar/php/8.0.2/bin/phpdbg
PHP_SAPI    : phpdbg
PHP_VERSION : 8.0.2
ZEND_VERSION: 4.0.2
PHP_OS      : Darwin - Darwin Linass-MacBook-Pro.local 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:07:06 PST 2021; root:xnu-7195.81.3~1/RELEASE_X86_64 x86_64
INI actual  : /Users/juslintek/yasd/tmp-php.ini
More .INIs  :
---------------------------------------------------------------------
CWD         : /Users/juslintek/yasd
Extra dirs  :
VALGRIND    : Not used
=====================================================================
TIME START 2021-02-22 09:43:21
=====================================================================
FAIL issue: 41 [tests/yasd_debugger/issue/41.phpt]
PASS opcode: getOpcodeByName [tests/yasd_debugger/opcode/getOpcodeByName.phpt]
FAIL remote_mode: breakpoint_list [tests/yasd_debugger/remote_mode/breakpoint_list.phpt]
FAIL remote_mode: breakpoint_set [tests/yasd_debugger/remote_mode/breakpoint_set/breakpoint_set.phpt]
TEST 5/20 [tests/yasd_debugger/remote_mode/breakpoint_set/breakpoint_set_conditiFAIL breakpoint_set: breakpoint_set_conditional_line [tests/yasd_debugger/remote_mode/breakpoint_set/breakpoint_set_conditional_line.phpt]
FAIL remote_mode: context_get [tests/yasd_debugger/remote_mode/context_get.phpt]
TEST 7/20 [tests/yasd_debugger/remote_mode/context_get/superglobal_variable.phptFAIL context_get: superglobal_variable [tests/yasd_debugger/remote_mode/context_get/superglobal_variable.phpt]
FAIL remote_mode: context_names [tests/yasd_debugger/remote_mode/context_names.phpt]
FAIL remote_mode: eval [tests/yasd_debugger/remote_mode/eval.phpt]
FAIL remote_mode: feature_set [tests/yasd_debugger/remote_mode/feature_set.phpt]
TEST 11/20 [tests/yasd_debugger/remote_mode/infinite_loop_detection/for_loop.phpFAIL infinite_loop_detection: for_loop [tests/yasd_debugger/remote_mode/infinite_loop_detection/for_loop.phpt]
TEST 12/20 [tests/yasd_debugger/remote_mode/infinite_loop_detection/goto_label_lFAIL infinite_loop_detection: goto_label_loop [tests/yasd_debugger/remote_mode/infinite_loop_detection/goto_label_loop.phpt]
TEST 13/20 [tests/yasd_debugger/remote_mode/phpstorm/compatible_with_phpstorm.phFAIL phpstorm: compatible_with_phpstorm [tests/yasd_debugger/remote_mode/phpstorm/compatible_with_phpstorm.phpt]
FAIL phpstorm: eval [tests/yasd_debugger/remote_mode/phpstorm/eval.phpt]
TEST 15/20 [tests/yasd_debugger/remote_mode/property_get/classnamme_array_key.phFAIL property_get: classnamme_array_key [tests/yasd_debugger/remote_mode/property_get/classnamme_array_key.phpt]
TEST 16/20 [tests/yasd_debugger/remote_mode/property_get/nmerical_index_array.phFAIL property_get: nmerical_index_array [tests/yasd_debugger/remote_mode/property_get/nmerical_index_array.phpt]
FAIL remote_mode: stack_get [tests/yasd_debugger/remote_mode/stack_get.phpt]
FAIL remote_mode: stdout [tests/yasd_debugger/remote_mode/stdout.phpt]
FAIL remote_mode: stop [tests/yasd_debugger/remote_mode/stop.phpt]
PASS zval: getRefCount [tests/yasd_debugger/zval/getRefCount.phpt]
=====================================================================
TIME END 2021-02-22 09:43:22

=====================================================================
TEST RESULT SUMMARY
---------------------------------------------------------------------
Exts skipped    :    0
Exts tested     :   64
---------------------------------------------------------------------

Number of tests :   20                20
Tests skipped   :    0 (  0.0%) --------
Tests warned    :    0 (  0.0%) (  0.0%)
Tests failed    :   18 ( 90.0%) ( 90.0%)
Tests passed    :    2 ( 10.0%) ( 10.0%)
---------------------------------------------------------------------
Time taken      :    1 seconds
=====================================================================

=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
issue: 41 [tests/yasd_debugger/issue/41.phpt]
remote_mode: breakpoint_list [tests/yasd_debugger/remote_mode/breakpoint_list.phpt]
remote_mode: breakpoint_set [tests/yasd_debugger/remote_mode/breakpoint_set/breakpoint_set.phpt]
breakpoint_set: breakpoint_set_conditional_line [tests/yasd_debugger/remote_mode/breakpoint_set/breakpoint_set_conditional_line.phpt]
remote_mode: context_get [tests/yasd_debugger/remote_mode/context_get.phpt]
context_get: superglobal_variable [tests/yasd_debugger/remote_mode/context_get/superglobal_variable.phpt]
remote_mode: context_names [tests/yasd_debugger/remote_mode/context_names.phpt]
remote_mode: eval [tests/yasd_debugger/remote_mode/eval.phpt]
remote_mode: feature_set [tests/yasd_debugger/remote_mode/feature_set.phpt]
infinite_loop_detection: for_loop [tests/yasd_debugger/remote_mode/infinite_loop_detection/for_loop.phpt]
infinite_loop_detection: goto_label_loop [tests/yasd_debugger/remote_mode/infinite_loop_detection/goto_label_loop.phpt]
phpstorm: compatible_with_phpstorm [tests/yasd_debugger/remote_mode/phpstorm/compatible_with_phpstorm.phpt]
phpstorm: eval [tests/yasd_debugger/remote_mode/phpstorm/eval.phpt]
property_get: classnamme_array_key [tests/yasd_debugger/remote_mode/property_get/classnamme_array_key.phpt]
property_get: nmerical_index_array [tests/yasd_debugger/remote_mode/property_get/nmerical_index_array.phpt]
remote_mode: stack_get [tests/yasd_debugger/remote_mode/stack_get.phpt]
remote_mode: stdout [tests/yasd_debugger/remote_mode/stdout.phpt]
remote_mode: stop [tests/yasd_debugger/remote_mode/stop.phpt]
=====================================================================

You may have found a problem in PHP.
This report can be automatically sent to the PHP QA team at
http://qa.php.net/reports and http://news.php.net/php.qa.reports
This gives us a better understanding of PHP's behavior.
If you don't want to send the report immediately you can choose
option "s" to save it.	You can then email it to qa-reports@lists.php.net later.
Do you want to send this report now? [Yns]: Y

Please enter your email address.
(Your address will be mangled so that it will not go out on any
mailinglist in plain text): jusys.linas@gmail.com

Posting to http://qa.php.net/buildtest-process.php

Thank you for helping to make PHP better.
make: *** [test] Error 1
  1. What is your machine environment used (show your uname -a & php -v & gcc -v) ?
    uname -a
Darwin Linass-MacBook-Pro.local 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:07:06 PST 2021; root:xnu-7195.81.3~1/RELEASE_X86_64 x86_64

php -v

PHP 8.0.2 (cli) (built: Feb  4 2021 18:57:55) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.2, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.2, Copyright (c), by Zend Technologies

gcc - v

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.0 (clang-1200.0.32.29)
Target: x86_64-apple-darwin20.3.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Unable to connect using VSCode

The installation is done

I'm using laravel-s on a containerized environment.

image

zend_extension=yasd
yasd.debug_mode=remote
yasd.remote_host=127.0.0.1
yasd.remote_port=9000

but not connecting on VsCode

image

Originally posted by @juberjj in #78 (comment)

A bug occurred in Swoole-v4.5.9

Please answer these questions before submitting your issue. Thanks!

  1. What did you do? If possible, provides a simple script and debug step to reproduce the problem.

[2020-12-09 22:20:37 $61715.0] WARNING wait: worker#0 abnormal exit, status=0, signal=11
A bug occurred in Swoole-v4.5.9, please report it.
The Swoole developers probably don't know about it,
and unless you report it, chances are it won't be fixed.
You can read How to report a bug doc before submitting any bug reports:

https://github.com/swoole/swoole-src/blob/master/.github/ISSUE.md
Please do not send bug reports in the mailing list or personal letters.
The issue page is also suitable to submit feature requests.

image
image

[yasd] Connection refused

Please answer these questions before submitting your issue. Thanks!

  1. What did you do? If possible, provides a simple script and debug step to reproduce the problem.
    php -e bin/hyperf.php start 提示
    [yasd] Connection refused

image

  1. What did you expect to see?

  2. What did you see instead?

image

  1. What is your machine environment used (show your uname -a & php -v & gcc -v) ?

image

WARNING check_worker_exit_status: worker#27[pid=2546428] abnormal exit, status=0, signal=11

[2020-12-31 11:29:00 $2545105.0] WARNING check_worker_exit_status: worker#27[pid=2546428] abnormal exit, status=0, signal=11
A bug occurred in Swoole-v4.5.9, please report it.
The Swoole developers probably don't know about it,
and unless you report it, chances are it won't be fixed.
You can read How to report a bug doc before submitting any bug reports:

https://github.com/swoole/swoole-src/blob/master/.github/ISSUE.md
Please do not send bug reports in the mailing list or personal letters.
The issue page is also suitable to submit feature requests.

用yasd调试启动2.0的时候会有以上报错

是否支持 Mac M1

我安装完后,
php -v 的报错如下 :
PHP Warning: Failed loading Zend extension 'yasd' (tried: /usr/local/lib/php/pecl/20190902/yasd (dlopen(/usr/local/lib/php/pecl/20190902/yasd, 9): image not found), /usr/local/lib/php/pecl/20190902/yasd.so (dlopen(/usr/local/lib/php/pecl/20190902/yasd.so, 9): no suitable image found. Did find:
/usr/local/lib/php/pecl/20190902/yasd.so: mach-o, but wrong architecture
/usr/local/lib/php/pecl/20190902/yasd.so: mach-o, but wrong architecture)) in Unknown on line 0

Warning: Failed loading Zend extension 'yasd' (tried: /usr/local/lib/php/pecl/20190902/yasd (dlopen(/usr/local/lib/php/pecl/20190902/yasd, 9): image not found), /usr/local/lib/php/pecl/20190902/yasd.so (dlopen(/usr/local/lib/php/pecl/20190902/yasd.so, 9): no suitable image found. Did find:
/usr/local/lib/php/pecl/20190902/yasd.so: mach-o, but wrong architecture
/usr/local/lib/php/pecl/20190902/yasd.so: mach-o, but wrong architecture)) in Unknown on line 0
PHP 7.4.13 (cli) (built: Nov 30 2020 14:57:43) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.13, Copyright (c), by Zend Technologies

其他扩展都可以安装使用,如swoole,redis等
系统版本为 macOS Big Sur

vscode breakpoint doesn't work under wsl2

Please answer these questions before submitting your issue. Thanks!

  1. What did you do? If possible, provides a simple script and debug step to reproduce the problem.

After setting breakpoint and starting debugging (F5) under VS Code, I enter php -e test.php under wsl2, and nothing happened.

  1. What did you expect to see?
    The breakpoint should normally work, just like this video - 在IDE中使用yasd调试器.

  2. What did you see instead?
    Breakpoint doesn't work on vscode.
    image

  3. What is your machine environment used (show your uname -a & php -v & gcc -v) ?

Linux xxxxxxx 5.4.72-microsoft-standard-WSL2 #1 SMP xxxxxxxx x86_64 x86_64 x86_64 GNU/Linux
PHP 7.4.3 (cli) (built: Oct  6 2020 15:47:56) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Yasd v0.3.7, Our Copyright, by codinghuang
    with Zend OPcache v7.4.3, Copyright (c), by Zend Technologies
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.3.0-17ubuntu1~20.04' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-HskZEa/gcc-9-9.3.0/debian/tmp-nvptx/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)

And here's my launch.json
image

(cli) php.ini
image

php --ri yasd
image

Yasd is not breaking on consecutive requests on the same process

Please answer these questions before submitting your issue. Thanks!

  1. What did you do? If possible, provides a simple script and debug step to reproduce the problem.

swoole/swoole-src#4166 (comment)

  1. What did you expect to see?

I expect YASD to break on consecutive requests on the same process

  1. What did you see instead?

It breaks only when I first restart the swoole process, but not on the request, just initial boot code...

  1. What is your machine environment used (show your uname -a & php -v & gcc -v) ?
uname -a
Linux 1d132e96384b 5.10.25-linuxkit #1 SMP Tue Mar 23 09:27:39 UTC 2021 x86_64 Linux
 php -v
PHP 7.4.15 (cli) (built: Feb 18 2021 00:45:01) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Yasd v0.3.7, Our Copyright, by codinghuang
gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-alpine-linux-musl/10.2.1/lto-wrapper
Target: x86_64-alpine-linux-musl
Configured with: /home/buildozer/aports/main/gcc/src/gcc-10.2.1_pre1/configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --build=x86_64-alpine-linux-musl --host=x86_64-alpine-linux-musl --target=x86_64-alpine-linux-musl --with-pkgversion='Alpine 10.2.1_pre1' --enable-checking=release --disable-fixed-point --disable-libstdcxx-pch --disable-multilib --disable-nls --disable-werror --disable-symvers --enable-__cxa_atexit --enable-default-pie --enable-default-ssp --enable-cloog-backend --enable-languages=c,c++,d,objc,go,fortran,ada --disable-libssp --disable-libmpx --disable-libmudflap --disable-libsanitizer --enable-shared --enable-threads --enable-tls --with-system-zlib --with-linker-hash-style=gnu
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.2.1 20201203 (Alpine 10.2.1_pre1) 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.