MIPS: Show arguments at indirect tail-calls by typing the decompiler’s call target (eliminates UNRECOVERED_JUMPTABLE at call sites) #8547
+19,568
−79
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.
MIPS: Show arguments at indirect tail-calls by typing the decompiler’s call target (eliminates UNRECOVERED_JUMPTABLE at call sites)
Summary
Adds a post-decompiler analyzer that automatically types the CALLIND target the decompiler actually uses (its synthetic/local high symbol) as an
fp_sigN*based on the wrapper’s parameter count.If the target variable was auto-named
UNRECOVERED_JUMPTABLE, the analyzer renames it tocallTargetand name-locks it to prevent churn.Motivation
In MIPS firmware/drivers, wrappers frequently tail-call function pointers via
jr/jalr(oftenjr t9), forwarding parameters. The decompiler resolves control flow but often prints()for the indirect call and labels the target asUNRECOVERED_JUMPTABLE, obscuring calling convention and hindering readability. Manual retyping in MCP fixes this but is tedious and non-repeatable.What’s included
Ghidra/Features/DecompilerDependent/src/main/java/ghidra/app/plugin/core/analysis/MipsDecompIndirectCallAnalyzer.javajr/jalrsites, obtains the decompiler’s chosen targetHighVariable/HighSymbol.fp_sigN*viaHighFunctionDBUtil.updateDBVariable(...); type-locks the symbol.UNRECOVERED_JUMPTABLE, renames tocallTargetand name-locks it.HighVariablename/register or sweeppcVar*locals, but only if the precise target path is unavailable.SourceTypeprecedence and does not overwriteUSER_DEFINEDnames/types set by users.Before
After
Design notes
HighVariable/HighSymbol/HighFunctionDBUtil.Program’sDataTypeManager; type/name locks applied to preserve the improvement across re-analysis.Scope and impact
jr/jalrcall sites.SourceType.USER_DEFINEDensures stable presentation without fighting user intent.Non-goals
UNRECOVERED_JUMPTABLEat call sites is normalized when it is the call target. Switch recovery remains the decompiler’s domain.Testing
jr/jalrtrampolines; verify indirect call sites print arguments and the target variable is namedcallTargetand typedfp_sigN*.USER_DEFINEDtype or name.CALLINDtargets.Configuration
Labels
Screencast.From.2025-10-06.08-04-57.webm