This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: How to access files (open/read/close) from gdb script ?
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