mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 19:42:36 +02:00
GP-3223 Allow launching Function Definition Editor from structure/union
editor.
This commit is contained in:
parent
0cae3ab0f5
commit
a52d2244f4
2 changed files with 8 additions and 10 deletions
|
@ -941,7 +941,8 @@ public abstract class CompositeEditorModel extends CompositeViewerModel implemen
|
|||
}
|
||||
return ((baseDt != null) && !(baseDt instanceof BuiltInDataType) &&
|
||||
!(baseDt instanceof MissingBuiltInDataType) &&
|
||||
((baseDt instanceof Structure) || baseDt instanceof Union || baseDt instanceof Enum));
|
||||
((baseDt instanceof Structure) || (baseDt instanceof Union) ||
|
||||
(baseDt instanceof Enum) || (baseDt instanceof FunctionDefinition)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -19,7 +19,6 @@ import docking.ActionContext;
|
|||
import ghidra.app.plugin.core.datamgr.util.DataTypeUtils;
|
||||
import ghidra.app.services.DataTypeManagerService;
|
||||
import ghidra.program.model.data.*;
|
||||
import ghidra.program.model.data.Enum;
|
||||
|
||||
/**
|
||||
* Action for use in the composite data type editor.
|
||||
|
@ -49,17 +48,15 @@ public class EditComponentAction extends CompositeEditorTableAction {
|
|||
return;
|
||||
}
|
||||
|
||||
if (!model.isEditComponentAllowed()) {
|
||||
model.setStatus("Can only edit a structure, union, enum or function-definition.");
|
||||
return;
|
||||
}
|
||||
|
||||
DataTypeComponent comp = model.getComponent(row);
|
||||
DataType clickedType = comp.getDataType();
|
||||
DataType dt = DataTypeUtils.getBaseDataType(clickedType);
|
||||
boolean isEditableType =
|
||||
(dt instanceof Structure) || (dt instanceof Union) || (dt instanceof Enum);
|
||||
if (isEditableType) {
|
||||
edit(dt, clickedType.getName());
|
||||
}
|
||||
else {
|
||||
model.setStatus("Can only edit a structure, union or enum.");
|
||||
}
|
||||
edit(dt, clickedType.getName());
|
||||
requestTableFocus();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue