This is the mail archive of the gdb@sources.redhat.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]
Other format: [Raw text]

gdb + perl


In order to increase the amount of triage that could be fully automated
by developers I recently added support to my company's in-house GDB
tree for  writing macros using external scripting languages. Because
perl is the most popular scripting language in-house, that is the
language I've gone with for the initial implementation. To the base GDB
command set I've added three commands: runperl, sourceperl, and
resetperl. "runperl" runs a perl script from gdb using a non-persistent
interpreter. "sourceperl" runs a perl script from gdb that uses
a persistent interpreter. This allows one to register callbacks with
GDB to add to the command set, much like "define" for gdb macro
language. "resetperl" destroys and rebuilds the persistent interpreter.
All communication between perl and gdb (except for callback
registration) goes through the MI interface, so the changes to GDB are
quite minimal. I've written a perl parser for demarshalling the MI
output and a library on top of that that users can use to define
GDB scripts. I've also converted a number of in-house GDB macros
to perl to demonstrate to others how it is done.

I'm posting this to the list to ask if this is something that people
would like to see incorporated into the base GDB.



				-Kip


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