Re: [PHP-DEV] debugging php

January 19, 2018 00:27 ("Christoph M. Becker")
On 18.01.2018 at 20:22, Sam Ding wrote:

> "gdb" seems not support php code. > > I run gdb like follows: > > # gdb ../sapi/cli/php > GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-80.el7 > Copyright (C) 2013 Free Software Foundation, Inc. > ... > Reading symbols from /home/work/php/php-src/sapi/cli/php...done. > (gdb) b bug72300.php:5 > No source file named bug72300.php. > Make breakpoint pending on future shared library load? (y or [n]) y > Breakpoint 1 (bug72300.php:5) pending. > (gdb) r > Starting program: /home/work/php/php-src/case/../sapi/cli/php > [Thread debugging using libthread_db enabled] > Using host libthread_db library "/lib64/". > > then gdb freezes at this point (/lib64/ > > How to set break point in php and then step by step go into C code?
As far as I know, this is not possible. You can, however, set a breakpoint for a certain PHP function (just preprend `zif_` to the PHP function name; in this case do `b zif_ignore_user_abort`). To actually start the debugging, do something like `r ext/standard/tests/general_functions/bug72300.php`. Most likely, there are more elegant ways to do this, but I don't know them. BTW: it seems that your latest mails didn't make it to the list (see e.g. <>) for whatever reason. -- Christoph M. Becker