From 33bd85e41221a82a8ee7b71d39eda59d89b78ee7 Mon Sep 17 00:00:00 2001 From: blasty Date: Fri, 10 Jul 2026 16:17:50 +0200 Subject: drive: ergonomic RE helper over the RPC socket (terse text, auto socket) Driving via rpcclient meant re-exporting the socket every fresh shell, long invocations, and piping ~every call through python -c to pull one field or grep pseudocode. idatui.drive fixes that: it auto-resolves the socket (the single live pane from the registry), prints compact text instead of JSON, and bundles the common gestures: where | go | pc [substr] | dis [n] | callees/callers | names | rename | mv old=new... | note | screen | raw k=v So 'goto+rename+parse' becomes 'drive rename old new', and 'pseudocode | python -c grep' becomes 'drive pc fn needle'. rpcclient stays the raw transport. rpc_smoke drives it end-to-end (29 green). --- tests/rpc_smoke.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests') diff --git a/tests/rpc_smoke.py b/tests/rpc_smoke.py index fe2b79b..a38162e 100644 --- a/tests/rpc_smoke.py +++ b/tests/rpc_smoke.py @@ -248,6 +248,16 @@ async def run(db): except Exception: # noqa: BLE001 pass + # --- ergonomic driver (idatui.drive) over the same socket ---------- # + # (c is closed now, so the single-driver gate lets drive connect.) + from idatui import drive + loop = asyncio.get_running_loop() + for cmd in (["where"], ["pc", target["name"]], ["callees", target["name"]], + ["names", "sub_", "3"]): + rc = await loop.run_in_executor( + None, lambda a=cmd: drive.main(["--sock", sock, *a])) + check(f"drive {cmd[0]} runs against the socket", rc == 0, f"rc={rc}") + # --- graceful quit (last: it tears the app down) ------------------- # r2, w2 = await asyncio.open_unix_connection(sock) c2 = Conn(r2, w2) -- cgit v1.3.1-sl0p