From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26936 invoked by alias); 30 Dec 2005 23:14:07 -0000 Received: (qmail 26929 invoked by uid 22791); 30 Dec 2005 23:14:07 -0000 X-Spam-Check-By: sourceware.org Received: from eastrmmtao04.cox.net (HELO eastrmmtao04.cox.net) (68.230.240.35) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 30 Dec 2005 23:14:06 +0000 Received: from white ([68.9.65.164]) by eastrmmtao04.cox.net (InterMail vM.6.01.05.02 201-2131-123-102-20050715) with ESMTP id <20051230231109.BYGO19943.eastrmmtao04.cox.net@white>; Fri, 30 Dec 2005 18:11:09 -0500 Received: from bob by white with local (Exim 3.36 #1 (Debian)) id 1EsTRW-0001Di-00; Fri, 30 Dec 2005 18:13:50 -0500 Date: Fri, 30 Dec 2005 23:14:00 -0000 From: Bob Rossi To: Carlos Eduardo Rodrigues de Almeida , gdb@sources.redhat.com Subject: Re: Sending signal to inferior Message-ID: <20051230231349.GF4388@white> Mail-Followup-To: Carlos Eduardo Rodrigues de Almeida , gdb@sources.redhat.com References: <214135380512291937q58cd9ebajc40590fdc3936be4@mail.gmail.com> <20051230041134.GB1316@white> <214135380512292029i36e2e5cft8f9715b1bfa2b4a5@mail.gmail.com> <20051230044151.GD1316@white> <214135380512292057r6b404d78t1b88d26f980ffb5a@mail.gmail.com> <20051230164300.GA3642@white> <20051230164802.GA5999@nevyn.them.org> <20051230225812.GE4388@white> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20051230225812.GE4388@white> User-Agent: Mutt/1.5.9i Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2005-12/txt/msg00227.txt.bz2 On Fri, Dec 30, 2005 at 05:58:12PM -0500, Bob Rossi wrote: > On Fri, Dec 30, 2005 at 11:48:02AM -0500, Daniel Jacobowitz wrote: > > On Fri, Dec 30, 2005 at 11:43:00AM -0500, Bob Rossi wrote: > > > On Fri, Dec 30, 2005 at 04:57:38AM +0000, Carlos Eduardo Rodrigues de Almeida wrote: > > > > Thank you.. I'm trying to solve this for days.. > > > > > > Wow, that took me a long time to figure out, and I wrote libtgdb. > > > > > > It's the tty command that is allowing libtgdb to interrupt GDB when the > > > inferior is running. Apparently, if you don't move the inferior's > > > terminal via the GDB tty command, then you can't interrupt the inferior > > > when it's running. > > > > > > Basically, I'm assuming that the SIGINT to GDB is ignored if the > > > inferior has control of the terminal. However, if you put the inferior > > > on a different terminal, then GDB must handle the SIGINT. This > > > explanation is just a guess though. > > > > It shouldn't be. Check whether GDB is reaching handle_sigint() and > > whether it is going through the event loop properly? > > This is a tough one. For some reason, if I start debugging GDB, it > doesn't reach the handle_sigint line. However, with fprintf there, I'm > seeing output. Could I be doing something wrong or is this expected? > > I configured && compiled like this: > cvs -d ':ext:bobbybrasko@sources.redhat.com:/cvs/src' co gdb > CFLAGS=-g ../src/configure > make > > I was wondering if any of the -W compile options stop me from debuging > GDB in this case. > What I can tell you from instrumentation is this. handle_sigint is not called when the inferior is running and the tty command was used. Out of the 4 cases inferior running/tty used inferior running/tty not used inferior not running/tty used inferior not running/tty not used only the first case does not allow GDB to get into handle_sigint. So, if GDB get's a SIGINT when the inferior is running and the tty is not set, then handle_sigint get's called. After the inferior is done running, quit() get's called and displays "Quit". If GDB get's a SIGINT when the inferior is running and the tty is not set, handle_sigint does not get called, and somehow GDB is interupted. However, I can't figure out why. Bob Rossi