From de2fa194278bb132e23edddd65bdad84f32ec37d Mon Sep 17 00:00:00 2001 From: blasty Date: Fri, 24 Jul 2026 23:38:30 +0200 Subject: split-view phase 3: rich per-line instruction region highlight MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Ghidra "region band": moving the pseudocode cursor now lights up EVERY instruction that C line owns, not just one. * server/patch_server.py: new decomp_map tool — sweeps cfunc.get_line_item across each pseudocode line's columns and collects the ea from each item's dstr() ('EA: desc', matching the /*ea*/ marker source so it aligns with the display lines). Returns {addr, lines:[{ea, eas:[...]}]}. (First tried item.get_ea(), which reports a different ea and didn't align — dstr() is the right source.) * domain: Program.decomp_map(ea) -> per-line ea lists, cached by name-gen. * app: _load_split_map fetches it off-thread into _split_eamap/_split_ea2line; _sync_split bands the full instruction region for a C line (decomp drives) and uses the exact ea->line inverse (listing drives), falling back to the single marker until the map lands. Maps cleared on leaving split. Pilot split_view gains: decomp_map returns/aligns with the markers, and a multi-instruction C line bands >1 listing row (13/13). Full suite 154/2-flake. The idalib spike ran on the pilot's own worker (the standalone worker kept getting reaped in this sandbox). --- docs/SPLIT_VIEW.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/SPLIT_VIEW.md b/docs/SPLIT_VIEW.md index 740ae90..a8546fa 100644 --- a/docs/SPLIT_VIEW.md +++ b/docs/SPLIT_VIEW.md @@ -78,9 +78,15 @@ decomp→listing uses `ListingModel.ensure_ea`. Tab re-links from the new driver Still single-ea per line (one instruction highlighted); the region comes in phase 3. -**Phase 3 — rich highlight.** `decomp_map` custom tool (line → ea-set) stored on -`Decompilation`; highlight the whole instruction range of a C line; tighten the -reverse map. One custom tool + an idalib spike to confirm the sweep works. +**Phase 3 — rich highlight. DONE.** `decomp_map` custom tool +(`server/patch_server.py`) sweeps `cfunc.get_line_item` across every column of +each pseudocode line and collects the EAs from each item's `dstr()` (`'EA: desc'` +— the same source as the `/*ea*/` marker, so it aligns). `Program.decomp_map(ea)` +returns the per-line ea lists (cached by name-gen); the app loads it async into +`_split_eamap` / `_split_ea2line` and `_sync_split` bands the **whole** instruction +region of a C line (and uses the exact ea→line inverse for the reverse). Falls +back to the single marker until the map lands. Verified on the pilot's real worker +(alignment + multi-instruction region band). **Phase 4 — polish.** Navigation keeps both panes on the same function; loop/goto edge cases; decompile-failed fallback; min-width gate + resize; split state in -- cgit v1.3.1-sl0p