From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12175 invoked by alias); 26 Sep 2005 17:36:47 -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 12160 invoked by uid 22791); 26 Sep 2005 17:36:40 -0000 Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Mon, 26 Sep 2005 17:36:40 +0000 Received: from drow by nevyn.them.org with local (Exim 4.52) id 1EJwu6-0002Ci-VJ; Mon, 26 Sep 2005 13:36:39 -0400 Date: Mon, 26 Sep 2005 17:36:00 -0000 From: Daniel Jacobowitz To: David Lamy-Charrier Cc: gdb@sources.redhat.com Subject: Re: How to access files (open/read/close) from gdb script ? Message-ID: <20050926173638.GC8277@nevyn.them.org> Mail-Followup-To: David Lamy-Charrier , gdb@sources.redhat.com References: <6541ed4c050926074274c08518@mail.gmail.com> <6541ed4c05092607445929e846@mail.gmail.com> <1127746273.14120.60.camel@localhost.localdomain> <6541ed4c05092608534877c12@mail.gmail.com> <20050926170314.GP772@adacore.com> <6541ed4c05092610342d7d63c1@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6541ed4c05092610342d7d63c1@mail.gmail.com> User-Agent: Mutt/1.5.8i X-SW-Source: 2005-09/txt/msg00200.txt.bz2 On Mon, Sep 26, 2005 at 07:34:10PM +0200, David Lamy-Charrier wrote: > > > You can launch any command from GDB using the "shell" command. > > > > > > Just as a comment regarding TCL, I would personally use anything but > > > TCL. It's your choice: You can use bourne scripts, or even write a > > > program in C or Ada... > > Thanks a lot for your help, > but with an external script or program, I can not retrieve results of > the external program from my gdb script (except maybe the exit_code) ? > > Is there anywhere a list of allowed functions from gdb script (I know > that printf, strcmp... are allowed) ? They aren't "allowed" per se. You're calling functions in the program you're debugging when you do this. You have two options: use "shell" and its limitations, or wrap GDB in something that processes its input and output, like Expect. -- Daniel Jacobowitz CodeSourcery, LLC