This is the mail archive of the gdb@sourceware.org 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]

Re: varargs in TUI defined functions ?


Hello Tom,

many thanks for your answer!

> > As a gdb commandline (text UI) user, I want to define a command
> > that can take a variable number of arguments.
> > http://sourceware.org/gdb/current/onlinedocs/gdb/Define.html#Define
> 
> You can do it quite easily using Python.

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

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

> > At the moment, there is $argc and $arg0 ... $arg9, but what I'm
> > missing is a builtin convenience variable that holds the entire
> > list of arguments.
> 
> I'd also be amenable to a patch adding this.

At the moment, I'm most interested what kind of naming convention for such a "varargs argument" the gdb community would like best:

   $argv    (like in C main(), and related to $argc)
   $args    (like in C va_args)
   $*       (like in Shellscripts)
   $arg*    (mixture of $arg and *)
   ... anything else?

Many Thanks!
Martin
-- 
Sicherer, schneller und einfacher. Die aktuellen Internet-Browser -
jetzt kostenlos herunterladen! http://portal.gmx.net/de/go/atbrowser


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