Re: debugging php
| From: | Christoph M. Becker | Date: | Fri, 19 Jan 2018 00:27:47 +0000 |
| Subject: | Re: debugging php | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-101624@lists.php.net to get a copy of this message | ||
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/libthread_db.so.1".
>
> then gdb freezes at this point (/lib64/libthread_db.so.1).
>
> 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. <https://externals.io/message/101603>)
for whatever reason.
--
Christoph M. Becker