diff options
| author | blasty <blasty@local> | 2026-07-10 16:12:22 +0200 |
|---|---|---|
| committer | blasty <blasty@local> | 2026-07-10 16:12:22 +0200 |
| commit | 3b4e397f48e4519c6b5a24fede2e41707e355a92 (patch) | |
| tree | cfe046e03d4cfeddc5e6146f6ccdbb9ddc232b07 /tests/test_scenarios.py | |
| parent | app: drop the Header (keep the Footer); rpc: function-scope xrefs_from (diff) | |
| download | ida-tui-3b4e397f48e4519c6b5a24fede2e41707e355a92.tar.gz ida-tui-3b4e397f48e4519c6b5a24fede2e41707e355a92.tar.xz ida-tui-3b4e397f48e4519c6b5a24fede2e41707e355a92.zip | |
app: comment on a no-address line -> function comment (was refused)
Pressing ';' on the decompiler's signature or local-declaration lines did
nothing ('no address on this line to comment') because those lines carry
no /*0xEA*/ marker. Fall back to the current function's entry ea so
commenting the header annotates the function itself; the prompt says
'function comment @ ...'. Body-line comments are unchanged.
New scenario comment_func locks it (suite 104 green).
Diffstat (limited to 'tests/test_scenarios.py')
| -rw-r--r-- | tests/test_scenarios.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/test_scenarios.py b/tests/test_scenarios.py index 0b22f90..0cad008 100644 --- a/tests/test_scenarios.py +++ b/tests/test_scenarios.py @@ -1046,6 +1046,38 @@ async def s_rename(c: Ctx): c.check("found a pseudocode line to comment", False, "no marker line") +@scenario("comment_func") +async def s_comment_func(c: Ctx): + # Commenting the signature/declaration line (which carries no address) falls + # back to a function-level comment at the entry ea instead of being refused. + app, dec = c.app, c.dec + pick = c.pick_decomp_ref() + if pick is None: + c.check("found a function for the comment test", False) + return + fn = pick[0] + await c.open(fn.addr, "decomp") + dec.focus() + dec.cursor, dec.cursor_x = 0, 2 # the signature line + dec.refresh() + await c.pause(0.05) + c.check("signature line has no address of its own", dec._line_ea(0) is None, + f"ea={dec._line_ea(0)}") + await c.press("semicolon") + await c.pause(0.1) + ci = app.query_one("#comment", Input) + note = f"fn_note_{os.getpid()}" + c.check("';' on the signature line opens a function-comment prompt", + ci.display and "function comment" in str(ci.placeholder).lower(), + f"display={ci.display} ph={ci.placeholder!r}") + ci.value = note + await c.press("enter") + await c.wait(lambda: dec.loaded_ea == fn.addr and any(note in t for t in dec._texts), 25) + c.check("function comment appears in the pseudocode", + any(note in t for t in dec._texts), "not shown") + app.program.client.call("set_comments", items=[{"addr": hex(fn.addr), "comment": ""}]) + + @scenario("retype") async def s_retype(c: Ctx): app, dec = c.app, c.dec |
