Merge remote-tracking branch 'origin/GP-791_ghizard_Change_PDB_Universal_constructor_return_type' into patch

This commit is contained in:
ghidra1 2021-03-23 15:12:49 -04:00
commit ca15889208
4 changed files with 30 additions and 2 deletions

View File

@ -90,6 +90,14 @@ public abstract class AbstractMemberFunctionMsType extends AbstractMsType {
return functionAttributes;
}
/**
* Returns if known to be a constructor.
* @return true if constructor.
*/
public boolean isConstructor() {
return functionAttributes.isConstructor();
}
/**
* Returns the number of parameters to the function.
* @return The number of parameters.

View File

@ -58,4 +58,8 @@ public class FunctionMsAttributes extends AbstractParsableItem {
isInstanceConstructorOfClassWithVirtualBases = ((attributes & 0x0001) == 0x0001);
}
boolean isConstructor() {
return isInstanceConstructor || isInstanceConstructorOfClassWithVirtualBases;
}
}

View File

@ -121,6 +121,14 @@ public abstract class AbstractFunctionTypeApplier extends MsTypeApplier {
*/
protected abstract RecordNumber getArgListRecordNumber();
/**
* Returns if known to be a constructor.
* @return true if constructor.
*/
protected boolean isConstructor() {
return false;
}
/**
* Method to create the {@link DataType} based upon the type indices of the calling
* convention, return type, and arguments list.
@ -203,6 +211,10 @@ public abstract class AbstractFunctionTypeApplier extends MsTypeApplier {
private boolean setReturnType() {
if (isConstructor()) {
return false;
}
DataType returnDataType = returnApplier.getDataType();
if (returnDataType == null) {
applicator.appendLogMsg("Return type is null in " + functionDefinition.getName());

View File

@ -75,6 +75,11 @@ public class MemberFunctionTypeApplier extends AbstractFunctionTypeApplier {
return ((AbstractMemberFunctionMsType) msType).getArgListRecordNumber();
}
@Override
protected boolean isConstructor() {
return ((AbstractMemberFunctionMsType) msType).isConstructor();
}
@Override
void apply() throws PdbException, CancelledException {
predefineClasses();
@ -175,8 +180,7 @@ public class MemberFunctionTypeApplier extends AbstractFunctionTypeApplier {
// }
private MsTypeApplier getThisPointerApplier(AbstractMemberFunctionMsType procType) {
MsTypeApplier applier =
applicator.getTypeApplier(procType.getThisPointerRecordNumber());
MsTypeApplier applier = applicator.getTypeApplier(procType.getThisPointerRecordNumber());
// if ((applier instanceof PrimitiveTypeApplier &&
// ((PrimitiveTypeApplier) applier).isNoType())) {