diff options
| -rw-r--r-- | idatui/domain.py | 2 | ||||
| -rw-r--r-- | 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}}) |
