This is the mail archive of the gdb-patches@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: [RFC v2] Extend gdb.parse_and_eval to accept a format string


>>>>> "Siva" == Siva Chandra <sivachandra@google.com> writes:

Siva> If the string argument to gdb.parse_and_eval is a format string, then a
Siva> variable number of args of type gdb.Value can follow.  The number of
Siva> gdb.Value args to be passed is determined by the format string.  The Nth
Siva> gdb.Value arg is referenced by "${N}" in the format string.  The value
Siva> of N starts at 0.

Siva> The idea here is that the format string argument will be parsed and
Siva> evaluated as an expression after the "${N}" occurances in it are
Siva> replaced with an internal variable having the same value as encapsulated
Siva> by the Nth gdb.Value arg.

I appreciate the quick-and-dirty programming that this patch enables,
but I am not that fond of this particular expression of the idea.  It
seems to me that it would be more generally useful to present a way for
Python scripts to create and manipulate convenience variables; and that
this would additionally solve the problem at hand equally well.

As to the patch itself, I think that it leaves the special convenience
variables lying about after parsing; which doesn't seem so great.  Also
I think the "true_alias" code is not really needed.  I think similar
functionality could be achieved by making the new internalvars be
computed.

thanks,
Tom


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