From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 58629 invoked by alias); 21 Jan 2020 03:09:24 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 58621 invoked by uid 89); 21 Jan 2020 03:09:24 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-4.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 spammy=H*RU:165.112.194.6, HX-Spam-Relays-External:165.112.194.6, HX-Spam-Relays-External:uccsx03.nih.gov, H*RU:uccsX03.nih.gov X-HELO: nihcesxwayst05.hub.nih.gov Received: from nihcesxwayst05.hub.nih.gov (HELO nihcesxwayst05.hub.nih.gov) (165.112.13.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 21 Jan 2020 03:09:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nih.gov; i=@nih.gov; q=dns/txt; s=NIH; t=1579576162; x=1611112162; h=from:to:subject:date:message-id: content-transfer-encoding:mime-version; bh=7K9Hp8t8dQEvtlYLcqIjG3EBRHUe/furSlw7vPUlZx0=; b=HcA1B/ybmVg/bWMUhy9QC5VXBP7oj0TDuzEljzqdKfCm04Pd+gciw+W6 dTUQRM+rc5n4O8I4ddkOytbvSjWYcfWT61ALGAk3WXOEgOQX9uvMXkeZR cKifmbTTJFYde2eB/ewaY6IK+AiSWh3oibN/QhribwDQif7alrZkVUYZI z4LpLCv2xZ9Ea3VBCt1lEg+olsivVZmLJvnZ70OrtXR7xxSitGhzcZ6K9 Gk8FTmgz2XQMW9LInpedlD5lygVFWsy2BX6geEvAYtmBvLpfJ00iGFkZH lUeHSzrfwo3MHRMuZ3DshPWaHfyp1bhT1HkzPcrAs9IoHP+irfsdipqOr A==; IronPort-SDR: ry/qFLrM4NtAZEQahG4fPEmq6HtS21OR0e1V7m4a9SGUGnrOluEofX9doMXoxLCfbbOqEWt9rW UUWmRw2qz3JQ== Received: from uccsx03.nih.gov (HELO ces.nih.gov) ([165.112.194.93]) by nihcesxwayst05.hub.nih.gov with ESMTP/TLS/ECDHE-RSA-AES256-SHA384; 20 Jan 2020 22:09:20 -0500 Received: from uccsX01.nih.gov (165.112.194.91) by uccsX03.nih.gov (165.112.194.93) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 20 Jan 2020 22:09:20 -0500 Received: from GCC02-DM3-obe.outbound.protection.outlook.com (165.112.194.6) by uccsX01.nih.gov (165.112.194.91) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Mon, 20 Jan 2020 22:09:20 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GN2uKJlaUVauX28moJYV4zfrKKEY2CCklOptaFVjQj1NWrhxN7kV5iAKwbN71FO7DUu2jSwcpyrDVV1TZXdr4XZL9GmVAXA6od9BLszrGk8vSdqbotv19aao7JgOSMRnoOlKpph5K9WWaTEQA4LkJNZNQ/PxXbI7FCv9D6rl4xSa79lGXxE75ubrACYDTZn5aommpU5ymUjQQajjg8IIAvZxMgyEzIWWuJDM6T5Ko4RGR1+G4Q+pILW66A5VhNw80I6CDIwCQ1EOHRALIomw6AYH515qCHph6rEDAZFaGOBXtCFXh0cxSHrXuEhAUyH29SZ44kvaZW777UjGuHXE8g== 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=7K9Hp8t8dQEvtlYLcqIjG3EBRHUe/furSlw7vPUlZx0=; b=JKd0emgv0JbcTX0kxdU4o5nf7qKsrVDNQSa7alPNl3CQhCDZ9CeMyGZPIH1+dK/t6bP9Z60/XDOfIztipCiy7a26GD/8ATxMvUURakrVrdh5BgnQUr3gzro7wiV7FCUo5WY5aDPI0S45SmdOVwB1WDa9wOwaXkTV6Sa3feSnxk1GJGdkXe/SxdgOSICnbuhzrlmqqAc8aQw/3oUhmYue/oJzyyMYoaLdG6Q6Qgiogyc24hJmT7Rhcb9MfyhIzNBkVwj2BONNdErxKN72Q1CIb+ITifN98ZkKRUPvTwU+6ypi5fzX7v4q9hY7OwjDUrCYBYBTKzJw4do8RcCAKRJvbQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ncbi.nlm.nih.gov; dmarc=pass action=none header.from=ncbi.nlm.nih.gov; dkim=pass header.d=ncbi.nlm.nih.gov; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nih.onmicrosoft.com; s=selector2-nih-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7K9Hp8t8dQEvtlYLcqIjG3EBRHUe/furSlw7vPUlZx0=; b=S6odGzDYf7L5eqrfKMroBQHWwW6VVsMlY8Ug+JoObnHaJOMmbQ3u1IOHfWwMVM/DvqfM+qfIivFE8D+0JpgfzXhuswDZuOwDvWfo/SvfMgM2gd81HYs+CSG/LgzItNmFnTDvDivkY2dnOAfqKvsNAO2nU9ZszwU+e27c3e3OE3k= Received: from SN6PR09MB2877.namprd09.prod.outlook.com (52.135.95.22) by SN6PR09MB3774.namprd09.prod.outlook.com (52.132.121.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.20; Tue, 21 Jan 2020 03:09:19 +0000 Received: from SN6PR09MB2877.namprd09.prod.outlook.com ([fe80::fd:44f3:d23c:5c02]) by SN6PR09MB2877.namprd09.prod.outlook.com ([fe80::fd:44f3:d23c:5c02%7]) with mapi id 15.20.2644.024; Tue, 21 Jan 2020 03:09:19 +0000 From: "Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin" Reply-To: "Lavrentiev, Anton (NIH/NLM/NCBI) [C]" To: "'cygwin@cygwin.com'" Subject: Looks like GDB in Cygwin does not catch Ctrl/C correctly Date: Tue, 21 Jan 2020 03:09:00 -0000 Message-ID: authentication-results: spf=none (sender IP is ) smtp.mailfrom=lavr@ncbi.nlm.nih.gov; x-ms-oob-tlc-oobclassifiers: OLM:6430; x-ms-exchange-senderadcheck: 1 x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: mRY7ENFDVM69c9CaIyyAtZdyGgS2ODvVA4onUQ4/AFRgQxIG6tkJCdJfojs5HtxY Return-Path: lavr@ncbi.nlm.nih.gov X-SW-Source: 2020-01/txt/msg00174.txt.bz2 Hi All, Another question for tonight: So there's a program that basically enters a tight loop on some incorrect i= nput (and needs to be debugged, obviously). The program is otherwise rather basic, doesn't use anything outside K&R C R= TL. When I run the program under gdb, I want to interrupt it with Ctrl/C (as I = would be doing in Linux) and then step through the code to figure out where it is looping. GDB does interrupt the program but when I do step or next, it looks like so= me utility thread gets the actual control, and actually processes the INT sign= al, which then terminates the program, making the debugging impossible: Thread 1 "cprog" received signal SIGINT, Interrupt. free_tree (tp=3D0x80004eae0) at cprog.c:1696 1696 break; (gdb) s 0x0000000180148990 in muto::release(_cygtls*) () from /usr/bin/cygwin1.dll (gdb) s Single stepping until exit from function _ZN4muto7releaseEP7_cygtls, which has no line number information. 0x000000018013469b in _sigbe () from /usr/bin/cygwin1.dll (gdb) s Single stepping until exit from function _sigbe, which has no line number information. 0x00000001801346e5 in sigdelayed () from /usr/bin/cygwin1.dll (gdb) s Single stepping until exit from function sigdelayed, which has no line number information. [Inferior 1 (process 6792) exited with code 01000] Using "n" instead of "s"s gets the termination right away: (gdb) n [Inferior 1 (process 5020) exited with code 01000] The program does have all the debugging info on (compiled with -g) and can be stepped through successfully (in Cygwin too from the get go but = not whe interrupted). The same code compiled with the exact same gcc command, and run under gdb o= n Linux can be stepped through the actual source code after having been interrupted with Ctrl/C. Any ideas would be appreciated. Thanks, Anton P.S. This is how the debugging session looks on Linux, for comparison, show= ing it does step through the actual code: Program received signal SIGINT, Interrupt. 0x00000000004053f1 in implicit_gbl (value=3D0x6269f0) at cprog.c:2494 2494 switch(value->type) (gdb) n 2527 } (gdb) n store_value (stack=3D0x7fffffffc718, tr=3D0x7fffffffc720, size=3D1, value= =3D0x6269f0) at cprog.c:3805 3805 if(value->type =3D=3D EX_LIT) (gdb) n 3807 store_word(stack->top, tr, size, value->data.lit); (gdb) ... -- 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