Re: using perl in gdbinit

Edward Peschko
2001-02-28T14:21:00Z

>
> init_perl ()
> {
> g_interp = Perl_New_Interpreter ();
> }
>
> You should be able to do what you want (albeit in a hacky kind of way).

yeah, you could do this... and it might be a lot less hacky than anticipated,
if the perl module Inline could be used.

> For insight, we added a tcl interpreter and bound tcl's command parser to
> the gdb command "tk". We also have a tcl command, "gdb_cmd", which can be
> used to execute gdb commands in the tcl interpreter.

I didn't see it inside gdb-5.0... is it integrated with the standard
distribution or an add on?

> I could do things like what you want above (although I never have):
> (gdb) tk set help [gdb_cmd help]; puts stdout $help
> (gdb) tk set functions [gdb_cmd "info func main"]; puts stdout $functions
>
> Of course, you are still leaving yourself at the mercy of gdb's human
> readable output, so you'll need to parse gdb's output to do some things
> well.

hmm. that's what made me think of perl in the first place... one question
though, how does the tk interface deal with the 'more'-like behaviour of gdb
(ie: returns at the end of every page, etc.)

Ed