aboutsummaryrefslogtreecommitdiffstats
path: root/idatui/trace_ctl.py
diff options
context:
space:
mode:
authorblasty <blasty@local>2026-08-07 00:33:12 +0200
committerblasty <blasty@local>2026-08-07 00:33:28 +0200
commit2b0ae8df463edb597007186688ee557c18f1ac18 (patch)
tree006045dd73f4049d98e20a8c0830406490445f08 /idatui/trace_ctl.py
parentlaunch: the sweep could delete the file it was asked to open (diff)
downloadida-tui-2b0ae8df463edb597007186688ee557c18f1ac18.tar.gz
ida-tui-2b0ae8df463edb597007186688ee557c18f1ac18.tar.xz
ida-tui-2b0ae8df463edb597007186688ee557c18f1ac18.zip
diag: somewhere for swallowed errors to go
A TUI must not die because one background load failed, so this codebase catches broadly -- ~50 `except Exception` sites, two dozen resolving to `pass`. Right policy, one bad consequence: with 44 `@work(thread=True)` workers, a failure in a background load leaves no trace whatsoever. The view stays empty and there is nothing to read afterwards, because the app owns the screen. kittygfx already solved this for itself with $IDATUI_KITTY_LOG. idatui/diag.py is the same idea for everything else: $IDATUI_LOG writes every swallowed error plus its traceback to a file, and the last 50 are kept in memory regardless so a driver can ask a live app what went wrong. Unset, it costs an environ lookup. Wired in where losing the error changes a DECISION rather than just a pixel: * rename: a resolve() that throws renames as DATA instead of as a function. * name: a function_of() that throws means we never learn the address is a function start, so the index keeps the old name and every readback says the rename didn't happen. * retype: a resolve() that throws retypes the ENCLOSING function instead. * decompile: a failed full-body fetch silently returns CLIPPED pseudocode. * trail: a failed decomp_map stops the pseudocode being painted, silently. Deliberately NOT wired into the query_one guards -- a modal owning the screen is normal and constant, and logging it would bury the real entries in noise. New RPC verb `diag {n?, clear?}`, documented in docs/RPC.md: the answer to "the verb reported success and the pane shows nothing". Also a flake, same shape as the others: follow_xrefs waited on the nav depth but asserted on _cur, and a follow pushes the source entry BEFORE opening the target -- so the check could run in between and see the function it jumped from. About one run in ten. It waits on the postcondition it asserts now; three clean full runs since. 833 checks; --fast is 344 in 3.5s.
Diffstat (limited to 'idatui/trace_ctl.py')
-rw-r--r--idatui/trace_ctl.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/idatui/trace_ctl.py b/idatui/trace_ctl.py
index 46d4b17..8072801 100644
--- a/idatui/trace_ctl.py
+++ b/idatui/trace_ctl.py
@@ -21,6 +21,8 @@ import bisect
import os
from typing import TYPE_CHECKING
+from . import diag
+
if TYPE_CHECKING: # pragma: no cover
from .app import IdaTui
@@ -264,7 +266,10 @@ class TraceController:
# or twice, once for each of two parallel maps — would be felt.
try:
app._apply_split_map(ea, app.program.decomp_map(ea))
- except Exception: # noqa: BLE001
+ except Exception as e: # noqa: BLE001
+ # The pseudocode simply stops being painted with the trail, with
+ # nothing on screen to say why.
+ diag.note(f"trail: decomp_map({ea:#x})", e)
self.trail_map, self.trail_map_ea = [], ea
self.trail_line_of, self.trail_eas = {}, []
self.trail_span = None