Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:57855 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 51979 invoked from network); 14 Feb 2012 09:18:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Feb 2012 09:18:09 -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 209.85.215.170 as permitted sender) X-PHP-List-Original-Sender: julienpauli@gmail.com X-Host-Fingerprint: 209.85.215.170 mail-ey0-f170.google.com Received: from [209.85.215.170] ([209.85.215.170:42305] helo=mail-ey0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 31/40-49308-FC62A3F4 for ; Tue, 14 Feb 2012 04:18:08 -0500 Received: by eaal11 with SMTP id l11so1880729eaa.29 for ; Tue, 14 Feb 2012 01:18:04 -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=/b8vp1MARi4VHxQxh0UzlPkvQ2XeN/KPLon8mqNtsmY=; b=NTzCwuDDluGefMmKfHbVoQ5JOArOJNkWtkR9rPWS71hDxaYSyVfo7NMjMXJMJ/7nvc zmyRu4UuXufusDUfOGGCs1Htt1oGmSlh/R5GkrDdCFuWMot4zp6Qfu5J2bvV8HHQNyet Iyf7mMne8CNwF8l3UYrDU76dzkbtg9cyyqwSo= Received: by 10.213.33.12 with SMTP id f12mr303676ebd.57.1329211084323; Tue, 14 Feb 2012 01:18:04 -0800 (PST) MIME-Version: 1.0 Sender: julienpauli@gmail.com Received: by 10.213.4.9 with HTTP; Tue, 14 Feb 2012 01:17:24 -0800 (PST) In-Reply-To: <1329205034.87613.YahooMailNeo@web43515.mail.sp1.yahoo.com> References: <1329166139.76210.YahooMailNeo@web43506.mail.sp1.yahoo.com> <4F399898.6060500@gmail.com> <1329205034.87613.YahooMailNeo@web43515.mail.sp1.yahoo.com> Date: Tue, 14 Feb 2012 10:17:24 +0100 X-Google-Sender-Auth: 0U96ohkTSUWwDzVOop6C5Tfr4sk Message-ID: To: Adi Mutu Cc: =?ISO-8859-1?Q?=C1ngel_Gonz=E1lez?= , PHP Developers Mailing List Content-Type: multipart/alternative; boundary=0015174be872833c5804b8e91287 Subject: Re: [PHP-DEV] how to debug a php script ( the C code beneath it) From: jpauli@php.net (jpauli) --0015174be872833c5804b8e91287 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 2012/2/14 Adi Mutu > Perhaps i didn't explain correctly, my bad, sorry. > Basically what I want to see is the corresponding C code which is > executed, i could put a break in gdb, but how do I know at which C functi= on > to put it, if i don't know the internals of php very good? > And the answer is : you cant. Simply put, you have to study the code first, before knowing through which line it will go. That's not very easy, as you can count on ~800.000 lines in trunk. To see the path, use valgrind + callgrind. You'll get a very cool graph like this : http://julien-pauli.developpez.com/tutoriels/php/internals/presentation/ima= ges/PHPInternals-callgraph.png You could use gdb with the .gdbinit from trunk. Using it with CDT is much more cool as it is GUI. I wrote some article about PHP internals, mainly describing how it works. It's in french ( http://julien-pauli.developpez.com/tutoriels/php/internals/presentation) with some schema. Mainly, the hardest part is ZendVM. If you dont have to debug ZendVM, it's kinda "easy" and logic. Cheers Julien.Pauli > > ________________________________ > From: =C1ngel Gonz=E1lez > To: Adi Mutu > Cc: PHP Developers Mailing List > Sent: Tuesday, February 14, 2012 1:11 AM > Subject: Re: [PHP-DEV] how to debug a php script ( the C code beneath it) > > On 13/02/12 21:48, Adi Mutu wrote: > > Hello, > > > > Perhaps this is a stupid question, but i haven't coded in C in years an= d > i'm not very familiar with development/debugging tools. If I have a php > script say 20 lines, > > How can I see a path of the corresponding C code which is executed? Wha= t > If i would like to break at a certain php line in the script, is it > possible? > > > > Thanks, > Why do you want to do it? > It looks to me like that you are trying to solve a problem the hard way > by doing that. > --0015174be872833c5804b8e91287--