GP-1633/GP-2308 Added ProgramArchitecture to datatype managers.

Refactored ProjectDataTypeManager to extend StandaloneDataTypeManager.
Added actions to datatype tree to allow setting archive architecture.
Added use of storage translators when switching architectures.  Allow
FunctionDefinition to accept arbitrary calling convention
names and many other misc changes.
This commit is contained in:
ghidra1 2021-12-27 17:01:32 -05:00
parent 75a185aa9e
commit a4776892bd
248 changed files with 6282 additions and 2935 deletions

View file

@ -85,9 +85,7 @@ public class FunctionSignatureStringable extends Stringable {
this.signatureSource = function.getSignatureSource();
this.hasCustomStorage = function.hasCustomVariableStorage();
GenericCallingConvention guessedCallingConvention =
GenericCallingConvention.guessFromName(function.getCallingConventionName());
isThisCall = (guessedCallingConvention == GenericCallingConvention.thiscall);
isThisCall = CompilerSpec.CALLING_CONVENTION_thiscall.equals(callingConventionName);
// ignore source from function return which is same as signature source
returnInfo = getParameterInfo(function.getReturn(), SourceType.DEFAULT);
@ -531,7 +529,7 @@ public class FunctionSignatureStringable extends Stringable {
if (hasCustomStorage != toFunction.hasCustomVariableStorage()) {
// This should only change to use custom storage if same language.
boolean sameLanguage =
FunctionUtility.isSameLanguage(toFunction.getProgram(), program);
FunctionUtility.isSameLanguageAndCompilerSpec(toFunction.getProgram(), program);
if (!hasCustomStorage || (hasCustomStorage && sameLanguage)) {
useCustomStorage = hasCustomStorage;
}
@ -673,7 +671,7 @@ public class FunctionSignatureStringable extends Stringable {
}
if (callFixupChoice == ReplaceChoices.REPLACE) {
// Check that you have the same cspec before trying to apply call fixup.
if (FunctionUtility.isSameLanguage(toFunction.getProgram(), program)) {
if (FunctionUtility.isSameLanguageAndCompilerSpec(toFunction.getProgram(), program)) {
toFunction.setCallFixup(fromFunctionCallFixup);
}
}
@ -692,7 +690,7 @@ public class FunctionSignatureStringable extends Stringable {
switch (callingConventionChoice) {
case SAME_LANGUAGE:
if (FunctionUtility.isSameLanguage(program, toProgram)) {
if (FunctionUtility.isSameLanguageAndCompilerSpec(program, toProgram)) {
return callingConventionName;
}
break;