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: [RFA] Handle var_zuinteger and var_zuinteger_unlimited from Python


Hi Tom,

> PR python/20084 points out that the Python API doesn't handle the
> var_zuinteger and var_zuinteger_unlimited parameter types.
> 
> This patch adds support for these types.
> 
> Regression tested on x86-64 Fedora 26.
> 
> gdb/ChangeLog
> 2018-04-26  Tom Tromey  <tom@tromey.com>
> 
> 	PR python/20084:
> 	* python/python.c (gdbpy_parameter_value): Handle var_zuinteger
> 	and var_zuinteger_unlimited.
> 	* python/py-param.c (struct parm_constant): Add PARAM_ZUINTEGER
> 	and PARAM_ZUINTEGER_UNLIMITED.
> 	(set_parameter_value): Handle var_zuinteger and
> 	var_zuinteger_unlimited.
> 	(add_setshow_generic): Likewise.
> 	(parmpy_init): Likewise.
> 
> gdb/doc/ChangeLog
> 2018-04-26  Tom Tromey  <tom@tromey.com>
> 
> 	PR python/20084:
> 	* python.texi (Parameters In Python): Document PARAM_ZUINTEGER and
> 	PARAM_ZUINTEGER_UNLIMITED.
> 
> gdb/testsuite/ChangeLog
> 2018-04-26  Tom Tromey  <tom@tromey.com>
> 
> 	PR python/20084:
> 	* gdb.python/py-parameter.exp: Add PARAM_ZUINTEGER and
> 	PARAM_ZUINTEGER_UNLIMITED tests.

This patch looks good to me, and you can push as is. It was surprisingly
harder to read (I picked this patch as a way to spend my time constructively,
while I wait for a build to finish ;-)), in particular the part with
the fall through in the case statement, but that's probably me having
a slightly different type of brain... I managed to convince myself
that the patch looks correct to me.

One thought: How about testing the value of the setting after setting
its value to -1?

-- 
Joel


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