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 4/6] new add_setshow_enum_cmd_with_notif and scheduler-locking.


On 07/24/2012 09:50 PM, Tom Tromey wrote:
>>>>>> "Yao" == Yao Qi <yao@codesourcery.com> writes:
> 
> Yao> 2012-07-23  Yao Qi  <yao@codesourcery.com>
> Yao> 	* cli/cli-decode.c (add_setshow_enum_cmd_with_notif): New.
> Yao> 	* command.h: Declare.
> Yao> 	* infrun.c (_initialize_infrun): Call
> Yao>  	add_setshow_enum_cmd_with_notif.
> 
> This part seems fine, though of course pending on the earlier patch and
> discussion about the overall approach.
> 
> I wish there were a nice way to do without yet another
> command-registration function.  We already have a dizzying variety.

I can think of one way.  Do it like deprecate_cmd (and I think we have
other examples, but I'm not finding them now) -- make add_setshow_enum_cmd
return the command handle, and add a set_cmd_wants_notif or something function
that takes the command handle as argument, and sets the boolean.

IOW, the code that installs the command would do

  c = add_setshow_enum_cmd(...);
  set_cmd_wants_notif (c);

-- 
Pedro Alves


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