From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21179 invoked by alias); 18 Mar 2004 04:13:20 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 21166 invoked from network); 18 Mar 2004 04:13:17 -0000 Received: from unknown (HELO lakemtao04.cox.net) (68.1.17.241) by sources.redhat.com with SMTP; 18 Mar 2004 04:13:17 -0000 Received: from white ([68.9.64.121]) by lakemtao04.cox.net (InterMail vM.5.01.06.08 201-253-122-130-108-20031117) with ESMTP id <20040318041316.RGPI5813.lakemtao04.cox.net@white> for ; Wed, 17 Mar 2004 23:13:16 -0500 Received: from bob by white with local (Exim 3.35 #1 (Debian)) id 1B3ouD-0002qz-00 for ; Wed, 17 Mar 2004 23:13:17 -0500 Date: Thu, 18 Mar 2004 04:13:00 -0000 From: Bob Rossi To: gdb@sources.redhat.com Subject: Re: Driving gdb from a front end: how to send ctrl-c? Message-ID: <20040318041317.GA10764@white> Mail-Followup-To: gdb@sources.redhat.com References: <20040318040247.91931.qmail@web14104.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040318040247.91931.qmail@web14104.mail.yahoo.com> User-Agent: Mutt/1.3.28i X-SW-Source: 2004-03/txt/msg00167.txt.bz2 On Wed, Mar 17, 2004 at 08:02:47PM -0800, Marco Zandonadi wrote: > Hello, > I'm writing a front end for gdb that needs to work on > Cygwin and Linux. I'm trying out Cygwin first. After > reading several posts in the archives of this ML I > came up with a small proof-of-concept program that: > - sets up master and slave PTY > - forks a process and executes gdb in it > - sends a few commands to gdb > > Everything works ok except ctrl-c. Here is the > sequence of commands my program is sending gdb: > - b main > - r > - c > - ctrl-c (ASCII char 3) > > I can see the proper output for all commands except > ctrl-c. I guess this is because I missed some terminal > settings. > > The other problem is that I get about 10 msgs like > this: > [tcsetpgrp failed in terminal_inferior: Operation not > permitted] > > I attached the small cygwin program I talked about. > Any help will be very much appreciated. Are you sure you want a pseudo terminal between you and GDB? If you do that, readline will be active. If you just use a normal pipe, readline will not be active. Also, you can not send a signal to GDB when readline is active, since it interprets the signals. BTW, you should really check out how CGDB/TGDB works. It does exactly what you want. Basically, you could take TGDB and modify it to do what you want. Obviously TGDB is not supported by the GDB people :) Bob Rossi