mirror of
https://github.com/NationalSecurityAgency/ghidra
synced 2024-09-13 21:56:19 +00:00
Merge remote-tracking branch
'origin/GP-2617_ghidra1_DecompilerFunctionActions' (Closes #4613)
This commit is contained in:
commit
5085d0cfc5
|
@ -236,20 +236,19 @@ public abstract class AbstractDecompilerAction extends DockingAction {
|
||||||
* @return the function associated with the current context token or null if none identified.
|
* @return the function associated with the current context token or null if none identified.
|
||||||
*/
|
*/
|
||||||
protected Function getFunction(DecompilerActionContext context) {
|
protected Function getFunction(DecompilerActionContext context) {
|
||||||
|
|
||||||
ClangToken token = context.getTokenAtCursor();
|
ClangToken token = context.getTokenAtCursor();
|
||||||
if (!(token instanceof ClangFuncNameToken)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
Program program = context.getProgram();
|
Function f = null;
|
||||||
Function f = DecompilerUtils.getFunction(program, (ClangFuncNameToken) token);
|
if (token instanceof ClangFuncNameToken) {
|
||||||
if (f == null) {
|
f = DecompilerUtils.getFunction(context.getProgram(), (ClangFuncNameToken) token);
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
// Ignore default thunks
|
HighSymbol highSymbol = findHighSymbolFromToken(token, context.getHighFunction());
|
||||||
while (f.isThunk() && f.getSymbol().getSource() == SourceType.DEFAULT) {
|
if (highSymbol instanceof HighFunctionShellSymbol) {
|
||||||
|
f = (Function) highSymbol.getSymbol().getObject();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while (f != null && f.isThunk() && f.getSymbol().getSource() == SourceType.DEFAULT) {
|
||||||
f = f.getThunkedFunction(false);
|
f = f.getThunkedFunction(false);
|
||||||
}
|
}
|
||||||
return f;
|
return f;
|
||||||
|
|
Loading…
Reference in a new issue