diff options
| author | blasty <blasty@local> | 2026-07-09 21:05:07 +0200 |
|---|---|---|
| committer | blasty <blasty@local> | 2026-07-09 21:05:07 +0200 |
| commit | 143ec78053313c95770b02f385ec0c3ee5cf48ac (patch) | |
| tree | 3b0afb5127b27b89db226152f0a84cb3888c08a8 /tests | |
| parent | comments: ';' sets a comment on the current line (disasm + pseudocode) (diff) | |
| download | ida-tui-143ec78053313c95770b02f385ec0c3ee5cf48ac.tar.gz ida-tui-143ec78053313c95770b02f385ec0c3ee5cf48ac.tar.xz ida-tui-143ec78053313c95770b02f385ec0c3ee5cf48ac.zip | |
decompiler: hide the per-line /*0xEA*/ address markers (clutter)
Hex-Rays appends a /*0xEA*/ VMA marker to every pseudocode line (we fetch with
include_addresses). It's the only per-line address anchor the app has, so we
can't turn it off server-side without breaking follow/comments/xref-jumps.
Instead, strip it at display time: DecompView.show pulls each line's marker into
a parallel _line_eas list and highlights the cleaned text. _line_ea now reads
that list; _follow_decomp takes the line ea explicitly (was re-parsing the
marker). Stripping only edits within lines, so indices still align with the
domain's raw code (used by _decomp_line_for). Var-location comments (// [rsp+..])
are Hex-Rays output, not VMAs -> kept.
full suite 63/63.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_tui.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/test_tui.py b/tests/test_tui.py index b8eba79..2f80270 100644 --- a/tests/test_tui.py +++ b/tests/test_tui.py @@ -517,13 +517,15 @@ async def run(db): # fallback follows by address regardless of the (old) token. dstale = app.program.resolve(dsym) old_line = dec._texts[drow] if drow < len(dec._texts) else "" - if "/*0x" in old_line and dsym in old_line: + old_ea = dec._line_ea(drow) + if old_ea is not None and dsym in old_line: tmpname = f"stale_{os.getpid()}" app.program.client.call( "rename", batch={"func": {"addr": hex(dstale), "name": tmpname}}) app.program.bump_names() d2 = len(app._nav) - app._follow_decomp(old_line, dsym) # dsym is now the OLD name + # dsym is now the OLD name; follow must fall back to the line's ea + app._follow_decomp(old_line, dsym, old_ea) await wait_until(pilot, lambda: len(app._nav) > d2, timeout=25) check("decomp follow works with a stale name (ea-marker fallback)", app._cur.ea == dstale, f"cur={app._cur.ea:#x} want={dstale:#x}") @@ -631,8 +633,9 @@ async def run(db): # Add a comment on the current pseudocode line via ';' and confirm it # renders after the decompiler refreshes. - cline = next((i for i, t in enumerate(dec._texts) - if i > 5 and "/*0x" in t and t.strip() and "//" not in t), None) + cline = next((i for i in range(len(dec._texts)) + if i > 5 and dec._line_ea(i) is not None + and dec._texts[i].strip() and "//" not in dec._texts[i]), None) if cline is not None: cea = dec._line_ea(cline) dec.focus() |
