Re: how to debug a php script ( the C code beneath it)
| From: | Rasmus Lerdorf | Date: | Tue, 14 Feb 2012 17:28:39 +0000 |
| Subject: | Re: how to debug a php script ( the C code beneath it) | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-57876@lists.php.net to get a copy of this message | ||
On 02/14/2012 09:22 AM, Adi Mutu wrote:
> Thanks Julien....
>
> I don't know french, but i'll read it using google translate:)
If you just want to see some of the function calls, most calls that are
visible in userspace are prefixed with "zif_" internally.
eg.
% gdb sapi/cli/php
GNU gdb (Ubuntu/Linaro 7.3-0ubuntu2) 7.3-2011.08
...
(gdb) b zif_strlen
Breakpoint 1 at 0x7b2760: file
/home/rasmus/php-src/branches/PHP_5_3/Zend/zend_builtin_functions.c,
line 455.
(gdb) run -r 'echo strlen("123");'
Breakpoint 1, zif_strlen (ht=1, return_value=0x1200eb0,
return_value_ptr=0x0, this_ptr=0x0, return_value_used=1)
at
/home/rasmus/php-src/branches/PHP_5_3/Zend/zend_builtin_functions.c:455
455 {
(gdb) l
450
451
452 /* {{{ proto int strlen(string str)
453 Get string length */
454 ZEND_FUNCTION(strlen)
455 {
456 char *s1;
457 int s1_len;
-Rasmus