Re: [PATCH 3/3] suppress notification

Yao Qi
2012-08-28T13:50:06Z

On 08/28/2012 09:39 PM, Pedro Alves wrote:
>
> Alternatively, set the notification suppression down in the command callback itself.
> I mention it for completeness. Maybe you've considered it, and decided against it.
>

Are you suggesting that we can set breakpoint suppression flag in each
breakpoint related CLI commands, such as "delete breakpoint", "disable
breakpoint", and so forth?

>> >
>> >Ideally, we can do this in a more-OO'ed manner,
>> >
>> > 1 add a new field 'int called' in 'struct mi_cmd',
>> > 2 set 'parse->cmd->called' in mi_cmd_execute to 1 and set it back to 0 when it is done.
>> > 3 pass 'struct mi_cmd *' to each MI command function, for example change function mi_breakpoint_created to
>> >
>> > mi_breakpoint_created (struct mi_cmd *self, struct breakpoint *b)
>> >
>> > 4 inside each MI command function, return early if self->called is 1. Then, we can get rid of mi_suppress_notification completely.
> Confused. mi_breakpoint_created is not a MI command function, but rather a
> notification observer. Whoever calls the observers (observer_notify_breakpoint_created)
> is disconnected from commands, and I don't see that the coupling would be a good idea.
>

Oops, my brain stopped working at that moment. Sorry for the confusion,
and please ignore it.

--
Yao