aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorblasty <blasty@local>2026-07-23 15:42:23 +0200
committerblasty <blasty@local>2026-07-23 15:42:23 +0200
commit638e3de3bf948fec8e1a0adfa89cbcde487cdeb8 (patch)
tree5920400c4bc17cabe0fd8bfd4b82c921033900cf /tests
parentapp: 'L' opens the continuous segment listing (functions+data interleaved) (diff)
downloadida-tui-638e3de3bf948fec8e1a0adfa89cbcde487cdeb8.tar.gz
ida-tui-638e3de3bf948fec8e1a0adfa89cbcde487cdeb8.tar.xz
ida-tui-638e3de3bf948fec8e1a0adfa89cbcde487cdeb8.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')
-rw-r--r--tests/test_scenarios.py12
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}")
# --------------------------------------------------------------------------- #