From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14634 invoked by alias); 15 Mar 2006 23:37:43 -0000 Received: (qmail 14625 invoked by uid 22791); 15 Mar 2006 23:37:42 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Wed, 15 Mar 2006 23:37:41 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1FJfYh-00077Q-Bh; Wed, 15 Mar 2006 18:37:39 -0500 Date: Thu, 16 Mar 2006 00:53:00 -0000 From: Daniel Jacobowitz To: Ed Peschko Cc: gdb@sourceware.org Subject: Re: tracing, attaching to gdb processes Message-ID: <20060315233739.GA27218@nevyn.them.org> Mail-Followup-To: Ed Peschko , gdb@sourceware.org References: <20060306052832.GA12829@mdssdev05> <20060314022809.GA1335@nevyn.them.org> <20060315030437.GE10146@mdssdev05> <20060315034420.GA1616@nevyn.them.org> <20060315041618.GB12493@mdssdev05> <20060315142230.GA12258@nevyn.them.org> <20060315231846.GA13847@mdssdev05> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060315231846.GA13847@mdssdev05> User-Agent: Mutt/1.5.8i 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-03/txt/msg00086.txt.bz2 On Wed, Mar 15, 2006 at 03:18:46PM -0800, Ed Peschko wrote: > On Wed, Mar 15, 2006 at 09:22:31AM -0500, Daniel Jacobowitz wrote: > > Stopping on input is a bit more complicated than you think. Whenever > > the program is running, it has control of the terminal - and input goes > > to it, not to us. I don't see an easy way to do this. > > The way to do it is thorugh something similar to ReadKey - For example, the > following perl script does sort of what I'd want: No, sorry, you did not understand my explanation of the problem. The program being run is usually on the same terminal as GDB. If it reads, it will consume the input. > Right now, I look inside of the gdb folder inside of the build directory for > gdb-6.3, and I see that make creates a: > > libgdb.a > > file. I'm assuming it wouldn't be that difficult to add there. No; that library is only used in the creation of GDB, it should never be linked to anything but GDB. It's just a convenience during the build process. Once upon a time there were experiments with linking things to GDB directly; eventually we decided that controlling it through a pipe was a better choice. > Another thing that might be useful to add there is an 'automatic breakpoint' > function. Perl has '$DB::single', ie: you set the value $DB::single = 1, the > debugger automatically stops. Similarly, it would be nice to have a > > gdb_stop(); > > function, which you could use to pepper your code with useful breakpoints. Feel free: void gdb_stop (void) { } (gdb) break gdb_stop Or put it in a .gdbinit file that you ship with the application. -- Daniel Jacobowitz CodeSourcery