From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from forward100o.mail.yandex.net (forward100o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::600]) by sourceware.org (Postfix) with ESMTPS id A12903835430 for ; Wed, 21 Jul 2021 08:20:03 +0000 (GMT) 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 Received: from iva3-5cde98c480ea.qloud-c.yandex.net (iva3-5cde98c480ea.qloud-c.yandex.net [IPv6:2a02:6b8:c0c:4997:0:640:5cde:98c4]) by forward100o.mail.yandex.net (Yandex) with ESMTP id 5EB4C4AC2815; Wed, 21 Jul 2021 11:20:01 +0300 (MSK) Received: from iva1-bc1861525829.qloud-c.yandex.net (iva1-bc1861525829.qloud-c.yandex.net [2a02:6b8:c0c:a0e:0:640:bc18:6152]) by iva3-5cde98c480ea.qloud-c.yandex.net (mxback/Yandex) with ESMTP id iXA3aD6RH3-K1J4FR7I; Wed, 21 Jul 2021 11:20:01 +0300 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 Received: by iva1-bc1861525829.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id uAfKVLoylV-K0PGb98b; Wed, 21 Jul 2021 11:20:00 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) Received: from [192.168.1.10] (HELO daemon2.darkdragon.lan) by daemon2 (Office Mail Server 0.8.12 build 08053101) with SMTP; Wed, 21 Jul 2021 08:06:11 -0000 Date: Wed, 21 Jul 2021 11:06:11 +0300 From: Andrey Repin X-Mailer: The Bat! (v6.8.8) Home Reply-To: cygwin@cygwin.com X-Priority: 3 (Normal) Message-ID: <657252357.20210721110611@yandex.ru> To: Jim Hyslop , cygwin@cygwin.com Subject: Re: Debugging PHP with GDB and php-debuginfo In-Reply-To: <6761b93277958c240961339bc5a1f2e2@dreampossible.ca> References: <6761b93277958c240961339bc5a1f2e2@dreampossible.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 08:20:06 -0000 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...