From 986abcaf21ee2ebf4f5b48f7fc5b05833fa55d34 Mon Sep 17 00:00:00 2001 From: blasty Date: Thu, 9 Jul 2026 15:44:11 +0200 Subject: fix: pseudocode names not refreshing across history after rename MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit force_recompile takes 'items=[{addr}]', not 'addr' — my call raised and was swallowed, so the Hex-Rays cache was never cleared and a caller's cached pseudocode kept showing the old callee name on 'back' (disasm refreshed because its names are live). Use the correct params. History test now also caches and verifies the caller's pseudocode. pilot suite 52/52. --- idatui/domain.py | 2 +- tests/test_tui.py | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/idatui/domain.py b/idatui/domain.py index 1f52be6..55a95d5 100644 --- a/idatui/domain.py +++ b/idatui/domain.py @@ -426,7 +426,7 @@ class Program: # Cached before a rename: names may be stale. Drop the server's # Hex-Rays cache so the refetch reflects the new names. try: - self.client.call("force_recompile", addr=hex(ea)) + self.client.call("force_recompile", items=[{"addr": hex(ea)}]) except Exception: # noqa: BLE001 pass envelope = self.client.call_envelope("decompile", addr=hex(ea)) diff --git a/tests/test_tui.py b/tests/test_tui.py index 3b45ef9..18194bf 100644 --- a/tests/test_tui.py +++ b/tests/test_tui.py @@ -533,6 +533,11 @@ async def run(db): table.move_cursor(row=biggest_i) await pilot.press("enter") await wait_until(pilot, lambda: dis.total > 0, timeout=20) + bea = app._cur.ea + # cache the caller's pseudocode too, so the stale-decomp path is exercised + await pilot.press("tab") + await wait_until(pilot, lambda: dec.loaded_ea == bea, timeout=20) + await pilot.press("tab") dis.focus() await pilot.pause(0.2) hrow = hsym = None @@ -587,8 +592,15 @@ async def run(db): dis.model.lines(hrow, 4, prefetch=False) await pilot.pause(0.2) hline = dis._line_plain(hrow) - check("caller shows renamed callee after 'back' (cache refresh)", + check("caller disasm shows renamed callee after 'back'", hline is not None and hnew in hline, f"line={hline!r}") + # and the caller's cached pseudocode must refresh too + await pilot.press("tab") + await wait_until(pilot, lambda: dec.loaded_ea == bea, timeout=25) + await pilot.pause(0.3) + check("caller pseudocode shows renamed callee after 'back'", + any(hnew in tx for tx in dec._texts), + "pseudocode still stale") app.program.client.call( "rename", batch={"func": {"addr": hex(htarget), "name": hsym}}) -- cgit v1.3.1-sl0p