delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2021/07/21/04:20:57

X-Recipient: archive-cygwin AT delorie DOT com
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A12903835430
Authentication-Results: sourceware.org;
dmarc=pass (p=none dis=none) header.from=yandex.ru
Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=yandex.ru
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail;
t=1626855601; bh=+nooT15tBNPcs2h6kmUL/aEVQkJxY14CVI8cgkm565Q=;
h=In-Reply-To:Subject:To:Message-ID:From:References:Date:Reply-To;
b=Xlxf2qRhupFXLKXEb7u7FMBg/ui4L9Vaoxt/Th7Ps8+ZjDFZjzAPRW6j0XQ9yq+kQ
66UFHCuJXynnafNhh66HTLp/DD/Zr5em1FLzWXHeCw5z6oo2SUaEXKbcm2iNA6ul3b
8vSNiB6r1/UhLx+fUYdwPsZYmyHkr+JXENYLPLK8=
Authentication-Results: iva3-5cde98c480ea.qloud-c.yandex.net;
dkim=pass header.i=@yandex.ru
Date: Wed, 21 Jul 2021 11:06:11 +0300
From: Andrey Repin <anrdaemon AT yandex DOT ru>
X-Mailer: The Bat! (v6.8.8) Home
X-Priority: 3 (Normal)
Message-ID: <657252357.20210721110611@yandex.ru>
To: Jim Hyslop <jhyslop AT dreampossible DOT ca>, cygwin AT cygwin DOT com
Subject: Re: Debugging PHP with GDB and php-debuginfo
In-Reply-To: <6761b93277958c240961339bc5a1f2e2@dreampossible.ca>
References: <6761b93277958c240961339bc5a1f2e2 AT dreampossible DOT ca>
MIME-Version: 1.0
X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_THEBAT,
NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, TXREP,
URIBL_SBL_A autolearn=no autolearn_force=no version=3.4.4
X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
Reply-To: cygwin AT cygwin DOT com
Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>

Greetings, Jim Hyslop!

> I've installed the php-debuginfo extension for gdb, but I can't figure
> out how to set a breakpoint with it. Is there a manual for 
> php-debuginfo? All I can find is the package information.

> I'm trying to debug why a unit test is passing (it should fail). I'm 
> using the CakePHP framework (www.cakephp.org). From the command line, I 
> normally just execute `vendor/bin/phpunit`.

You're confusing debugging PHP code (i.e. website) with debudding PHP itself.
php-debuginfo is for the latter.

> With gdb, I execute `gdb $(which php)`, then at the command line in GDB 
> I type ` b ./tests/TestCase/Controller/UsersControllerTest.php:80`

> GDB responds with:
> No source file named 
> ./tests/TestCase/Controller/UsersControllerTest.php.
> Make breakpoint pending on future shared library load? (y or [n])

Entirely predictable. PHP is written in C, not PHP.

> The file name is valid. I've tried using the full path instead of the 
> relative path.

> When I run the tests with `r vendor/bin/phpunit` the unit tests all 
> execute, but GDB doesn't stop at the breakpoint.

> Do I need to modify php.ini to use gdb? Any pointers?

You need to install xdebug. And for that, you need to install native PHP, as
there's no PECL modules built for Cygwin.
Then use any suitable IDE (VS Code, PHPStorm, etc.) to step through the code.
Read phpunit instructions about allowing it running under debugger.


-- 
With best regards,
Andrey Repin
Wednesday, July 21, 2021 11:03:04

Sorry for my terrible english...


-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019