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: [PATCH v2 16/18] Make the completion API completely opaque.


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.


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