Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:57877 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 20827 invoked from network); 14 Feb 2012 17:36:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Feb 2012 17:36:49 -0000 Authentication-Results: pb1.pair.com header.from=julienpauli@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=julienpauli@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.83.42 as permitted sender) X-PHP-List-Original-Sender: julienpauli@gmail.com X-Host-Fingerprint: 74.125.83.42 mail-ee0-f42.google.com Received: from [74.125.83.42] ([74.125.83.42:63440] helo=mail-ee0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C8/45-26615-0BB9A3F4 for ; Tue, 14 Feb 2012 12:36:49 -0500 Received: by eeke49 with SMTP id e49so75457eek.29 for ; Tue, 14 Feb 2012 09:36:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=7Clkag/Em/V+24mUfxP41CJN4628mXSPUR0N+LYF7UU=; b=OcMvbPRMAIPeAzoh1o95JeToarChFaM2bt2+B1Hgc/bupPWnBtj7+2DeNPo9yNr8DW uPidbi/zzMPuj+2iFiHqUKlckx2djtrsHCaE5L8ebDH+2ctwnAlWbqhK7LiyVfMX3mqI NLbOpzhsXp8V6Dn9SRJ2tsMgW9GIOu0kcJ8i0= Received: by 10.14.125.14 with SMTP id y14mr6999511eeh.128.1329241005447; Tue, 14 Feb 2012 09:36:45 -0800 (PST) MIME-Version: 1.0 Sender: julienpauli@gmail.com Received: by 10.213.4.9 with HTTP; Tue, 14 Feb 2012 09:36:05 -0800 (PST) In-Reply-To: <4F3A99C7.2060300@php.net> References: <1329166139.76210.YahooMailNeo@web43506.mail.sp1.yahoo.com> <4F399898.6060500@gmail.com> <1329205034.87613.YahooMailNeo@web43515.mail.sp1.yahoo.com> <1329240159.5958.YahooMailNeo@web43516.mail.sp1.yahoo.com> <4F3A99C7.2060300@php.net> Date: Tue, 14 Feb 2012 18:36:05 +0100 X-Google-Sender-Auth: mPET-_oEj_QnjC7DyBcgv-5Jorc Message-ID: To: Rasmus Lerdorf Cc: Adi Mutu , PHP Developers Mailing List Content-Type: multipart/alternative; boundary=e0cb4e70043ff359d804b8f00949 Subject: Re: [PHP-DEV] how to debug a php script ( the C code beneath it) From: jpauli@php.net (jpauli) --e0cb4e70043ff359d804b8f00949 Content-Type: text/plain; charset=ISO-8859-1 On Tue, Feb 14, 2012 at 6:28 PM, Rasmus Lerdorf wrote: > 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 > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > Yeah, that's the PHP_FUNCTION() macro. 'zif' meaning "Zend Internal Function". One more step would be to read the preprocessed code (GCC -E), as PHP source heavily uses macros If you want, you can also read the source code online using the excellent http://lxr.php.net :) Julien.P --e0cb4e70043ff359d804b8f00949--