From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7146 invoked by alias); 19 Sep 2011 14:13:18 -0000 Received: (qmail 7135 invoked by uid 22791); 19 Sep 2011 14:13:16 -0000 X-SWARE-Spam-Status: No, hits=3.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_NJABL_RELAY X-Spam-Check-By: sourceware.org Received: from mail.envionsoftware.com (HELO mail.envionsoftware.com) (193.178.251.42) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 19 Sep 2011 14:12:59 +0000 Received: from mail.envionsoftware.com (localhost [127.0.0.1]) by mail.envionsoftware.com (Postfix) with ESMTP id 6DF1F4810E; Mon, 19 Sep 2011 18:13:15 +0400 (MSD) Received: by mail.envionsoftware.com (Postfix, from userid 1000) id 6287A48117; Mon, 19 Sep 2011 18:13:15 +0400 (MSD) Received: from antivirus.envionsoftware.local (unknown [94.124.179.65]) by mail.envionsoftware.com (Postfix) with ESMTPSA id 5EBB64810E; Mon, 19 Sep 2011 18:13:14 +0400 (MSD) Message-ID: <4E774DE7.20606@apetukhov.ru> Date: Mon, 19 Sep 2011 14:13:00 -0000 From: Alexander Petukhov User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:6.0.2) Gecko/20110902 Thunderbird/6.0.2 MIME-Version: 1.0 To: Joel Brobecker CC: gdb@sourceware.org Subject: Re: proper usage of "-exec-interrupt" References: <4E7449BD.4030405@apetukhov.ru> <20110917190624.GQ12670@adacore.com> In-Reply-To: <20110917190624.GQ12670@adacore.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-AV-Checked: ClamAV using ClamSMTP Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2011-09/txt/msg00063.txt.bz2 On 9/17/11 11:06 PM, Joel Brobecker wrote: >> Whay does this signal come to parent process and can I avoid this >> somehow? > This is a bit of a guess, since I don't remember all the details, > but I think it might be a question of process group. To implement > the interrupt, many targets simply send a SIGINT signal to the > inferior process group. If you spawned GDB within the same process > group as GDB, and both GDB and the program being debugged share > the same process group as well, the interrupt will cause SIGINT > to be received by your IDE as well. So, try spawning GDB in its > own process group. > I tried to move gdb into a distinct group with "setpgid(gdb_pid, 0)", right after spawning it with "g_spawn_async_with_pipes". If I do so SIGINT doesn't come to IDE but a program being debugged quits right after executing "-exec-interrupt". The gdb output is: ^done (gdb) &"Quit\n" =thread-exited, ..... =thread-group-exited,.... *stopped,reason="exited-normally" I also tried to do all this executing gdb from a terminal window and a program had stopped correctly with stop reason="signal-received", no quits... Can't it be a bug, I've found several discussions with suggestions to send SIGINT or SIGTSTP directly to a process being debugged instead of using "-exec-interrupt" ?