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: repo to work on python scripting support


>>>>> "Paul" == Paul Koning <Paul_Koning@Dell.com> writes:

Paul> An obvious Pythonic way of doing this is with default arguments, which
Paul> allows a call to omit some of the arguments defined for the function.
Paul> For example:
Paul>     def foo (arg1, arg2=None):
Paul> 	if arg2 is None:
Paul> 	   arg2 = raw_input ("please supply arg2: ")

I think default arguments are part of the solution, but not the whole
solution.

The basic problem is that we have a syntax for embedding a python call
in an expression that looks like $(stuff).

Now, internally to gdb, "stuff" is just a string.  But, most of the
time, the implementation of this function, whatever it is, won't want
just a string -- it will want an expression, or a file name, or
something.

So, what Jim and Daniel want, I think, is a declarative way for the
Python code (which implements the given function) to tell gdb's core
how to parse this string.

I think the hope here is that we avoid the mess of gdb commands, which
really do get just a plain string and then proceed to be inconsistent
with each other and just generally hard to modify.


It would be interesting to see if we could enumerate the core
possibilities for argument types.

Tom


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