varargs in TUI defined functions ?

Tom Tromey tromey@redhat.com
Tue Jun 8 21:01:00 GMT 2010


>>>>> "Martin" == Martin Oberhuber <Martin.Oberhuber@gmx.at> writes:

Martin> many thanks for your answer!

No problem... and I'm sorry for the long delay in this response.

Tom> You can do it quite easily using Python.

Martin> Well I know Python but I don't really know how gdb makes use of
Martin> it, so I'm kinda lost with this suggestion... can you give any
Martin> more pointers or an example?

You can write a new command in Python, see the gdb.Command class in the
gdb documentation.

Martin> Also, what minimum version of gdb would I have to use for Python
Martin> to be available for doing this? My Linux distro seems not to be
Martin> fully up-to-date.

7.0.

Martin> At the moment, I'm most interested what kind of naming
Martin> convention for such a "varargs argument" the gdb community would
Martin> like best:
Martin>    $argv    (like in C main(), and related to $argc)
Martin>    $args    (like in C va_args)
Martin>    $*       (like in Shellscripts)
Martin>    $arg*    (mixture of $arg and *)
Martin>    ... anything else?

I would say $argv, but really I would be ok with any of the first 3.

Tom



More information about the Gdb mailing list