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: [RFA 09/22] Remove make_cleanup_restore_current_ui


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


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