Java Code Examples for ghidra.program.model.listing.Function#getCallingConvention()

The following examples show how to use ghidra.program.model.listing.Function#getCallingConvention() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FunctionUtils.java    From ghidra with Apache License 2.0 5 votes vote down vote up
public static int getCallingConventionSignatureOffset(Function function) {
	PrototypeModel callingConvention = function.getCallingConvention();
	if (callingConvention == null) {
		return 0;
	}
	String callingConventionName = callingConvention.getName();
	if (callingConventionName == null) {
		return 0;
	}
	if (callingConventionName.equals(Function.UNKNOWN_CALLING_CONVENTION_STRING)) {
		return 0;
	}
	return callingConventionName.length() + 1;

}
 
Example 2
Source File: FunctionCallingConventionTableColumn.java    From ghidra with Apache License 2.0 5 votes vote down vote up
@Override
public String getValue(Function rowObject, Settings settings, Program program,
		ServiceProvider serviceProvider) throws IllegalArgumentException {
	if (rowObject == null) {
		return null;
	}
	PrototypeModel callingConvention = rowObject.getCallingConvention();
	if (callingConvention == null) {
		return Function.UNKNOWN_CALLING_CONVENTION_STRING;
	}
	return callingConvention.getName();
}