delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2020/01/20/22:10:17

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:reply-to:to:subject:date:message-id
:content-type:content-transfer-encoding:mime-version; q=dns; s=
default; b=wCkNLrVSs3e5rtExN1hIanc+I9LnWZZKRh2GmwIEGCk+BeHFMuLXS
wu2Yv1p+iMcKD//CC5xoC+7zLFeoRltOirmUDmK/eVuuEIdtLeo9lc/0Ot5Q7xzI
u4C1oRgAFYiLu4KZxwYOqffN7nIS8QqI9oviX+YzbYOxEhVyYEdl+0=
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:reply-to:to:subject:date:message-id
:content-type:content-transfer-encoding:mime-version; s=default;
bh=C4ZjnFYVOrECOvXmPytQF6s9AFs=; b=VpnUTmfalHdYeHbgiNZg2BmN54L4
HpSdHUTVNvo/HgCRcY+LKhxNwjRTViYROlKeoM5LpZz0pBsepz5AxT15S/K8eQg1
hI4gw0T3GFXjDdMXlugIvYOp++tvOHOa5W6mOJLhWd/iTe7XbioHyLN+/4KFW7V5
2BOZA8XNPKuGsNw=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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=-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
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==
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=
From: "Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin" <cygwin AT cygwin DOT com>
Reply-To: "Lavrentiev, Anton (NIH/NLM/NCBI) [C]" <lavr AT ncbi DOT nlm DOT nih DOT gov>
To: "'cygwin AT cygwin DOT com'" <cygwin AT cygwin DOT com>
Subject: Looks like GDB in Cygwin does not catch Ctrl/C correctly
Date: Tue, 21 Jan 2020 03:09:19 +0000
Message-ID: <SN6PR09MB2877244888717FA8ADE4EE31A50D0@SN6PR09MB2877.namprd09.prod.outlook.com>
authentication-results: spf=none (sender IP is ) smtp.mailfrom=lavr AT ncbi DOT nlm DOT nih DOT gov;
x-ms-oob-tlc-oobclassifiers: OLM:6430;
x-ms-exchange-senderadcheck: 1
x-ms-exchange-transport-forked: True
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: mRY7ENFDVM69c9CaIyyAtZdyGgS2ODvVA4onUQ4/AFRgQxIG6tkJCdJfojs5HtxY
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id 00L39weQ029841

Hi All,

Another question for tonight:

So there's a program that basically enters a tight loop on some incorrect input (and needs to be debugged, obviously).

The program is otherwise rather basic, doesn't use anything outside K&R C RTL.

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 some
utility thread gets the actual control, and actually processes the INT signal, which then
terminates the program, making the debugging impossible:

Thread 1 "cprog" received signal SIGINT, Interrupt.
free_tree (tp=0x80004eae0) 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 on 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, showing it does step through the actual code:

Program received signal SIGINT, Interrupt.
0x00000000004053f1 in implicit_gbl (value=0x6269f0) at cprog.c:2494
2494            switch(value->type)
(gdb) n
2527    }
(gdb) n
store_value (stack=0x7fffffffc718, tr=0x7fffffffc720, size=1, value=0x6269f0) at cprog.c:3805
3805            if(value->type == 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


- Raw text -


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