Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:57879 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 24905 invoked from network); 14 Feb 2012 17:58:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Feb 2012 17:58:11 -0000 Authentication-Results: pb1.pair.com header.from=adi_mutu06@yahoo.com; sender-id=unknown; domainkeys=good Authentication-Results: pb1.pair.com smtp.mail=adi_mutu06@yahoo.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain yahoo.com from 98.139.91.78 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.78 nm8.bullet.mail.sp2.yahoo.com Received: from [98.139.91.78] ([98.139.91.78:30181] helo=nm8.bullet.mail.sp2.yahoo.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FC/16-26615-2B0AA3F4 for ; Tue, 14 Feb 2012 12:58:11 -0500 Received: from [98.139.91.63] by nm8.bullet.mail.sp2.yahoo.com with NNFMP; 14 Feb 2012 17:58:08 -0000 Received: from [98.139.91.42] by tm3.bullet.mail.sp2.yahoo.com with NNFMP; 14 Feb 2012 17:58:08 -0000 Received: from [127.0.0.1] by omp1042.mail.sp2.yahoo.com with NNFMP; 14 Feb 2012 17:58:08 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 387977.13138.bm@omp1042.mail.sp2.yahoo.com Received: (qmail 43041 invoked by uid 60001); 14 Feb 2012 17:58:08 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1329242288; bh=duCgzgU3CBDy+xRcr3wiBgvA7KsefhA0NSJ6wdKZEFM=; 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=ceyvQmZfrWCwqR9WDYyS2kooc+Fd6WDZwY8QCeQg8dmv8InI1dg+qUl7cqa2ZcXcRDjo/IPUZob3gecPPLpx2cr38Xka+PSfWM8V0ab1hUniK4S7RC2Py2utdfbFw0drki6nFouVNmQv6CRe8J4ewDZVvR3WMjMCCFLW08f0x5o= 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=RKulyyEEWgeJxUCgcmkZegoN2WAD9MZZoz2VMUt998FEOycLc+Cn1tnEwbznwELxubyvmLB++ieHIW7PAD2u2Qj07Xl0w00plhhXrECUwyuvkHjIIioco1hH1JBeX9DzokdpAVvCULWx2iTVf+PHEhN8hEf8SYojIugJkBhxy3k=; X-YMail-OSG: 9BP69MUVM1n9j_vqvVYQfR5O026WLw3oq.D6qjIyC.2wpX3 Zyl_RQrsiBrNVefPaLPLw_xV7WHsD7uiDYBSZW.zylyFmHWb9Z5aDL6IaKXY X7NKkbdjJExWHozFLvE2lpZEEKxj7ZvjFOJX0GAnZ5.gjJLyoGOCv_sv2fOH KJSgPmHpknHhHy.mLxWT9pFpajs1J4WNCnBBE1QSRDd4D5ig3uTEEOXNVaRT 9PVUpjO9C9fEjLlKbTpnWfl6Gg1QJZNss4VQwW.zW0DZdTLWBSu4HiyO5Fv_ 1dtVbSEvnEfX1a.pzv6RosRUkXfkpXo1eiMb55GiOeiwTK7LqPHmIL1B8DEu Is7HZ._zTq7a.noNajNaq.ZNsD6nKTZOTp_sBprkiB6etOkkeOWBsFWuLSEv 40wDCFl7PwbAfoc1R3iHU3o9ePVRmnK9FzzNHrsnqgL65uidHD4tLpOY6ED0 9Q.kXs7ZK3JxGGqw7hfxno7UnFMeLDZiRuMTUoDZsGLYyXhIDs4OOcOBq7w- - Received: from [92.80.21.12] by web43513.mail.sp1.yahoo.com via HTTP; Tue, 14 Feb 2012 09:58:08 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: <1329242288.17151.YahooMailNeo@web43513.mail.sp1.yahoo.com> Date: Tue, 14 Feb 2012 09:58:08 -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="-1674091793-308407055-1329242288=:17151" Subject: Re: [PHP-DEV] how to debug a php script ( the C code beneath it) From: adi_mutu06@yahoo.com (Adi Mutu) ---1674091793-308407055-1329242288=:17151 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable I 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=0AThanks.=0A=0A= =0A________________________________=0A From: jpauli =0ATo: = Rasmus Lerdorf =0ACc: Adi Mutu ; PHP= Developers Mailing List =0ASent: Tuesday, Februa= ry 14, 2012 7:36 PM=0ASubject: Re: [PHP-DEV] how to debug a php script ( th= e C code beneath it)=0A =0A=0AOn Tue, Feb 14, 2012 at 6:28 PM, Rasmus Lerdo= rf wrote:=0A=0AOn 02/14/2012 09:22 AM, Adi Mutu wrote:=0A>= > Thanks Julien....=0A>>=0A>> I don't know french, but i'll read it using g= oogle translate:)=0A>=0A>If you just want to see some of the function calls= , most calls that are=0A>visible in userspace are prefixed with "zif_" inte= rnally.=0A>=0A>eg.=0A>=0A>% gdb sapi/cli/php=0A>GNU gdb (Ubuntu/Linaro 7.3-= 0ubuntu2) 7.3-2011.08=0A>...=0A>(gdb) b zif_strlen=0A>Breakpoint 1 at 0x7b2= 760: file=0A>/home/rasmus/php-src/branches/PHP_5_3/Zend/zend_builtin_functi= ons.c,=0A>line 455.=0A>(gdb) run -r 'echo strlen("123");'=0A>Breakpoint 1, = zif_strlen (ht=3D1, return_value=3D0x1200eb0,=0A>return_value_ptr=3D0x0, th= is_ptr=3D0x0, return_value_used=3D1)=0A>=A0 =A0at=0A>/home/rasmus/php-src/b= ranches/PHP_5_3/Zend/zend_builtin_functions.c:455=0A>455 =A0 =A0 {=0A>(gdb)= l=0A>450=0A>451=0A>452 =A0 =A0 /* {{{ proto int strlen(string str)=0A>453 = =A0 =A0 =A0 =A0Get string length */=0A>454 =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>-Rasmus=0A>=0A>=0A>--=0A>PHP Internals - PHP= Runtime Development Mailing List=0A>To unsubscribe, visit: http://www.php.= net/unsub.php=0A>=0A>=0A=0AYeah, that's the PHP_FUNCTION() macro. 'zif' mea= ning "Zend Internal Function".=0AOne more step would be to read the preproc= essed code (GCC -E), as PHP source=A0heavily=A0uses macros=0A=0AIf you want= , you can also read the source code online using the excellent http://lxr.p= hp.net :)=0A=0AJulien.P ---1674091793-308407055-1329242288=:17151--