From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5471 invoked by alias); 26 Sep 2005 17:27:58 -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 5426 invoked by uid 22791); 26 Sep 2005 17:27:47 -0000 Received: from mail-out3.apple.com (HELO mail-out3.apple.com) (17.254.13.22) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Mon, 26 Sep 2005 17:27:47 +0000 Received: from relay5.apple.com (a17-128-113-35.apple.com [17.128.113.35]) by mail-out3.apple.com (8.12.11/8.12.11) with ESMTP id j8QHReaC014765; Mon, 26 Sep 2005 10:27:40 -0700 (PDT) Received: from [17.201.22.240] (inghji.apple.com [17.201.22.240]) by relay5.apple.com (Apple SCV relay) with ESMTP id 06705324016; Mon, 26 Sep 2005 10:27:40 -0700 (PDT) In-Reply-To: <6541ed4c05092608534877c12@mail.gmail.com> References: <6541ed4c050926074274c08518@mail.gmail.com> <6541ed4c05092607445929e846@mail.gmail.com> <1127746273.14120.60.camel@localhost.localdomain> <6541ed4c05092608534877c12@mail.gmail.com> Mime-Version: 1.0 (Apple Message framework v733) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Cc: gdb@sources.redhat.com Content-Transfer-Encoding: 7bit From: Jim Ingham Subject: Re: How to access files (open/read/close) from gdb script ? Date: Mon, 26 Sep 2005 17:27:00 -0000 To: David Lamy-Charrier X-SW-Source: 2005-09/txt/msg00196.txt.bz2 The gdb testsuites are an example of how to do this. They use "expect" to drive gdb and parse it's output. There are also a lot of Tcl helper libraries in the testsuite/lib directory that manage stepping, etc. So one pretty easy option is to use the dejagnu harness. In any case, you can run the gdb testsuite (using "make check") to get an example of how to use Tcl & Expect to script gdb. Also, if you can get the Insight debugger, that has a Tcl Interpreter build into gdb, and you can write scripts and just "source" them in Insight. At that point, you can do anything you could do in plain Tcl... I think DanielJ also has mentioned working on scripting bindings using the MI in the past, but I don't know the state of this. That is a little bit more work, but would allow you to run gdb under another scripting language if you wanted. Jim On Sep 26, 2005, at 8:53 AM, David Lamy-Charrier wrote: >> Maybe you can integrate this with an expect / tcl script ? AFAIK gdb >> scripting >> does not allow such stuff. >> > > I am not sure to understand correclty: > you mean that I can write a tcl script to do that, but how can I then > launch the tcl script ? > > Thanks, > David >