diff options
| author | blasty <peter@haxx.in> | 2026-07-23 15:42:23 +0200 |
|---|---|---|
| committer | blasty <peter@haxx.in> | 2026-07-23 15:42:23 +0200 |
| commit | 5a2ebd1369b35ff756f1f3e3d96c847d87fe9e67 (patch) | |
| tree | 94c1290f3cdc5e919683069db36bbaa69cb00eea /tests/test_scenarios.py | |
| parent | app: 'L' opens the continuous segment listing (functions+data interleaved) (diff) | |
| download | ida-tui-5a2ebd1369b35ff756f1f3e3d96c847d87fe9e67.tar.gz ida-tui-5a2ebd1369b35ff756f1f3e3d96c847d87fe9e67.tar.xz ida-tui-5a2ebd1369b35ff756f1f3e3d96c847d87fe9e67.zip | |
listing: render opcode bytes (shared engine with disasm) — M4/UX step 1
The flat listing was a subset of the disasm view (no opcodes). Now the listing
carries an opcode-bytes column with the same format + o toggle: Head gains a raw
field, ListingModel fills it for code heads via one bulk read per page (bounded,
variable-length safe) + tracks the widest opcode; ListingView renders/pads the
column, settling width as pages stream in. render_line/_line_plain share the
addr+opcodes+label+mnem/text layout with DisasmView.
Test harness all_funcs() reloads the index if a prior bump_items() cleared it
(was crashing biggest() with max([])).
Verified: code heads carry raw (max_raw_len 11); listing suite + continuous_view
opcode-parity 26/0.
Diffstat (limited to 'tests/test_scenarios.py')
| -rw-r--r-- | tests/test_scenarios.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/test_scenarios.py b/tests/test_scenarios.py index b921c54..b441a2c 100644 --- a/tests/test_scenarios.py +++ b/tests/test_scenarios.py @@ -117,7 +117,10 @@ class Ctx: # -- discovery -------------------------------------------------------- # def all_funcs(self): - return self.prog.functions().all_loaded() + idx = self.prog.functions() + if len(idx) == 0 and not idx.complete: + idx.load_all() # a prior bump_items() cleared the index cache + return idx.all_loaded() def find_func(self, pred, limit=400): for f in self.all_funcs()[:limit]: @@ -1629,6 +1632,13 @@ async def s_continuous_view(c: Ctx): kinds = {c.lst.model.get(i).kind for i in range(len(c.lst.model))} c.check("continuous listing interleaves code with data/undefined", "code" in kinds and ("data" in kinds or "unknown" in kinds), str(kinds)) + # rendering parity with disasm: code lines carry opcode bytes + cidx = next((i for i in range(len(c.lst.model)) + if c.lst.model.get(i).kind == "code"), None) + c.check("continuous listing renders opcode bytes (parity with disasm)", + cidx is not None and c.lst.model.get(cidx).raw + and c.lst._op_field(c.lst.model.get(cidx)).strip() != "", + f"raw={c.lst.model.get(cidx).raw if cidx is not None else None!r}") # --------------------------------------------------------------------------- # |
