Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:57878 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 23216 invoked from network); 14 Feb 2012 17:51:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Feb 2012 17:51:12 -0000 Authentication-Results: pb1.pair.com smtp.mail=adi_mutu06@yahoo.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=adi_mutu06@yahoo.com; sender-id=unknown; domainkeys=good Received-SPF: error (pb1.pair.com: domain yahoo.com from 98.139.91.236 cause and error) DomainKey-Status: good X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: adi_mutu06@yahoo.com X-Host-Fingerprint: 98.139.91.236 nm29-vm0.bullet.mail.sp2.yahoo.com Received: from [98.139.91.236] ([98.139.91.236:48741] helo=nm29-vm0.bullet.mail.sp2.yahoo.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0D/B5-26615-E0F9A3F4 for ; Tue, 14 Feb 2012 12:51:11 -0500 Received: from [98.139.91.63] by nm29.bullet.mail.sp2.yahoo.com with NNFMP; 14 Feb 2012 17:51:08 -0000 Received: from [98.139.91.32] by tm3.bullet.mail.sp2.yahoo.com with NNFMP; 14 Feb 2012 17:51:07 -0000 Received: from [127.0.0.1] by omp1032.mail.sp2.yahoo.com with NNFMP; 14 Feb 2012 17:51:07 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 978122.92773.bm@omp1032.mail.sp2.yahoo.com Received: (qmail 45658 invoked by uid 60001); 14 Feb 2012 17:51:07 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1329241867; bh=A+4yafqUE/1XOwDpTzr1UvclF7CGy5mOZNnwJ8//mKc=; h=X-YMail-OSG:Received:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=UadBjEJ4A4eF2ue9C3MiIDHC0576YodFNeN3PXOYEbCpzjBahoWUzWf4H5o14qE8kxtOw72cUEFMmek9ou21cMnAyrepveeEbdRPZi2IEzqjz5Oi3/UzVS9T4D1gpgbBsNHONzkp3zOAoWO57Quy0d/HtXJIfG4RVlxcAwFWrUo= DomainKey-Signature:a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=TI3l8TL6oSCsTNk3QEc/XCIIftmZuLszfCy7uQIj1A7wiCmfsdEjB4T95ZofbxuSwG0crYcmyk8uNn1TlYnCg94VpRf9xTBrzmFRq33JhPWvQN20KIwIq0/kg1OMvYyn80BE7Eg71+VHHIh+69azCE7Id+/OdDCnnbCo5ssDSgY=; X-YMail-OSG: ia6IAJYVM1nH4JwL8lvbhEbQlYGFxlEls7pzhiTqqECeP7W oG7uYL64p0p3r664.xQxoZW32ClQQsiaiFCAmI.SUMx9VoLRdpMF8Jyt._6D oY7MorEpsEfidXP.xYm7L.IS8HUVdgfcqkA7Fj9mOz0Ul.iQERqiZawcJT5P Z0G38_ptwZCEWzU6A5KUAgob5qcymj.xWFof.jV6UARq5kl4jECwjpf5_iJI 34.pT14MPYgjK147FbBhv1DQDvrO1mI7sPMwF_YqkXNk2tj.Co4UdFRRWSVs DaVL2xWW.RJ8xKljAyevu9V5IHDzEfj3BCcaFUQC482C1oSmfu12a63qhouY r_GruDbHruSi_WaLZjdZp6Y88P4Do5aqAcxz02R0lvTtm9szp9a.RLGwWc_w 5tqc21_VCngqUp6XeOqpnhB7jLXlql11SL6uqsSedvY2Ck6XUcfKnM6eOjnv 6o5cdGfuG4rxP.ntXgWz9jw-- Received: from [92.80.21.12] by web43515.mail.sp1.yahoo.com via HTTP; Tue, 14 Feb 2012 09:51:07 PST X-Mailer: YahooMailWebService/0.8.116.338427 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> Message-ID: <1329241867.44228.YahooMailNeo@web43515.mail.sp1.yahoo.com> Date: Tue, 14 Feb 2012 09:51:07 -0800 (PST) Reply-To: Adi Mutu To: jpauli , Rasmus Lerdorf Cc: PHP Developers Mailing List In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="-1092920792-1290025510-1329241867=:44228" Subject: Re: [PHP-DEV] how to debug a php script ( the C code beneath it) From: adi_mutu06@yahoo.com (Adi Mutu) ---1092920792-1290025510-1329241867=:44228 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable =0A=0AI know about the zif_* functions and i'm already using lxr.php.net.= =0ADidn't know about Gcc -e trick though, that might be usefull.=0A=0AThank= s.=0A=0A=0A________________________________=0A From: jpauli =0ATo: Rasmus Lerdorf =0ACc: Adi Mutu ; PHP Developers Mailing List =0ASent: Tuesday= , February 14, 2012 7:36 PM=0ASubject: Re: [PHP-DEV] how to debug a php scr= ipt ( the C code beneath it)=0A =0AOn Tue, Feb 14, 2012 at 6:28 PM, Rasmus = Lerdorf wrote:=0A=0A> On 02/14/2012 09:22 AM, Adi Mutu wro= te:=0A> > Thanks Julien....=0A> >=0A> > I don't know french, but i'll read = it using google translate:)=0A>=0A> If you just want to see some of the fun= ction calls, most calls that are=0A> visible in userspace are prefixed with= "zif_" internally.=0A>=0A> eg.=0A>=0A> % gdb sapi/cli/php=0A> GNU gdb (Ubu= ntu/Linaro 7.3-0ubuntu2) 7.3-2011.08=0A> ...=0A> (gdb) b zif_strlen=0A> Bre= akpoint 1 at 0x7b2760: file=0A> /home/rasmus/php-src/branches/PHP_5_3/Zend/= zend_builtin_functions.c,=0A> line 455.=0A> (gdb) run -r 'echo strlen("123"= );'=0A> Breakpoint 1, zif_strlen (ht=3D1, return_value=3D0x1200eb0,=0A> ret= urn_value_ptr=3D0x0, this_ptr=3D0x0, return_value_used=3D1)=0A>=A0 =A0 at= =0A> /home/rasmus/php-src/branches/PHP_5_3/Zend/zend_builtin_functions.c:45= 5=0A> 455=A0 =A0 {=0A> (gdb) l=0A> 450=0A> 451=0A> 452=A0 =A0 /* {{{ prot= o int strlen(string str)=0A> 453=A0 =A0 =A0 =A0 Get string length */=0A> 45= 4=A0 =A0 ZEND_FUNCTION(strlen)=0A> 455=A0 =A0 {=0A> 456=A0 =A0 =A0 =A0 = =A0 =A0 char *s1;=0A> 457=A0 =A0 =A0 =A0 =A0 =A0 int s1_len;=0A>=0A> -Ras= mus=0A>=0A> --=0A> PHP Internals - PHP Runtime Development Mailing List=0A>= To unsubscribe, visit: http://www.php.net/unsub.php=0A>=0A>=0AYeah, that's= the PHP_FUNCTION() macro. 'zif' meaning "Zend Internal=0AFunction".=0AOne = more step would be to read the preprocessed code (GCC -E), as PHP=0Asource = heavily uses macros=0A=0AIf you want, you can also read the source code onl= ine using the excellent=0Ahttp://lxr.php.net :)=0A=0AJulien.P ---1092920792-1290025510-1329241867=:44228--