aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorblasty <blasty@local>2026-07-23 22:01:21 +0200
committerblasty <blasty@local>2026-07-23 22:01:21 +0200
commit4a3cf34f845e1865b2c1e663b2369ddbc490f5e6 (patch)
tree1910467ac5161e5a03e3fd801244713c2497e529 /server
parentfix: don't let a late navigation steal focus from an open prompt (diff)
downloadida-tui-4a3cf34f845e1865b2c1e663b2369ddbc490f5e6.tar.gz
ida-tui-4a3cf34f845e1865b2c1e663b2369ddbc490f5e6.tar.xz
ida-tui-4a3cf34f845e1865b2c1e663b2369ddbc490f5e6.zip
fix: follow/double-click a label lands on the label, not the function entry
resolve(name) went through lookup_funcs, which for a mid-function label (loc_/locret_) does get_name_ea -> label ea, then get_function(ea) and reports the CONTAINING function's entry address. So double-clicking (or following) a label jumped to the top of the function instead of the label's own address. Add a server tool resolve_names that returns the address a name actually denotes via idaapi.get_name_ea (functions, labels and data alike), and route Program.resolve() through it, keeping lookup_funcs only as a fallback for the "did you mean ..." suggestion on an unknown name. Verified: resolve('loc_2040') -> 0x2040 (was the function entry); double-click follow on a label row lands on the label ea. Regression sweep follow_xrefs/xref_labels/rename/rename_history/decomp_follow_self/search/ listing_view/disasm_nav/mouse 50/0. Needs a supervisor restart (new tool).
Diffstat (limited to 'server')
-rw-r--r--server/patch_server.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/server/patch_server.py b/server/patch_server.py
index 7ee490a..ff14a09 100644
--- a/server/patch_server.py
+++ b/server/patch_server.py
@@ -42,6 +42,25 @@ def _idatui_lv_get(x):
@tool
@idasync
+def resolve_names(
+ queries: Annotated[list, "Symbol name(s) to resolve to their OWN address"],
+) -> list:
+ """Resolve named locations (functions, labels like loc_/locret_, data) to the
+ exact address the NAME denotes, via get_name_ea. Unlike lookup_funcs, a
+ mid-function label resolves to the label's address, not the containing
+ function's entry."""
+ import idaapi
+ qs = queries if isinstance(queries, list) else [queries]
+ out = []
+ for q in qs:
+ q = str(q).strip()
+ ea = idaapi.get_name_ea(idaapi.BADADDR, q)
+ out.append({"query": q, "ea": (hex(ea) if ea != idaapi.BADADDR else None)})
+ return out
+
+
+@tool
+@idasync
def del_type(
name: Annotated[str, "Local type name to delete (struct/union/enum/typedef)"],
) -> dict: