Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:57876 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 19258 invoked from network); 14 Feb 2012 17:28:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Feb 2012 17:28:45 -0000 Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lerdorf.com from 209.85.214.170 cause and error) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 209.85.214.170 mail-tul01m020-f170.google.com Received: from [209.85.214.170] ([209.85.214.170:56132] helo=mail-tul01m020-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E6/F4-26615-DC99A3F4 for ; Tue, 14 Feb 2012 12:28:45 -0500 Received: by obbup3 with SMTP id up3so222988obb.29 for ; Tue, 14 Feb 2012 09:28:42 -0800 (PST) Received: by 10.50.203.33 with SMTP id kn1mr21419500igc.1.1329240522109; Tue, 14 Feb 2012 09:28:42 -0800 (PST) Received: from [192.168.200.5] (c-50-131-44-225.hsd1.ca.comcast.net. [50.131.44.225]) by mx.google.com with ESMTPS id b6sm49774igj.7.2012.02.14.09.28.41 (version=SSLv3 cipher=OTHER); Tue, 14 Feb 2012 09:28:41 -0800 (PST) Sender: Rasmus Lerdorf Message-ID: <4F3A99C7.2060300@php.net> Date: Tue, 14 Feb 2012 09:28:39 -0800 Organization: PHP Development Team User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111229 Thunderbird/9.0 MIME-Version: 1.0 To: Adi Mutu CC: PHP Developers Mailing List 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> In-Reply-To: <1329240159.5958.YahooMailNeo@web43516.mail.sp1.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQk2Gfjhwh8+MJWxFnv+I4yC91598E4F/kxOjPUYdY5G227dUJjdnSeCdf/jgRUk/UliaPaC Subject: Re: [PHP-DEV] how to debug a php script ( the C code beneath it) From: rasmus@php.net (Rasmus Lerdorf) 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