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

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:date:from:to:cc:subject:message-id:in-reply-to
:references:mime-version:content-type:content-transfer-encoding;
q=dns; s=default; b=BJ+wJO1w+vGciDNfj2BTI66eePyfUTtDYRBKk/J66kg
Fzh7GqdnkVSgVg3T5aMfCOF9/4nj8wvpN5zqDE220t1NpTBha9bN9QH8Xy8Dkpqv
dXdP/DXeZcO2NB84yjeiJzrdHHkJqvcfrpK7YxAyCSVrJHBQsixwODeYnbw3GBSY
=
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:date:from:to:cc:subject:message-id:in-reply-to
:references:mime-version:content-type:content-transfer-encoding;
s=default; bh=6kPDYu0cNMtlif3mhM5Pkmp6Vyg=; b=W8lb81y2pOIVaBDdO
de8UYKbm/IP3S99FB5euTYyr1hM0y1L2VP0OCumbVrndz7cF3s/1q5RG4syBYzyu
+c+l1pASGanOyFfutkt60VU2cYdt4cuZonbVhz7HP7IvFjMPvMGNQ4hLa80wpFU+
g60JM993eO50vRrGUy4wdeRXwE=
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=-7.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=H*Ad:D*gov, tonight
X-HELO: conssluserg-02.nifty.com
DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-02.nifty.com 00L3FlnN027242
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.ne.jp; s=dec2015msa; t=1579576548; bh=THVp+AwlpATwWLgn3jBDhjXt2zl4ebNzPymm2dcJjD8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=LP1tgHT6133pDmIpM94F+91bySEGcxX5OI3J0yA1L/Z6HUsnv99KFSF00iSZHtMGz iRqNFwHyWuelqdAJT97kC/hJ9aJrqgAf107MtO1f9Ez6ZJ4C1DR83ENWIvKcq0EFiC KIf7Ydh6MzbIKUd/E6Lk3zqoOukZh6kjexT3VUXiIpgOoRgpXdK5/D1RikKf8udsZD CvbMGla+KJg62XO/xyqhs4z4DvhRiM1xwZz1W6pSZcR/7YuXM7JP5HsDNPoldmVCYg Wswo/RiMFH79LfTwo5vELO1QojwJioV7OgO5e0jM74s4G8H9SHhGp68mnkeBsbqk4E tEMlWqWqjZ3rg==
Date: Tue, 21 Jan 2020 12:15:57 +0900
From: Takashi Yano <takashi DOT yano AT nifty DOT ne DOT jp>
To: cygwin AT cygwin DOT com
Cc: "Lavrentiev, Anton (NIH/NLM/NCBI) [C]" <lavr AT ncbi DOT nlm DOT nih DOT gov>
Subject: Re: Looks like GDB in Cygwin does not catch Ctrl/C correctly
Message-Id: <20200121121557.9260057468bdfee5896273dc@nifty.ne.jp>
In-Reply-To: <SN6PR09MB2877244888717FA8ADE4EE31A50D0@SN6PR09MB2877.namprd09.prod.outlook.com>
References: <SN6PR09MB2877244888717FA8ADE4EE31A50D0 AT SN6PR09MB2877 DOT namprd09 DOT prod DOT outlook DOT com>
Mime-Version: 1.0
X-IsSubscribed: yes

On Tue, 21 Jan 2020 03:09:19 +0000
"Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin" <cygwin AT cygwin DOT com> wrote:
> 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)
> ...

What is your environment? Windows version, cygwin version and etc...

-- 
Takashi Yano <takashi DOT yano AT nifty DOT ne DOT jp>

--
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