X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:references :in-reply-to:content-type:content-id:content-transfer-encoding :mime-version; q=dns; s=default; b=r3tLsUWxby58x9naYL4VCDLpiE+L6 fcEyNiOgRjZdnvbSh5rinmxjgvD3N3AElp87yn00ays9TAAiTvjqvgAQzSGAe74+ lNIxF6LzWyuPB6MNWSZP2Hni3QFCP+wy/xwdx8aW4VgVFejqSKCr0hHy9KxCgRY/ RsY9n/tnqwRm9A= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:references :in-reply-to:content-type:content-id:content-transfer-encoding :mime-version; s=default; bh=yZn7Z32d9AP5Ef+g9nj9FP9hWck=; b=ERO o+eeIVP+Rn79JAy2ZSeL247vBrfUCMuybeaE1wsSn7Lb49haA6bimXXHnc5ewLE7 WHbIIRoQ9Q3lQLbVlqPTMAOd+mGdE75d5TOJHQ1jNDuLrLyoke3Ptl5O52TqEEOI gj5DohhT+JlwWISx7HN/+EROT41g0XNMvDu9hkKk= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-5.9 required=5.0 tests=AWL,BAYES_00,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,SEM_URI,SEM_URIRED,SPF_HELO_PASS,SPF_PASS autolearn=no version=3.3.1 spammy=HX-Languages-Length:1371, documents X-HELO: NAM02-BL2-obe.outbound.protection.outlook.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FGHssDgRenJF2M2dsO7VmHynh3tt24O7+k7VNE6NS1ByrX2ZaY5CGox+kaeFLGqrO20eFRfRStRR06jtkt0z2zRmKl5vaGzIW5IeljjFHGx9FppBJUx3OQ6gN4ppfMovZAnM414EeC7Q/twaqZRYOEDHqrJ2Ju1u8VpWdF2a4RgG4y6G1QoIrquNREfvvSVj6KmamFf/7iZx280rySZ1bRhiZOFedAgglCH7dc0T98HqGA/FuvGywc+SM3pGuM1pn0MUpyyLDyH+LDzWnRD/E5a8CgFA30MeEg/aprIP0h/h8xXfzvuROkW5GUTxJ0sP6JfadQvK0ZPhp5HOm02ylA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ydHNTGOoxSRdR0DEyQqDJqFOvnqZopkIV581KXjPXZA=; b=jWpfSQLVFGFetWM9ZknyrQeJWG+k1ZTnkchPDkU7gDEnQKSwd9Y2aS/3nTndZv2zYhjI/ZSQ8S/b1aK/zlQnXUlM/2MYWmec2/unRvEHYS11bC4ZJYnoV1zgBFeVsDMNe1Tnu07B20iSvqJY+VtuwTkb8ys0Non9TUt6oNxWme0t0yHqM65btMZhNuO64ehOAXwUoe1lk/BCrYuhxKz6SlHFUyUj4c4nrcJ0Uu72/2M2cXSkwEg+wPumMR7Cgrt/5G4s/cdwJlHShdCRtzaYzn1aUo04GYzSkQKoNFvBVhtgEJQ5r2V9jQ3kmo/dLNNqOW8XYcnlZa6nf9C1rDK2dQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=cornell.edu;dmarc=pass action=none header.from=cornell.edu;dkim=pass header.d=cornell.edu;arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cornell.edu; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ydHNTGOoxSRdR0DEyQqDJqFOvnqZopkIV581KXjPXZA=; b=ioGyh3w+thvEnIF4+qroyUrzCqGHZ5EQnBN4wgthdTyqMr5V+Jfy5NSrTjVPLgUXfVU8O6wlptUofEy7hTkMxWe++d3fYvVt2ccrCczlwFWvKYQbJ4ZEvYN2f9idGL4Xy6v5zxWG0riNh/jIaK/YLOYWvoHPq3u6AN5vEJH7eS8= From: Ken Brown To: Jon Turney , The Cygwin Mailing List Subject: Re: Can't debug bash with gdb 8.2.1-1 Date: Wed, 24 Jul 2019 12:33:00 +0000 Message-ID: References: <37d412b3-f0ff-b079-4d64-16b01898b420 AT cornell DOT edu> <73dcccf2-33a0-7608-269b-e9cb9abc2238 AT dronecode DOT org DOT uk> <10d70ba8-41a8-10e8-0ab0-5be526931de7 AT cornell DOT edu> In-Reply-To: user-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 authentication-results: spf=none (sender IP is ) smtp.mailfrom=kbrown AT cornell DOT edu; x-ms-oob-tlc-oobclassifiers: OLM:6790; received-spf: None (protection.outlook.com: cornell.edu does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 Content-Type: text/plain; charset="utf-8" Content-ID: <64A6A8611D675047B2460B329014DA7E AT namprd04 DOT prod DOT outlook DOT com> MIME-Version: 1.0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: ksb2 AT cornell DOT edu X-IsSubscribed: yes Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by delorie.com id x6OCXcZx022688 On 7/23/2019 2:02 PM, Jon Turney wrote: > Hmm.... let me clarify what I mean: > > $ cat getpgrp_test.c > #include > #include > > int main() { >   printf("getpgrp() = %d\n", getpgrp()); > } > > $ gcc getpgrp_test.c -o getpgrp_test.exe > > $ ./getpgrp_test > getpgrp() = 1241 > > > $ gdb ./getpgrp_test > GNU gdb (GDB) (Cygwin 8.2.1-1) 8.2.1 > [...] > Reading symbols from ./getpgrp_test...done. > (gdb) r > Starting program: /work/getpgrp_test > getpgrp() = -1 > [Inferior 1 (process 11428) exited normally] Thanks, I was being dense. But look at this one: $ cat getpgrp_test.c #include #include #include int main () { pid_t pid = getpid (); pid_t pgid = getpgid (0); printf ("getpid () = %d, getpgid (0) = %d, errno = %d\n", pid, pgid, errno); } $ gcc -o getpgrp_test -Wall -g -O0 getpgrp_test.c $ ./getpgrp_test.exe getpid () = 1424, getpgid (0) = 1424, errno = 0 $ gdb ./getpgrp_test.exe GNU gdb (GDB) (Cygwin 8.2.1-1) 8.2.1 [...] (gdb) r Starting program: /home/kbrown/Documents/programming/misc_examples/getpgrp_test.exe [...] getpid () = 1427, getpgid (0) = -1, errno = 0 [...] [Inferior 1 (process 23872) exited normally] So getpgid (0) returns -1 without setting errno. I think this means that pinfo::init() didn't fail, but for some reason myself->pgid == -1. Ken -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple