BaseTool: Fixed the issue of empty PcdDB.

If there is no dynamic pcds, there should be DB header
in the Pcd DataBase.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
BobCF 2018-03-23 10:24:03 +08:00 committed by Liming Gao
parent b005802a1c
commit 0a4f2d4869
1 changed files with 5 additions and 4 deletions

View File

@ -980,8 +980,6 @@ def CreatePcdDatabaseCode (Info, AutoGenC, AutoGenH):
def CreatePcdDataBase(PcdDBData):
delta = {}
basedata = {}
if not PcdDBData:
return ""
for skuname,skuid in PcdDBData:
if len(PcdDBData[(skuname,skuid)][1]) != len(PcdDBData[("DEFAULT","0")][1]):
EdkLogger.ERROR("The size of each sku in one pcd are not same")
@ -1061,9 +1059,12 @@ def NewCreatePcdDatabasePhaseSpecificAutoGen(Platform,Phase):
AdditionalAutoGenH, AdditionalAutoGenC = CreateAutoGen(PcdDriverAutoGenData)
else:
AdditionalAutoGenH, AdditionalAutoGenC, PcdDbBuffer,VarCheckTab = CreatePcdDatabasePhaseSpecificAutoGen (Platform,{}, Phase)
final_data = ()
for item in PcdDbBuffer:
final_data += unpack("B",item)
PcdDBData[("DEFAULT","0")] = (PcdDbBuffer, final_data)
PcdDbBuffer = CreatePcdDataBase(PcdDBData)
return AdditionalAutoGenH, AdditionalAutoGenC, PcdDbBuffer
return AdditionalAutoGenH, AdditionalAutoGenC, CreatePcdDataBase(PcdDBData)
## Create PCD database in DXE or PEI phase
#
# @param Platform The platform object