From b13b1f181483dfb61d1be1d666f1595b4e7d504f Mon Sep 17 00:00:00 2001 From: blasty Date: Fri, 24 Jul 2026 16:43:36 +0200 Subject: decomp: restore the 'decompiling…' overlay on F5/Tab from the listing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The F5/Tab-from-listing path decompiled the function inside _decomp_from_listing (via _decomp_line_for) in a background thread with no overlay, THEN _show_active re-decompiled it -- but that second call hit the cache and returned instantly, so dec.loading was set and cleared within a frame and the overlay only flashed. The long wait (the real decompile) happened with nothing on screen. Raise the pseudocode pane + loading overlay synchronously in action_toggle_view before launching the background decompile, so the wait is covered. Non-function F5 restores the listing via _decomp_from_listing_failed. Pilot view_toggle now drives the real path (action_toggle_view from the listing) and asserts the overlay is raised synchronously; F5 paths (decomp_fallback, continuous_view, region_define) all still pass (20/20 + view_toggle 7/7). --- idatui/app.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'idatui') diff --git a/idatui/app.py b/idatui/app.py index 3e84c6f..e0f455d 100644 --- a/idatui/app.py +++ b/idatui/app.py @@ -2958,6 +2958,17 @@ class IdaTui(App): if ea is None: self._status("no address here to decompile") return + # Raise the pseudocode pane + 'decompiling…' overlay NOW, before the + # background decompile runs — otherwise the (cold) decompile happens in + # _decomp_from_listing first and _show_active's re-decompile is cached, + # so the overlay only flashes for an instant. + dec = self.query_one(DecompView) + self.query_one(ListingView).display = False + self.query_one(HexView).display = False + dec.display = True + dec.loading = True + dec.focus() + self._status("decompiling\u2026") self._decomp_from_listing(ea) return # active == "decomp": F5/Tab returns to the linear listing. @@ -3005,12 +3016,20 @@ class IdaTui(App): fn = self.program.function_of(ea) if fn is None: self.app.call_from_thread( - self._status, + self._decomp_from_listing_failed, "F5 — cursor is not inside a defined function ('p' to make one)") return dec_idx = self._decomp_line_for(fn.addr, ea) self.app.call_from_thread(self._enter_decomp, fn.addr, fn.name, dec_idx) + def _decomp_from_listing_failed(self, msg: str) -> None: + # We optimistically raised the pseudocode overlay; drop back to the + # listing since there's nothing to decompile here. + self.query_one(DecompView).loading = False + self._active = "listing" + self._show_active() + self._status(msg) + def _enter_decomp(self, fn_addr: int, fn_name: str, dec_idx: int) -> None: # Snapshot the listing position so F5/Tab returns exactly here. lst = self.query_one(ListingView) -- cgit v1.3.1-sl0p