Re: [RFA 09/22] Remove make_cleanup_restore_current_ui

Simon Marchi
2016-10-09T04:31:55Z

On 2016-09-27 00:08, Tom Tromey wrote:
> +/* State for SWITCH_THRU_ALL_UIS. */
> +class switch_thru_all_uis
> {
> +public:
> +
> + switch_thru_all_uis () : iter (nullptr), save_ui (&current_ui)
> + {
> + iter = ui_list;
> + }

Hi Tom,

I just found there is a little bug here. current_ui is not set for the
first iteration, so it runs with whatever was in there before. If you
look at the previous implementation, current_ui is assigned in the _cond
function, which is executed before the first iteration. In your
version, it is assigned in the next() method, which isn't.

I noticed this because it fails gdb.mi/user-selected-context-sync.exp.

Simon