From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11690 invoked by alias); 13 May 2006 14:18:44 -0000 Received: (qmail 11671 invoked by uid 22791); 13 May 2006 14:18:43 -0000 X-Spam-Check-By: sourceware.org Received: from eastrmmtao01.cox.net (HELO eastrmmtao01.cox.net) (68.230.240.38) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 13 May 2006 14:18:40 +0000 Received: from localhost.localdomain ([68.9.66.48]) by eastrmmtao01.cox.net (InterMail vM.6.01.06.01 201-2131-130-101-20060113) with ESMTP id <20060513141838.JDQD17255.eastrmmtao01.cox.net@localhost.localdomain> for ; Sat, 13 May 2006 10:18:38 -0400 Received: from bob by localhost.localdomain with local (Exim 4.52) id 1Feuxk-00029a-Ud for gdb@sources.redhat.com; Sat, 13 May 2006 10:19:20 -0400 Date: Sat, 13 May 2006 15:09:00 -0000 From: Bob Rossi To: gdb@sources.redhat.com Subject: invoking GDB from FE and signals Message-ID: <20060513141920.GC10678@brasko.net> Mail-Followup-To: gdb@sources.redhat.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.9i X-IsSubscribed: yes 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: 2006-05/txt/msg00174.txt.bz2 Hi, Does anyone know the correct way to invoke GDB from a front end. I know it's possible to use either a PTY or a pipe. By using the PTY, readline is between the FE and GDB. By using a pipe, readline is not used. Of course, I'm still using annotate=2 here, not gdb/mi which doesn't support readline either way. For a long time, using many different GDB's I've started GDB using a pipe, thinking readline wasn't necessary. Now I have run into a bad problem. This difference is important, because I believe GDB handles signals slightly different when readline is on the terminal or not. When my FE receives a ^c on the terminal, I need to send that to GDB. For a long time I have sent a 'kill (gdb_pid, SIGINT)' to GDB to accomplish this task. This has worked well for me, and I use this technique for SIGINT, SIGTERM and SIGQUIT. I recently had someone report to me that when my FE is started on a Mac and ^c is entered, I send the signal to GDB and it responds with "(Quit)" as expected. However, if GDB is running the inferior, and ^c is received, I send the 'kill' and GDB shuts down. It was reported that when the user just used GDB, both of these case's worked as expected. Of course, the major difference is that readline was used with just GDB and when using my FE, no readline was available when GDB received the signal. Is there a better way for the FE to send this data to GDB? Is this a bug in GDB? Do I need to start GDB with readline between the FE and it? Finally, this should be documented and tested (which I'll be glad to do). Especially since when using the MI interface, readline will never be available to be between GDB and the FE if started with a PTY or a pipe. Thanks, Bob Rossi