This is the mail archive of the gdb@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Proposal: --with-gdb-interpreter=... --interpreter=...


On Thu, 19 Aug 1999 10:38:33 +1000, Andrew Cagney <ac131313@cygnus.com> wrote:

> [...]
>
> 	o	a new option ``--interpreter=...'' that can be used
> 		to specify the interpreter to use during startup.

I propose the flag to be simply called -perl, -python, -tcl, -guile etc. In
addition to this the flag should take an additional argument which should
represent the name of a script in that language. This would allow the user to
write full scripts to work with gdb.

I have an old, rudimentary prototype built in Perl that works like this and is
quite nice to have the ability to run gdb from a driver script. I basically
replaced the normal GDB command loop with one that's written in Perl. I
exported the execute_command() function and all the names of the GDB commands
to Perl so that I could call GDB commands from Perl. The Perl driver loop had
two modes: a normal GDB mode in which lines entered by the user are treated as
normal GDB commands. The other mode is a Perl mode, all the input lines are
accumulated until a special key is hit (Ctrl-x), at which point the input is
executed as Perl code. The Perl driver loop even extended the normal GDB
command line syntax by adding capabilities for passing the output of a command
through an arbitrary Unix pipe or passing the input of such a pipe as arguments
of a GDB command.


Greetings,
--
Ovidiu Predescu <ovidiu@cup.hp.com>
http://andromeda.cup.hp.com/  (inside HP's firewall only)
http://www.geocities.com/SiliconValley/Monitor/7464/




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]