This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH, doc RFA] Add guile gdb parameter support
- From: ludo at gnu dot org (Ludovic CourtÃs)
- To: Doug Evans <xdje42 at gmail dot com>
- Cc: Eli Zaretskii <eliz at gnu dot org>, "gdb-patches\ at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Mon, 02 Jun 2014 22:50:37 +0200
- Subject: Re: [PATCH, doc RFA] Add guile gdb parameter support
- Authentication-results: sourceware.org; auth=none
- References: <m31tvmj4xc dot fsf at sspiff dot org> <87lhtnd2q9 dot fsf at gnu dot org> <CAP9bCMRXEQ9bOsYGRjVG4MqJW9P_5tMCXwt3TD5vP_uU4CW+MQ at mail dot gmail dot com> <m3r438dmwu dot fsf at sspiff dot org> <87vbsj3e6v dot fsf at gnu dot org> <CAP9bCMTz-=CNDZug_mwkUwHJfuOe0a8A1B1HQiEz5P5QbCZEGg at mail dot gmail dot com>
Doug Evans <xdje42@gmail.com> skribis:
> On Mon, Jun 2, 2014 at 1:31 AM, Ludovic CourtÃs <ludo@gnu.org> wrote:
[...]
>>> +The argument @var{set-func} is a function of one argument: @var{self} which
I realized that #:set-proc (or even just #:set) would be more idiomatic.
>>> +is the @code{<gdb:parameter>} object representing the parameter.
>>> +@value{GDBN} will call this function when a @var{parameter}'s value has
>>> +been changed via the @code{set} API (for example, @kbd{set foo off}).
>>
>> It would be nicer if âset-funcâ were passed both the parameter and the
>> new value, such that it would be its responsibility to validate the
>> value and set it, but it seems that thatâs not how âcmd_sfunc_ftypeâ
>> callbacks work.
>
> I know.
> It's not my first choice either, but it's not clear to me that taking
> on redesigning this part of gdb internals would be a useful
> expenditure of time.
Yeah, understood.
>> Alternately, parameters could have just a âconversionâ function, rather
>> than a real âsetâ function, just like SRFI-39 parameters (info "(guile)
>> Parameters"). That would free users from the need to explicitly call
>> âset-parameter-value!â.
>>
>> Thoughts?
>
> I'm guessing by needing to call set-parameter-value! you mean in the
> set-func to undo a bad setting.
Exactly.
> gdb parameters are the way they are, and python parameters must
> indefinitely support the broken API.
Then it sounds like keeping the API you propose is the right strategy,
so letâs go for it.
Thanks,
Ludoâ.