diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/function/FunctionDB.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/function/FunctionDB.java index ace0699cd5..50a6ff780c 100644 --- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/function/FunctionDB.java +++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/function/FunctionDB.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -2470,16 +2470,6 @@ public class FunctionDB extends DatabaseObject implements Function { return thunkedFunction.getSignatureSource(); } - // Force DEFAULT source if any param has unassigned storage - if (!getReturn().isValid()) { - return SourceType.DEFAULT; - } - for (Parameter param : getParameters()) { - if (!param.isValid()) { - return SourceType.DEFAULT; - } - } - return getStoredSignatureSource(); } finally { diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/pcode/LocalSymbolMap.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/pcode/LocalSymbolMap.java index c4179411f2..9209d212d1 100644 --- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/pcode/LocalSymbolMap.java +++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/pcode/LocalSymbolMap.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -210,11 +210,12 @@ public class LocalSymbolMap { pcaddr = pcaddr.subtractWrap(1); List paramList = new ArrayList<>(); + boolean internalInvalid = false; for (int i = 0; i < p.length; ++i) { Parameter var = p[i]; if (!var.isValid()) { - // TODO: exclude parameters which don't have valid storage ?? - continue; + internalInvalid = true; + break; } DataType dt = var.getDataType(); String name = var.getName(); @@ -243,6 +244,12 @@ public class LocalSymbolMap { paramSymbol.setNameLock(namelock); paramSymbol.setTypeLock(lock); } + if (internalInvalid) { + // Can only send down a partial prototype. Let decompiler try to recover the whole. + for (HighSymbol paramSymbol : paramList) { + paramSymbol.setTypeLock(false); + } + } paramSymbols = new HighSymbol[paramList.size()]; paramList.toArray(paramSymbols); diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/pcode/PcodeDataTypeManager.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/pcode/PcodeDataTypeManager.java index 9af94f1f9c..5e5d057aee 100644 --- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/pcode/PcodeDataTypeManager.java +++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/pcode/PcodeDataTypeManager.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -1145,10 +1145,7 @@ public class PcodeDataTypeManager { private void generateCoreTypes() { voidDt = new VoidDataType(progDataTypes); coreBuiltin = new HashMap(); - TypeMap type = new TypeMap(DataType.DEFAULT, "undefined", "unknown", false, false, - DEFAULT_DECOMPILER_ID); - coreBuiltin.put(type.id, type); - type = new TypeMap(displayLanguage, VoidDataType.dataType, "void", false, false, + TypeMap type = new TypeMap(displayLanguage, VoidDataType.dataType, "void", false, false, builtInDataTypes); coreBuiltin.put(type.id, type);