The problem is this, I want to debug the PHP kernel to see the specific file calls, the general call structure itself probably know, but the specific do not know how to easily debug
My current approach is to manually php_printf some information, and then recompile PHP to see if this is the right step, but it takes a long time to recompile.
So I want to ask you there is no good way to debug!
Reply content:
The problem is this, I want to debug the PHP kernel to see the specific file calls, the general call structure itself probably know, but the specific do not know how to easily debug
My current approach is to manually php_printf some information, and then recompile PHP to see if this is the right step, but it takes a long time to recompile.
So I want to ask you there is no good way to debug!
Strace
phpadd in the compile time configure --enable-debug php to open debugging mode, when compiled php with debugging information, you can debug by gdb the breakpoint. I don't know if this is going to meet your needs?
I don't know what IDE you're using, I'm just introducing my experience. I developed the PHP extension use CLion , using the debug mode of PHP, in the clion directly using the GCC compiler extension run, breakpoints can be directly in the compiler, debugging run, stepping is normal use. If the source code of PHP is still retained, you can hit the breakpoint directly into the source code. Compile to start debugging one step.