Repository navigation
Cover Function Scope in the IDALib integration test - #20
Merged
Merged
Conversation
The IDALib test uploaded, matched and read results back, but never queried a single function through the Function Scope path, so it passed on every push to main while that path was broken for anyone on SMDA 4.8. That is how 1.1.9 shipped with Function Scope returning nothing from the second function onward. _exercise_function_scope queries several functions the way FunctionMatchWidget.updateViewWithCurrentFunction does: build an outline with getLocalSmdaReportOutline, put one function in its xcfg, then call querySmdaFunctionMatches. It asserts on the offset that reaches the server rather than on match counts, because the failure is silent - the second query short-circuits on the first function's cached offset and issues no request at all, so there is nothing to time out or log. HeadlessMcritContext gains the two attributes the outline getter keeps its state in, so the real getter runs against it unchanged. Checked against IDA 9.3, SMDA 4.8.0 and a live MCRIT on a 145-function sample: passes on the current getter, and with the pre-1.1.10 getter restored it fails on the second query. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Collaborator
Author
|
Rebased onto 97 pytest and ruff pass on the rebase. |
danielplohmann
force-pushed
the
test/function-scope-idalib-coverage
branch
from
September 16, 2026 12:27
fc0bebb to
8677ca5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes the coverage gap that let the 1.1.10 bug ship.
Why
The IDALib integration test uploads a report, runs a matching job and reads the result back, but it never queries a single function through the Function Scope path. So it passed on every push to
mainwhile that path was broken for anyone on SMDA 4.8 — which is exactly how 1.1.9 shipped with Function Scope returning nothing from the second function onward.What it does
_exercise_function_scopequeries several functions the wayFunctionMatchWidget.updateViewWithCurrentFunctiondoes: build an outline withgetLocalSmdaReportOutline, put one function in itsxcfg, callquerySmdaFunctionMatches.It asserts on which offset reaches the server, not on match counts. That matters: the failure is silent. With the old getter the second query short-circuits on the first function's already-cached offset and issues no request at all, so there is nothing to time out, nothing to log, and no match count that distinguishes "wrong function submitted" from "this function genuinely has no matches".
HeadlessMcritContextgains the two attributes the outline getter keeps its state in (local_smda_report_outline,_outline_source, pluslocal_smda_reportwhich the smoke test already set dynamically), so the real getter runs against it unchanged rather than against a test double.One wart worth flagging: the step has to bind
ida_mcrit.SmdaReportitself, because_load_dependencies()is GUI-gated behind_require_gui()and never runs under IDALib. Commented in place. #17 moves this logic toMcritSession, where it is reachable headlessly, so this should get simpler there.Verified
IDA Pro 9.3, SMDA 4.8.0, live MCRIT, real 145-function x86-64 sample:
outline report still carries a previous query's functions; getLocalSmdaReportOutline returned a reused object rather than a fresh oneRepo checks: 86 pytest,
ruff check,ruff format --check,run_quality_checks.py,verify_metadata_sync.py,verify_settings_sync.pyall pass.No version bump: this adds test coverage and changes no shipped behaviour.
🤖 Generated with Claude Code