This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2 16/18] Make the completion API completely opaque.
- From: Doug Evans <dje at google dot com>
- To: Keith Seitz <keiths at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 21 May 2015 23:52:16 +0000
- Subject: Re: [PATCH v2 16/18] Make the completion API completely opaque.
- Authentication-results: sourceware.org; auth=none
Keith Seitz writes:
> Now that the completion API is passing around a structure holding
> its internal data, there is no need to expose any of this data and
> other settings to other modules.
>
> This patch removes global access to max_completions and
> introduces a new API function, get_maximum_completions (void), which
> other modules may use to query the current completion maximum.
>
> The API will be expanded as necessary in subsequent patches.
>
> gdb/ChangeLog
>
> * cli/cli-cmds.c (complete_command): Use get_maximum_completions
> instead of accessing the global max_completions.
> * completer.c (max_completions): Move definition earlier and
> make static.
> (get_maximum_completions): New function.
> (throw_max_completions_reached_error): Add comment.
> * completer.h (max_completions): Remove declaration.
> (get_maximum_completions): New declaration.
LGTM.
Note though that it's not uncommon to expose gdb parameters
via a global.