From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com [68.232.141.98]) by sourceware.org (Postfix) with ESMTPS id 848F93947C34 for ; Fri, 17 Jul 2020 15:29:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 848F93947C34 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=mentor.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=abid_qadeer@mentor.com IronPort-SDR: /T3CssbCBR2vASTQEP3wkxH1XFwnqPWZLef41ZDZTwTed0+UbJ3wPbjv13UvVUITA05VR7ruJ0 rbwDiLh+8KDYYnxpoh+9STcXwOU0zj3XpmENCpHlWgMK7WnPuKUeL9n5Lms7DgW9LCsTugc3FQ YdLCTUex4BBK1+5RIj8eDncB4SpGvaK966vBkeYqsK9J3cdSh1v3X8J2xzhMLG1st2lMbBpWz2 6bEsGhpc8qsqm+Yd93zkMQ+firpHQD7gmvmZpympXX86haxe5M1cGuhBbsbQMHOHuuzjsYR7zw L18= X-IronPort-AV: E=Sophos;i="5.75,362,1589270400"; d="scan'208";a="51031440" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa2.mentor.iphmx.com with ESMTP; 17 Jul 2020 07:29:04 -0800 IronPort-SDR: Ut6MsSN4op5MxkfBwBvgsO3YAOFNTR6iWIi0RQsCVcJn38ggyoNziRw7x/QIn3oAiA5jXtgdhk SznCaRz8QRoTn3/PQ1SdIw7tKWiICgzekgB5/B+aLnH1rPOrlvqMp0kEJ+bAglUyEW2fckpGTx aphWRInImrBubusR51B72Lha9SZCYTdUnyu/pCyLeqKfpcp3mL0ownDeVfmKu6lWx+NQX09RJQ vKbj+Q3x6F/miOJV/TXzo+/P3zWrHxppZzj95WNqZtGFyBQskwi+7EQPDUGkhp39gGVNgTgUfZ ib4= Subject: Re: MI and SIGINT To: Andrew Burgess CC: References: <20200714185850.GI3463@embecosm.com> From: Hafiz Abid Qadeer Message-ID: <7c3603c8-11ca-19bb-44ea-99f2bdd77de2@mentor.com> Date: Fri, 17 Jul 2020 16:28:59 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200714185850.GI3463@embecosm.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-06.mgc.mentorg.com (139.181.222.6) To SVR-IES-MBX-03.mgc.mentorg.com (139.181.222.3) X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jul 2020 15:29:07 -0000 On 14/07/2020 19:58, Andrew Burgess wrote: > * Hafiz Abid Qadeer [2020-07-14 12:03:11 +0100]: > >> Hi All, >> We have observed that a SIGINT send by an IDE can cause GDB to not print >> MI stopped messages. Although this is very difficult to reproduce by >> hand but the sequence look something like this. >> >> 1. You do continue and GDB hits a breakpoint and starts calling the >> observers. >> 2. One of the observer will call into python sniffers. >> 3. If during that time, a SIGINT has arrived, it will cause python to >> throw exception which will cause GDB to abandon printing the stopped >> message. > > I don't have time to test this right now, but if your diagnosis is > correct then this should be easy to test. Write a sniffer that sends > itself a SIGINT and check you see the problem. > > This should make it possible to create a reliable test case. I looked at bit more at it and it seems the behavior is intentional and was added in 9ccabccd15603dbf9fe988c86708fe644d1398a7. If the ctrl-c arrives while python unwinders are running then its translated to a quit exception when back inside gdb. In MI case, this quit exception can cause MI stop message not being printed. I wonder if this should be classified as a defect or intentional behavior considering the following in the documentation. "An interrupt (often Ctrl-c) does not exit from GDB, but rather terminates the action of any GDB command that is in progress and returns to GDB command level. It is safe to type the interrupt character at any time because GDB does not allow it to take effect until a time when it is safe." https://www.sourceware.org/gdb/onlinedocs/gdb.html#Quitting-GDB Thanks, -- Hafiz Abid Qadeer Mentor Embedded/CodeSourcery