This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Handle var_zuinteger and var_zuinteger_unlimited from Python
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Tom Tromey <tom at tromey dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 30 Apr 2018 14:52:10 -0700
- Subject: Re: [RFA] Handle var_zuinteger and var_zuinteger_unlimited from Python
- References: <20180426222003.9059-1-tom@tromey.com>
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