From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sonic312-26.consmr.mail.ir2.yahoo.com (sonic312-26.consmr.mail.ir2.yahoo.com [77.238.178.97]) by sourceware.org (Postfix) with ESMTPS id 6D1FF385701E for ; Mon, 25 Jan 2021 17:31:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6D1FF385701E X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1611595900; bh=fbja6vCa4F42UDWAa81yTQnJeTTr+tiwM6PL1ikvUEN=; h=Date:From:To:Subject:From:Subject:Reply-To; b=ALCA+rPTonTvFEFu4H5b5gq1bd8pDo22goMhbG70QaE/hg6XeT7a0oCt3NWpbGm0NpjjbY7KTjtRcGA95I6KcTvJaSGP7ZNjy3EWPoVsyzn+9QOL9dG11c3LnBkgA3TQD4I/IYs9dNqo4eimvy61zZ55iReIkgQFLu/4xFme870MSFuKJFqVav3SPqTe7JPK/3oGn39Dz+mAyt5gDwZH9+5I5DzIGNx7hnL7JeTLU2jG7ogBK6jKlbL2eY7xNwEsnjeg4GnRSgAGA/Nf8YIpfl8nQ4IQ4U7glPWllvBSidzzEpH5/5TwdOjfIKFXW6WOnHr5BVhLBNt93/L6iQc3Tw== X-YMail-OSG: cVRc5q8VM1nxB0qcj.q1OP7AFX46S2gjCAvai285k0EUOXLkIZgnLWYl24E.SBh UFmVyET5oApi3Kefr7nCUKLLHz6llDFzx2Hl24UASis9oOnTkGloEhX8BqMXuBliO.zETVcyg6E4 2vmbvPlsvRglLkUnM29qsZ9a3Q0K94li0LOSopJ3vI.Hqx4ZiVd4MBCBDBCSwMJxcFZa2cyP.yYf WMWFyCl1lYDV5_Yh_34yHKwZJ57mVldWl3bbM0BGIBYy37NHFVwi_atIxuUA9u6WfJvfNLSB6Bo7 XLnrrRIFh_Abo6xF6_u3L4mbvUJMIxU3BN6n2rS9lMgPq..6.SABhI0JZ3Q0xpws4XnnlMu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jDxpH.OnVCF1Ute68RvL5ydKpbJ6kuPQSklR6RjB.ti10OkqTdAXmpEq e6Td40LRrw.OzQGRChxCWje5C006VRszdGxzm7AMSOomP Received: from sonic.gate.mail.ne1.yahoo.com by sonic312.consmr.mail.ir2.yahoo.com with HTTP; Mon, 25 Jan 2021 17:31:40 +0000 Date: Mon, 25 Jan 2021 17:31:35 +0000 (UTC) From: Hannes Domani To: Andrew Burgess Cc: "gdb-patches@sourceware.org" , Tom Tromey Message-ID: <1272741195.4862754.1611595895785@mail.yahoo.com> In-Reply-To: <20210125161841.GF265215@embecosm.com> References: <20210105135549.5704-1-ssbssa.ref@yahoo.de> <20210105135549.5704-1-ssbssa@yahoo.de> <20210125161841.GF265215@embecosm.com> Subject: Re: [PATCH v2] Don't add window duplicates to tui_windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Mailer: WebService/1.1.17501 YMailNorrin Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:76.0) Gecko/20100101 Firefox/76.0 X-Spam-Status: No, score=-9.1 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2021 17:31:43 -0000 Am Montag, 25. Januar 2021, 17:19:16 MEZ hat Andrew Burgess Folgendes geschrieben: > * Hannes Domani via Gdb-patches [2021-01-05 = 14:55:49 +0100]: > > > Otherwise, each time a window size is changed with 'winheight', all win= dows > > are duplicated, and when done multiple times, slows down redrawing. > > > > gdb/ChangeLog: > > > > 2021-01-05=C2=A0 Hannes Domani=C2=A0 > > > >=C2=A0=C2=A0=C2=A0=C2=A0 * tui/tui-layout.c (tui_apply_current_layout): = Add add_window > >=C2=A0=C2=A0=C2=A0=C2=A0 argument to apply function. > >=C2=A0=C2=A0=C2=A0=C2=A0 (tui_layout_window::apply): Likewise. > >=C2=A0=C2=A0=C2=A0=C2=A0 (tui_layout_split::adjust_size): Likewise. > >=C2=A0=C2=A0=C2=A0=C2=A0 (tui_layout_split::apply): Likewise. > >=C2=A0=C2=A0=C2=A0=C2=A0 * tui/tui-layout.h (class tui_layout_base): Lik= ewise. > >=C2=A0=C2=A0=C2=A0=C2=A0 (class tui_layout_window): Likewise. > >=C2=A0=C2=A0=C2=A0=C2=A0 (class tui_layout_split): Likewise. > > --- > > v2: > > - Use new add_window argument to decide if window should be added to > >=C2=A0 tui_windows. > > --- > >=C2=A0 gdb/tui/tui-layout.c | 19 ++++++++++++------- > >=C2=A0 gdb/tui/tui-layout.h |=C2=A0 7 ++++--- > >=C2=A0 2 files changed, 16 insertions(+), 10 deletions(-) > > > > diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c > > index d6e299b00f1..fc1b65d8799 100644 > > --- a/gdb/tui/tui-layout.c > > +++ b/gdb/tui/tui-layout.c > > @@ -85,7 +85,7 @@ tui_apply_current_layout () > >=C2=A0=C2=A0=C2=A0 for (tui_win_info *win_info : saved_tui_windows) > >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 win_info->make_visible (false); > > > > -=C2=A0 applied_layout->apply (0, 0, tui_term_width (), tui_term_height= ()); > > +=C2=A0 applied_layout->apply (0, 0, tui_term_width (), tui_term_height= (), true); > > > >=C2=A0=C2=A0=C2=A0 /* Keep the list of internal windows up-to-date.=C2= =A0 */ > >=C2=A0=C2=A0=C2=A0 for (int win_type =3D SRC_WIN; (win_type < MAX_MAJOR_= WINDOWS); win_type++) > > @@ -416,7 +416,8 @@ tui_layout_window::clone () const > >=C2=A0 /* See tui-layout.h.=C2=A0 */ > > > >=C2=A0 void > > -tui_layout_window::apply (int x_, int y_, int width_, int height_) > > +tui_layout_window::apply (int x_, int y_, int width_, int height_, > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 bool add_window) > >=C2=A0 { > >=C2=A0=C2=A0=C2=A0 x =3D x_; > >=C2=A0=C2=A0=C2=A0 y =3D y_; > > @@ -424,7 +425,8 @@ tui_layout_window::apply (int x_, int y_, int width= _, int height_) > >=C2=A0=C2=A0=C2=A0 height =3D height_; > >=C2=A0=C2=A0=C2=A0 gdb_assert (m_window !=3D nullptr); > >=C2=A0=C2=A0=C2=A0 m_window->resize (height, width, x, y); > > -=C2=A0 tui_windows.push_back (m_window); > > +=C2=A0 if (add_window) > > +=C2=A0=C2=A0=C2=A0 tui_windows.push_back (m_window); > >=C2=A0 } > > I wondered if there was a solution to this problem that would remove > the need to update some global state from the ::apply function. > > I came up with the patch below.=C2=A0 What do you think? I think this is fine, I only have one question below. > This also includes a test that covers this issue, when I run the test > under valgrind it highlights that GDB tries to free the same object > multiple times. > > Thanks, > Andrew > > > --- > > commit 3d47fcb70e234d08ab2e47c1527bca081846b8ee > Author: Andrew Burgess > Date:=C2=A0 Mon Jan 25 15:46:58 2021 +0000 > >=C2=A0=C2=A0=C2=A0=C2=A0 gdb/tui: don't add windows to global list from tu= i_layout:window::apply >=C2=A0=C2=A0 =C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 This commit was inspired by this mailing list pat= ch: >=C2=A0=C2=A0 =C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 https://sourceware.org/pipermail/gdb-= patches/2021-January/174713.html >=C2=A0=C2=A0 =C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 Currently, calling tui_layout_window::apply will = add the window from >=C2=A0=C2=A0=C2=A0=C2=A0 the layout object to the global tui_windows list. >=C2=A0=C2=A0 =C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 Unfortunately, when the user runs the 'winheight'= command, this calls >=C2=A0=C2=A0=C2=A0=C2=A0 tui_adjust_window_height, which calls the tui_lay= out_base::adjust_size >=C2=A0=C2=A0=C2=A0=C2=A0 function, which can then call tui_layout_base::ap= ply.=C2=A0 The consequence >=C2=A0=C2=A0=C2=A0=C2=A0 of this is that when the user does 'winheight' du= plicate copies of a >=C2=A0=C2=A0=C2=A0=C2=A0 window can be added to the global tui_windows lis= t. >=C2=A0=C2=A0 =C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 The original patch fixed this by changing the app= ly function to only >=C2=A0=C2=A0=C2=A0=C2=A0 update the global list some of the time. >=C2=A0=C2=A0 =C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 This patch takes a different approach.=C2=A0 The = apply function no longer >=C2=A0=C2=A0=C2=A0=C2=A0 updates the global tui_windows list.=C2=A0 Instea= d a new virtual function >=C2=A0=C2=A0=C2=A0=C2=A0 is added to tui_layout_base which is used to gath= er all the currently >=C2=A0=C2=A0=C2=A0=C2=A0 applied windows into a vector.=C2=A0 Finally tui_= apply_current_layout is >=C2=A0=C2=A0=C2=A0=C2=A0 updated to make use of this new function to updat= e the tui_windows >=C2=A0=C2=A0=C2=A0=C2=A0 list. >=C2=A0=C2=A0 =C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 The benefits I see in this approach are, (a) the = apply function now no >=C2=A0=C2=A0=C2=A0=C2=A0 longer touches global state, this solves the imme= diate problem, >=C2=A0=C2=A0=C2=A0=C2=A0 and (b) now that tui_windows is updated directly = in the function >=C2=A0=C2=A0=C2=A0=C2=A0 tui_apply_current_layout, we can drop the saved_t= ui_windows global. >=C2=A0=C2=A0 =C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 gdb/ChangeLog: >=C2=A0=C2=A0 =C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 *= tui-layout.c (saved_tui_windows): Delete. >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (= tui_apply_current_layout): Don't make use of saved_tui_windows, >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 c= all new get_windows member function instead. >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (= tui_get_window_by_name): Check in tui_windows. >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (= tui_layout_window::apply): Don't add to tui_windows. >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 *= tui-layout.h (tui_layout_base::get_windows): New member function. >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (= tui_layout_window::get_windows): Likewise. >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (= tui_layout_split::get_windows): Likewise. >=C2=A0=C2=A0 =C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 gdb/testsuite/ChangeLog: >=C2=A0=C2=A0 =C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 *= gdb.tui/winheight.exp: Add more tests. > > diff --git a/gdb/testsuite/gdb.tui/winheight.exp b/gdb/testsuite/gdb.tui/= winheight.exp > index 38fb29c3829..04de35d2f45 100644 > --- a/gdb/testsuite/gdb.tui/winheight.exp > +++ b/gdb/testsuite/gdb.tui/winheight.exp > @@ -36,3 +36,17 @@ Term::check_box "smaller source box" 0 0 80 10 > > Term::command "winheight cmd -5" > Term::check_box "larger source box" 0 0 80 15 > + > +Term::command "winheight src -5" > +Term::check_box "smaller source box again" 0 0 80 10 > + > +Term::command "winheight src +5" > +Term::check_box "larger source box again" 0 0 80 15 > + > +# At one point we had a bug where adjusting the winheight would result > +# in GDB keeping hold of duplicate window pointers, which it might > +# then try to delete when the layout was changed.=C2=A0 Running this tes= t > +# under valgrind would expose that bug. > +Term::command "layout asm" > +Term::check_box "check for asm window" 0 0 80 15 > + > diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c > index d6e299b00f1..adb99852da2 100644 > --- a/gdb/tui/tui-layout.c > +++ b/gdb/tui/tui-layout.c > @@ -64,11 +64,6 @@ static tui_layout_split *asm_regs_layout; > /* See tui-data.h.=C2=A0 */ > std::vector tui_windows; > > -/* When applying a layout, this is the list of all windows that were > -=C2=A0 in the previous layout.=C2=A0 This is used to re-use windows when > -=C2=A0 changing a layout.=C2=A0 */ > -static std::vector saved_tui_windows; > - > /* See tui-layout.h.=C2=A0 */ > > void > @@ -79,10 +74,7 @@ tui_apply_current_layout () > >=C2=A0=C2=A0 extract_display_start_addr (&gdbarch, &addr); > > -=C2=A0 saved_tui_windows =3D std::move (tui_windows); > -=C2=A0 tui_windows.clear (); > - > -=C2=A0 for (tui_win_info *win_info : saved_tui_windows) > +=C2=A0 for (tui_win_info *win_info : tui_windows) >=C2=A0=C2=A0=C2=A0=C2=A0 win_info->make_visible (false); > >=C2=A0=C2=A0 applied_layout->apply (0, 0, tui_term_width (), tui_term_heig= ht ()); > @@ -96,25 +88,33 @@ tui_apply_current_layout () >=C2=A0=C2=A0 /* This should always be made visible by a layout.=C2=A0 */ >=C2=A0=C2=A0 gdb_assert (TUI_CMD_WIN->is_visible ()); > > +=C2=A0 /* Get the new list of currently visible windows.=C2=A0 */ > +=C2=A0 std::vector new_tui_windows; > +=C2=A0 applied_layout->get_windows (&new_tui_windows); > + >=C2=A0=C2=A0 /* Now delete any window that was not re-applied.=C2=A0 */ >=C2=A0=C2=A0 tui_win_info *focus =3D tui_win_with_focus (); >=C2=A0=C2=A0 tui_win_info *locator =3D tui_locator_win_info_ptr (); > -=C2=A0 for (tui_win_info *win_info : saved_tui_windows) > +=C2=A0 for (tui_win_info *win_info : tui_windows) >=C2=A0=C2=A0=C2=A0=C2=A0 { >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (!win_info->is_visible ()) >=C2=A0=C2=A0=C2=A0=C2=A0 { > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* If we're about to delete the window wi= th focus then don't. > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 This will be deleted later on= ce we have selected an > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 alternative window to focus o= n.=C2=A0 */ >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (focus =3D=3D win_info) > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 tui_set_win_focus_to (tui_win= dows[0]); > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 tui_set_win_focus_to (new_tui= _windows[0]); >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (win_info !=3D locator) >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 delete win_info; >=C2=A0=C2=A0=C2=A0=C2=A0 } >=C2=A0=C2=A0=C2=A0=C2=A0 } > > +=C2=A0 tui_windows.clear (); Isn't this clear() redundant? > +=C2=A0 tui_windows =3D std::move (new_tui_windows); > + >=C2=A0=C2=A0 if (gdbarch =3D=3D nullptr && TUI_DISASM_WIN !=3D nullptr) >=C2=A0=C2=A0=C2=A0=C2=A0 tui_get_begin_asm_address (&gdbarch, &addr); >=C2=A0=C2=A0 tui_update_source_windows_with_addr (gdbarch, addr); > - > -=C2=A0 saved_tui_windows.clear (); > } > > /* See tui-layout.=C2=A0 */ > @@ -354,7 +354,7 @@ static std::unordered_map *known_window_types; > static tui_win_info * > tui_get_window_by_name (const std::string &name) > { > -=C2=A0 for (tui_win_info *window : saved_tui_windows) > +=C2=A0 for (tui_win_info *window : tui_windows) >=C2=A0=C2=A0=C2=A0=C2=A0 if (name =3D=3D window->name ()) >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return window; > > @@ -424,7 +424,6 @@ tui_layout_window::apply (int x_, int y_, int width_,= int height_) >=C2=A0=C2=A0 height =3D height_; >=C2=A0=C2=A0 gdb_assert (m_window !=3D nullptr); >=C2=A0=C2=A0 m_window->resize (height, width, x, y); > -=C2=A0 tui_windows.push_back (m_window); > } > > /* See tui-layout.h.=C2=A0 */ > diff --git a/gdb/tui/tui-layout.h b/gdb/tui/tui-layout.h > index 193f42de420..f89166eae37 100644 > --- a/gdb/tui/tui-layout.h > +++ b/gdb/tui/tui-layout.h > @@ -91,6 +91,9 @@ class tui_layout_base >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 depth of this layout in the hierarchy= (zero-based).=C2=A0 */ >=C2=A0=C2=A0 virtual void specification (ui_file *output, int depth) =3D 0= ; > > +=C2=A0 /* Add all windows to the WINDOWS vector.=C2=A0 */ > +=C2=A0 virtual void get_windows (std::vector *windows) = =3D 0; > + >=C2=A0=C2=A0 /* The most recent space allocation.=C2=A0 */ >=C2=A0=C2=A0 int x =3D 0; >=C2=A0=C2=A0 int y =3D 0; > @@ -141,6 +144,12 @@ class tui_layout_window : public tui_layout_base > >=C2=A0=C2=A0 void specification (ui_file *output, int depth) override; > > +=C2=A0 /* See tui_layout_base::get_windows.=C2=A0 */ > +=C2=A0 void get_windows (std::vector *windows) override > +=C2=A0 { > +=C2=A0=C2=A0=C2=A0 windows->push_back (m_window); > +=C2=A0 } > + > protected: > >=C2=A0=C2=A0 void get_sizes (bool height, int *min_value, int *max_value) = override; > @@ -195,6 +204,13 @@ class tui_layout_split : public tui_layout_base > >=C2=A0=C2=A0 void specification (ui_file *output, int depth) override; > > +=C2=A0 /* See tui_layout_base::get_windows.=C2=A0 */ > +=C2=A0 void get_windows (std::vector *windows) override > +=C2=A0 { > +=C2=A0=C2=A0=C2=A0 for (auto &item : m_splits) > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 item.layout->get_windows (windows); > +=C2=A0 } > + > protected: > >=C2=A0=C2=A0 void get_sizes (bool height, int *min_value, int *max_value) = override;