You can subscribe to this list here.
| 2010 |
Jan
(18) |
Feb
(75) |
Mar
(40) |
Apr
(18) |
May
(12) |
Jun
(13) |
Jul
(17) |
Aug
(25) |
Sep
(31) |
Oct
(16) |
Nov
(20) |
Dec
(13) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2011 |
Jan
(5) |
Feb
(7) |
Mar
(6) |
Apr
(21) |
May
(12) |
Jun
(35) |
Jul
(29) |
Aug
(56) |
Sep
(64) |
Oct
(43) |
Nov
(60) |
Dec
(26) |
| 2012 |
Jan
(6) |
Feb
(12) |
Mar
(17) |
Apr
(10) |
May
(11) |
Jun
(13) |
Jul
(6) |
Aug
(2) |
Sep
(3) |
Oct
(9) |
Nov
(1) |
Dec
(2) |
| 2013 |
Jan
(5) |
Feb
(5) |
Mar
(1) |
Apr
(3) |
May
(3) |
Jun
(3) |
Jul
(8) |
Aug
(7) |
Sep
(2) |
Oct
(4) |
Nov
(14) |
Dec
(10) |
| 2014 |
Jan
(22) |
Feb
(7) |
Mar
(3) |
Apr
(4) |
May
(1) |
Jun
(6) |
Jul
(4) |
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
|
From: <jlj...@us...> - 2011-10-26 04:15:31
|
Revision: 2379
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2379&view=rev
Author: jljusten
Date: 2011-10-26 04:15:24 +0000 (Wed, 26 Oct 2011)
Log Message:
-----------
BaseTools/Source/C: Fix warnings generated by GCC 4.6
GCC 4.6 generates a warning when a variable is set,
but never used.
This patch cleans up these cases in our BaseTools C
based tools.
Signed-off-by: jljusten
Reviewed-by: gikidy
Modified Paths:
--------------
trunk/BaseTools/Source/C/EfiLdrImage/EfiLdrImage.c
trunk/BaseTools/Source/C/GenFv/GenFvInternalLib.c
trunk/BaseTools/Source/C/GenFw/Elf32Convert.c
trunk/BaseTools/Source/C/GenFw/Elf64Convert.c
trunk/BaseTools/Source/C/GenSec/GenSec.c
trunk/BaseTools/Source/C/GenVtf/GenVtf.c
trunk/BaseTools/Source/C/GnuGenBootSector/GnuGenBootSector.c
trunk/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c
trunk/BaseTools/Source/C/Split/Split.c
Modified: trunk/BaseTools/Source/C/EfiLdrImage/EfiLdrImage.c
===================================================================
--- trunk/BaseTools/Source/C/EfiLdrImage/EfiLdrImage.c 2011-10-25 08:24:18 UTC (rev 2378)
+++ trunk/BaseTools/Source/C/EfiLdrImage/EfiLdrImage.c 2011-10-26 04:15:24 UTC (rev 2379)
@@ -1,6 +1,6 @@
/** @file
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -181,7 +181,6 @@
CHAR8* OutputFileName = NULL;
CHAR8* InputFileNames[MAX_PE_IMAGES + 1];
UINT8 InputFileCount = 0;
- BOOLEAN QuietFlag = FALSE;
UINT64 DebugLevel = 0;
UINT64 VerboseLevel = 0;
EFI_STATUS Status = EFI_SUCCESS;
@@ -220,7 +219,6 @@
}
if ((stricmp (argv[0], "-q") == 0) || (stricmp (argv[0], "--quiet") == 0)) {
- QuietFlag = TRUE;
argc --;
argv ++;
continue;
Modified: trunk/BaseTools/Source/C/GenFv/GenFvInternalLib.c
===================================================================
--- trunk/BaseTools/Source/C/GenFv/GenFvInternalLib.c 2011-10-25 08:24:18 UTC (rev 2378)
+++ trunk/BaseTools/Source/C/GenFv/GenFvInternalLib.c 2011-10-26 04:15:24 UTC (rev 2379)
@@ -1,6 +1,6 @@
/** @file
-Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -2801,7 +2801,6 @@
PE_COFF_LOADER_IMAGE_CONTEXT OrigImageContext;
EFI_PHYSICAL_ADDRESS XipBase;
EFI_PHYSICAL_ADDRESS NewPe32BaseAddress;
- EFI_PHYSICAL_ADDRESS *BaseToUpdate;
UINTN Index;
EFI_FILE_SECTION_POINTER CurrentPe32Section;
EFI_FFS_FILE_STATE SavedState;
@@ -2818,7 +2817,6 @@
Index = 0;
MemoryImagePointer = NULL;
- BaseToUpdate = NULL;
TEImageHeader = NULL;
ImgHdr = NULL;
SectionHeader = NULL;
@@ -2992,7 +2990,6 @@
}
NewPe32BaseAddress = XipBase + (UINTN) CurrentPe32Section.Pe32Section + sizeof (EFI_PE32_SECTION) - (UINTN)FfsFile;
- BaseToUpdate = &XipBase;
break;
case EFI_FV_FILETYPE_DRIVER:
@@ -3008,7 +3005,6 @@
return EFI_ABORTED;
}
NewPe32BaseAddress = XipBase + (UINTN) CurrentPe32Section.Pe32Section + sizeof (EFI_PE32_SECTION) - (UINTN)FfsFile;
- BaseToUpdate = &XipBase;
break;
default:
Modified: trunk/BaseTools/Source/C/GenFw/Elf32Convert.c
===================================================================
--- trunk/BaseTools/Source/C/GenFw/Elf32Convert.c 2011-10-25 08:24:18 UTC (rev 2378)
+++ trunk/BaseTools/Source/C/GenFw/Elf32Convert.c 2011-10-26 04:15:24 UTC (rev 2379)
@@ -738,10 +738,6 @@
UINT8 *Targ;
Elf32_Phdr *DynamicSegment;
Elf32_Phdr *TargetSegment;
- Elf_Sym *Sym;
- Elf_Shdr *SymtabShdr;
- UINT8 *Symtab;
-
for (Index = 0, FoundRelocations = FALSE; Index < mEhdr->e_shnum; Index++) {
Elf_Shdr *RelShdr = GetShdrByIndex(Index);
@@ -750,16 +746,10 @@
if (IsTextShdr(SecShdr) || IsDataShdr(SecShdr)) {
UINT32 RelIdx;
- SymtabShdr = GetShdrByIndex (RelShdr->sh_link);
- Symtab = (UINT8*)mEhdr + SymtabShdr->sh_offset;
FoundRelocations = TRUE;
for (RelIdx = 0; RelIdx < RelShdr->sh_size; RelIdx += RelShdr->sh_entsize) {
Elf_Rel *Rel = (Elf_Rel *)((UINT8*)mEhdr + RelShdr->sh_offset + RelIdx);
- Elf_Shdr *SymShdr;
- Sym = (Elf_Sym *)(Symtab + ELF_R_SYM(Rel->r_info) * SymtabShdr->sh_entsize);
- SymShdr = GetShdrByIndex (Sym->st_shndx);
-
if (mEhdr->e_machine == EM_386) {
switch (ELF_R_TYPE(Rel->r_info)) {
case R_386_NONE:
Modified: trunk/BaseTools/Source/C/GenFw/Elf64Convert.c
===================================================================
--- trunk/BaseTools/Source/C/GenFw/Elf64Convert.c 2011-10-25 08:24:18 UTC (rev 2378)
+++ trunk/BaseTools/Source/C/GenFw/Elf64Convert.c 2011-10-26 04:15:24 UTC (rev 2379)
@@ -637,29 +637,17 @@
UINT32 Index;
EFI_IMAGE_OPTIONAL_HEADER_UNION *NtHdr;
EFI_IMAGE_DATA_DIRECTORY *Dir;
- BOOLEAN FoundRelocations;
- Elf_Sym *Sym;
- Elf_Shdr *SymtabShdr;
- UINT8 *Symtab;
-
- for (Index = 0, FoundRelocations = FALSE; Index < mEhdr->e_shnum; Index++) {
+ for (Index = 0; Index < mEhdr->e_shnum; Index++) {
Elf_Shdr *RelShdr = GetShdrByIndex(Index);
if ((RelShdr->sh_type == SHT_REL) || (RelShdr->sh_type == SHT_RELA)) {
Elf_Shdr *SecShdr = GetShdrByIndex (RelShdr->sh_info);
if (IsTextShdr(SecShdr) || IsDataShdr(SecShdr)) {
UINT64 RelIdx;
- SymtabShdr = GetShdrByIndex (RelShdr->sh_link);
- Symtab = (UINT8*)mEhdr + SymtabShdr->sh_offset;
- FoundRelocations = TRUE;
for (RelIdx = 0; RelIdx < RelShdr->sh_size; RelIdx += RelShdr->sh_entsize) {
Elf_Rela *Rel = (Elf_Rela *)((UINT8*)mEhdr + RelShdr->sh_offset + RelIdx);
- Elf_Shdr *SymShdr;
- Sym = (Elf_Sym *)(Symtab + ELF_R_SYM(Rel->r_info) * SymtabShdr->sh_entsize);
- SymShdr = GetShdrByIndex (Sym->st_shndx);
-
if (mEhdr->e_machine == EM_X86_64) {
switch (ELF_R_TYPE(Rel->r_info)) {
case R_X86_64_NONE:
Modified: trunk/BaseTools/Source/C/GenSec/GenSec.c
===================================================================
--- trunk/BaseTools/Source/C/GenSec/GenSec.c 2011-10-25 08:24:18 UTC (rev 2378)
+++ trunk/BaseTools/Source/C/GenSec/GenSec.c 2011-10-26 04:15:24 UTC (rev 2379)
@@ -1,6 +1,6 @@
/** @file
-Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -915,7 +915,6 @@
{
UINT32 Index;
UINT32 InputFileNum;
- FILE *InFile;
FILE *OutFile;
CHAR8 **InputFileName;
CHAR8 *OutputFileName;
@@ -944,7 +943,6 @@
SectionName = NULL;
CompressionName = NULL;
StringBuffer = "";
- InFile = NULL;
OutFile = NULL;
VersionNumber = 0;
InputFileNum = 0;
Modified: trunk/BaseTools/Source/C/GenVtf/GenVtf.c
===================================================================
--- trunk/BaseTools/Source/C/GenVtf/GenVtf.c 2011-10-25 08:24:18 UTC (rev 2378)
+++ trunk/BaseTools/Source/C/GenVtf/GenVtf.c 2011-10-26 04:15:24 UTC (rev 2379)
@@ -1,6 +1,6 @@
/**
-Copyright (c) 1999 - 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 1999 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available
under the terms and conditions of the BSD License which accompanies this
distribution. The full text of the license may be found at
@@ -1141,7 +1141,6 @@
EFI_STATUS Status;
UINT64 CompStartAddress;
UINT64 FileSize;
- UINT64 NumByteRead;
UINT64 NumAdjustByte;
UINT8 *Buffer;
FILE *Fp;
@@ -1189,7 +1188,7 @@
//
// Read first 64 bytes of PAL header and use it to find version info
//
- NumByteRead = fread (Buffer, sizeof (UINT8), SIZE_OF_PAL_HEADER, Fp);
+ fread (Buffer, sizeof (UINT8), SIZE_OF_PAL_HEADER, Fp);
//
// PAL header contains the version info. Currently, we will use the header
@@ -1200,7 +1199,7 @@
}
}
- NumByteRead = fread (Buffer, sizeof (UINT8), (UINTN) FileSize, Fp);
+ fread (Buffer, sizeof (UINT8), (UINTN) FileSize, Fp);
fclose (Fp);
//
@@ -1329,7 +1328,6 @@
UINT64 AbsAddress;
UINTN RelativeAddress;
UINT64 FileSize;
- UINT64 NumByteRead;
UINT8 *Buffer;
FILE *Fp;
FIT_TABLE *PalFitPtr;
@@ -1367,7 +1365,7 @@
//
// Read, Get version Info and discard the PAL header.
//
- NumByteRead = fread (Buffer, sizeof (UINT8), SIZE_OF_PAL_HEADER, Fp);
+ fread (Buffer, sizeof (UINT8), SIZE_OF_PAL_HEADER, Fp);
//
// Extract the version info from header of PAL_A. Once done, discrad this buffer
@@ -1379,7 +1377,7 @@
//
// Read PAL_A file in a buffer
//
- NumByteRead = fread (Buffer, sizeof (UINT8), (UINTN) FileSize, Fp);
+ fread (Buffer, sizeof (UINT8), (UINTN) FileSize, Fp);
fclose (Fp);
PalStartAddress = Fv1EndAddress - (SIZE_TO_OFFSET_PAL_A_END + FileSize);
@@ -1759,7 +1757,6 @@
UINT8 *Buffer;
UINT8 *LocalVtfBuffer;
UINTN FileSize;
- UINTN NumByteRead;
FILE *Fp;
if (!strcmp (FileName, "")) {
@@ -1784,7 +1781,7 @@
return EFI_OUT_OF_RESOURCES;
}
- NumByteRead = fread (Buffer, sizeof (UINT8), FileSize, Fp);
+ fread (Buffer, sizeof (UINT8), FileSize, Fp);
LocalVtfBuffer = (UINT8 *) Vtf1EndBuffer - SIZE_IA32_RESET_VECT;
memcpy (LocalVtfBuffer, Buffer, FileSize);
@@ -2121,7 +2118,6 @@
FILE *Fp;
UINT64 *StartAddressPtr;
UINTN FirstFwVSize;
- UINTN NumByte;
StartAddressPtr = malloc (sizeof (UINT64));
if (StartAddressPtr == NULL) {
@@ -2141,7 +2137,7 @@
FirstFwVSize = _filelength (fileno (Fp));
fseek (Fp, (long) (FirstFwVSize - (UINTN) (SIZE_IA32_RESET_VECT + SIZE_SALE_ENTRY_POINT)), SEEK_SET);
- NumByte = fwrite ((VOID *) StartAddressPtr, sizeof (UINT64), 1, Fp);
+ fwrite ((VOID *) StartAddressPtr, sizeof (UINT64), 1, Fp);
if (Fp) {
fclose (Fp);
Modified: trunk/BaseTools/Source/C/GnuGenBootSector/GnuGenBootSector.c
===================================================================
--- trunk/BaseTools/Source/C/GnuGenBootSector/GnuGenBootSector.c 2011-10-25 08:24:18 UTC (rev 2378)
+++ trunk/BaseTools/Source/C/GnuGenBootSector/GnuGenBootSector.c 2011-10-26 04:15:24 UTC (rev 2379)
@@ -1,6 +1,6 @@
/** @file
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -305,7 +305,6 @@
char *argv[]
)
{
- CHAR8 *AppName;
INTN Index;
BOOLEAN ProcessMbr;
ERROR_STATUS Status;
@@ -319,7 +318,6 @@
ZeroMem(&InputPathInfo, sizeof(PATH_INFO));
ZeroMem(&OutputPathInfo, sizeof(PATH_INFO));
- AppName = *argv;
argv ++;
argc --;
Modified: trunk/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c
===================================================================
--- trunk/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c 2011-10-25 08:24:18 UTC (rev 2378)
+++ trunk/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c 2011-10-26 04:15:24 UTC (rev 2379)
@@ -1,6 +1,19 @@
-/* LzmaEnc.c -- LZMA Encoder
-2009-02-02 : Igor Pavlov : Public domain */
+/** @file
+ Based on LZMA SDK 4.65:
+ LzmaEnc.c -- LZMA Encoder
+ 2009-02-02 : Igor Pavlov : Public domain
+ Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
#include <string.h>
/* #define SHOW_STAT */
@@ -1919,11 +1932,13 @@
static SRes LzmaEnc_Alloc(CLzmaEnc *p, UInt32 keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig)
{
UInt32 beforeSize = kNumOpts;
+ #ifdef COMPRESS_MF_MT
Bool btMode;
+ #endif
if (!RangeEnc_Alloc(&p->rc, alloc))
return SZ_ERROR_MEM;
+ #ifdef COMPRESS_MF_MT
btMode = (p->matchFinderBase.btMode != 0);
- #ifdef COMPRESS_MF_MT
p->mtMode = (p->multiThread && !p->fastMode && btMode);
#endif
Modified: trunk/BaseTools/Source/C/Split/Split.c
===================================================================
--- trunk/BaseTools/Source/C/Split/Split.c 2011-10-25 08:24:18 UTC (rev 2378)
+++ trunk/BaseTools/Source/C/Split/Split.c 2011-10-26 04:15:24 UTC (rev 2379)
@@ -2,7 +2,7 @@
Split a file into two pieces at the request offset.
-Copyright (c) 1999 - 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 1999 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available
under the terms and conditions of the BSD License which accompanies this
distribution. The full text of the license may be found at
@@ -229,7 +229,6 @@
CHAR8 *CurrentDir = NULL;
UINT64 Index;
CHAR8 CharC;
- BOOLEAN QuietFlag = TRUE;
UINT64 DebugLevel = 0;
UINT64 VerboseLevel = 0;
@@ -307,7 +306,6 @@
}
if ((stricmp (argv[0], "-q") == 0) || (stricmp (argv[0], "--quiet") == 0)) {
- QuietFlag = TRUE;
argc --;
argv ++;
continue;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2011-10-25 08:24:29
|
Revision: 2378
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2378&view=rev
Author: jsu1
Date: 2011-10-25 08:24:18 +0000 (Tue, 25 Oct 2011)
Log Message:
-----------
Improve section global macro to allow macro in common section be used in specific section
Reviewed-by: gikidy
Signed-off-by: jsu1
Modified Paths:
--------------
trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py
Modified: trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py
===================================================================
--- trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py 2011-10-25 04:33:31 UTC (rev 2377)
+++ trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py 2011-10-25 08:24:18 UTC (rev 2378)
@@ -65,7 +65,11 @@
if self._SectionType == MODEL_META_DATA_HEADER:
self._FileLocalMacros[Name] = Value
else:
- self._SectionLocalMacros[Name] = Value
+ SectionDictKey = self._SectionType, self._Scope[0][0], self._Scope[0][1]
+ if SectionDictKey not in self._SectionsMacroDict:
+ self._SectionsMacroDict[SectionDictKey] = {}
+ SectionLocalMacros = self._SectionsMacroDict[SectionDictKey]
+ SectionLocalMacros[Name] = Value
# EDK_GLOBAL defined macros
elif type(self) != DscParser:
EdkLogger.error('Parser', FORMAT_INVALID, "EDK_GLOBAL can only be used in .dsc file",
@@ -138,7 +142,7 @@
self._FileDir = self.MetaFile.Dir
self._Defines = {}
self._FileLocalMacros = {}
- self._SectionLocalMacros = {}
+ self._SectionsMacroDict = {}
# for recursive parsing
self._Owner = [Owner]
@@ -293,8 +297,6 @@
File=self.MetaFile, Line=self._LineIndex+1, ExtraData=self._CurrentLine)
# If the section information is needed later, it should be stored in database
self._ValueList[0] = self._SectionName
- # Clear local macro defined in last section
- self._SectionLocalMacros = {}
## [defines] section parser
@ParseMacro
@@ -349,9 +351,21 @@
def _GetMacros(self):
Macros = {}
Macros.update(self._FileLocalMacros)
- Macros.update(self._SectionLocalMacros)
+ Macros.update(self._GetApplicableSectionMacro())
return Macros
+
+ ## Get section Macros that are applicable to current line, which may come from other sections
+ ## that share the same name while scope is wider
+ def _GetApplicableSectionMacro(self):
+ Macros = {}
+
+ for SectionType, Scope1, Scope2 in self._SectionsMacroDict:
+ if (SectionType == self._SectionType) and (Scope1 == self._Scope[0][0] or Scope1 == "COMMON") and (Scope2 == self._Scope[0][1] or Scope2 == "COMMON"):
+ Macros.update(self._SectionsMacroDict[(SectionType, Scope1, Scope2)])
+
+ return Macros
+
_SectionParser = {}
Finished = property(_GetFinished, _SetFinished)
_Macros = property(_GetMacros)
@@ -1005,7 +1019,7 @@
def _GetMacros(self):
Macros = {}
Macros.update(self._FileLocalMacros)
- Macros.update(self._SectionLocalMacros)
+ Macros.update(self._GetApplicableSectionMacro())
Macros.update(GlobalData.gEdkGlobal)
Macros.update(GlobalData.gPlatformDefines)
Macros.update(GlobalData.gCommandLineDefines)
@@ -1053,7 +1067,7 @@
self._DirectiveEvalStack = []
self._FileWithError = self.MetaFile
self._FileLocalMacros = {}
- self._SectionLocalMacros = {}
+ self._SectionsMacroDict = {}
GlobalData.gPlatformDefines = {}
# Get all macro and PCD which has straitforward value
@@ -1120,7 +1134,6 @@
self._SectionType = self.DataType[self._SectionName]
else:
self._SectionType = MODEL_UNKNOWN
- self._SectionLocalMacros = {}
def __ProcessSubsectionHeader(self):
self._SubsectionName = self._ValueList[0]
@@ -1135,7 +1148,7 @@
Value, DatumType, MaxDatumSize = AnalyzePcdData(Value)
# Only use PCD whose value is straitforward (no macro and PCD)
if self.SymbolPattern.findall(Value):
- continue
+ continue
Name = TokenSpaceGuid + '.' + PcdName
# Don't use PCD with different values.
if Name in self._Symbols and self._Symbols[Name] != Value:
@@ -1166,7 +1179,11 @@
if self._SectionType == MODEL_META_DATA_HEADER:
self._FileLocalMacros[Name] = Value
else:
- self._SectionLocalMacros[Name] = Value
+ SectionDictKey = self._SectionType, self._Scope[0][0], self._Scope[0][1]
+ if SectionDictKey not in self._SectionsMacroDict:
+ self._SectionsMacroDict[SectionDictKey] = {}
+ SectionLocalMacros = self._SectionsMacroDict[SectionDictKey]
+ SectionLocalMacros[Name] = Value
elif self._ItemType == MODEL_META_DATA_GLOBAL_DEFINE:
GlobalData.gEdkGlobal[Name] = Value
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2011-10-25 04:33:37
|
Revision: 2377
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2377&view=rev
Author: jsu1
Date: 2011-10-25 04:33:31 +0000 (Tue, 25 Oct 2011)
Log Message:
-----------
Fix PCD Macro expansion during parsing to use ReplaceMacro instead of ValueExpression
Reviewed-by: gikidy
Reviewed-by: yingke
Signed-off-by: jsu1
Modified Paths:
--------------
trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py
Modified: trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py
===================================================================
--- trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py 2011-10-24 08:49:49 UTC (rev 2376)
+++ trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py 2011-10-25 04:33:31 UTC (rev 2377)
@@ -1278,11 +1278,11 @@
ValueList = GetSplitValueList(self._ValueList[2])
if len(ValueList) > 1 and ValueList[1] == 'VOID*':
PcdValue = ValueList[0]
- ValueList[0] = str(ValueExpression(PcdValue, self._Macros)())
+ ValueList[0] = ReplaceMacro(PcdValue, self._Macros)
else:
PcdValue = ValueList[-1]
- ValueList[-1] = str(ValueExpression(PcdValue, self._Macros)())
-
+ ValueList[-1] = ReplaceMacro(PcdValue, self._Macros)
+
self._ValueList[2] = '|'.join(ValueList)
def __ProcessComponent(self):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2011-10-24 08:49:55
|
Revision: 2376
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2376&view=rev
Author: jsu1
Date: 2011-10-24 08:49:49 +0000 (Mon, 24 Oct 2011)
Log Message:
-----------
fix EDKI modules [nmake] section /DFLAG issue
Reviewed-by: gikidy
Reviewed-by: yingke
Signed-off-by: jsu1
Modified Paths:
--------------
trunk/BaseTools/Source/Python/Common/String.py
trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py
Modified: trunk/BaseTools/Source/Python/Common/String.py
===================================================================
--- trunk/BaseTools/Source/Python/Common/String.py 2011-10-24 06:11:20 UTC (rev 2375)
+++ trunk/BaseTools/Source/Python/Common/String.py 2011-10-24 08:49:49 UTC (rev 2376)
@@ -72,6 +72,21 @@
return ValueList
+## GetSplitList
+#
+# Get a value list from a string with multiple values splited with SplitString
+# The default SplitTag is DataType.TAB_VALUE_SPLIT
+# 'AAA|BBB|CCC' -> ['AAA', 'BBB', 'CCC']
+#
+# @param String: The input string to be splitted
+# @param SplitStr: The split key, default is DataType.TAB_VALUE_SPLIT
+# @param MaxSplit: The max number of split values, default is -1
+#
+# @retval list() A list for splitted string
+#
+def GetSplitList(String, SplitStr = DataType.TAB_VALUE_SPLIT, MaxSplit = -1):
+ return map(lambda l: l.strip(), String.split(SplitStr, MaxSplit))
+
## MergeArches
#
# Find a key's all arches in dict, add the new arch to the list
Modified: trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py
===================================================================
--- trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py 2011-10-24 06:11:20 UTC (rev 2375)
+++ trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py 2011-10-24 08:49:49 UTC (rev 2376)
@@ -1542,7 +1542,7 @@
ToolChain = "*_*_*_%s_FLAGS" % Tool
ToolChainFamily = 'MSFT' # Edk.x only support MSFT tool chain
#ignore not replaced macros in value
- ValueList = GetSplitValueList(' ' + Value, '/D')
+ ValueList = GetSplitList(' ' + Value, '/D')
Dummy = ValueList[0]
for Index in range(1, len(ValueList)):
if ValueList[Index][-1] == '=' or ValueList[Index] == '':
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2011-10-24 06:11:26
|
Revision: 2375
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2375&view=rev
Author: jsu1
Date: 2011-10-24 06:11:20 +0000 (Mon, 24 Oct 2011)
Log Message:
-----------
Add DSC PCD value macro support and update expression warning
Reviewed-by: gikidy
Reviewed-by: yingke
Signed-off-by: jsu1
Modified Paths:
--------------
trunk/BaseTools/Source/Python/Common/Expression.py
trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py
Modified: trunk/BaseTools/Source/Python/Common/Expression.py
===================================================================
--- trunk/BaseTools/Source/Python/Common/Expression.py 2011-10-19 09:39:37 UTC (rev 2374)
+++ trunk/BaseTools/Source/Python/Common/Expression.py 2011-10-24 06:11:20 UTC (rev 2375)
@@ -161,7 +161,7 @@
WrnExp.result = False
raise WrnExp
elif Operator == "!=":
- WrnExp = WrnExpression(WRN_EQCMP_STR_OTHERS)
+ WrnExp = WrnExpression(WRN_NECMP_STR_OTHERS)
WrnExp.result = True
raise WrnExp
else:
@@ -170,7 +170,7 @@
if Operator in ["==", "!=", ">=", "<=", ">", "<"] and set((TypeDict[type(Oprand1)], TypeDict[type(Oprand2)])) == set((TypeDict[type(True)], TypeDict[type(0)])):
# comparison between number and boolean is allowed
pass
- if Operator in ['&', '|', '^', "&&", "||"] and set((TypeDict[type(Oprand1)], TypeDict[type(Oprand2)])) == set((TypeDict[type(True)], TypeDict[type(0)])):
+ elif Operator in ['&', '|', '^', "&&", "||"] and set((TypeDict[type(Oprand1)], TypeDict[type(Oprand2)])) == set((TypeDict[type(True)], TypeDict[type(0)])):
# bitwise and logical operation between number and boolean is allowed
pass
else:
Modified: trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py
===================================================================
--- trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py 2011-10-19 09:39:37 UTC (rev 2374)
+++ trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py 2011-10-24 06:11:20 UTC (rev 2375)
@@ -1169,6 +1169,13 @@
self._SectionLocalMacros[Name] = Value
elif self._ItemType == MODEL_META_DATA_GLOBAL_DEFINE:
GlobalData.gEdkGlobal[Name] = Value
+
+ #
+ # Keyword in [Defines] section can be used as Macros
+ #
+ if (self._ItemType == MODEL_META_DATA_HEADER) and (self._SectionType == MODEL_META_DATA_HEADER):
+ self._FileLocalMacros[Name] = Value
+
self._ValueList = [Type, Name, Value]
def __ProcessDirective(self):
@@ -1271,9 +1278,11 @@
ValueList = GetSplitValueList(self._ValueList[2])
if len(ValueList) > 1 and ValueList[1] == 'VOID*':
PcdValue = ValueList[0]
+ ValueList[0] = str(ValueExpression(PcdValue, self._Macros)())
else:
PcdValue = ValueList[-1]
- PcdValue = str(ValueExpression(PcdValue, self._Macros)())
+ ValueList[-1] = str(ValueExpression(PcdValue, self._Macros)())
+
self._ValueList[2] = '|'.join(ValueList)
def __ProcessComponent(self):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yd...@us...> - 2011-10-19 09:39:46
|
Revision: 2374
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2374&view=rev
Author: ydong10
Date: 2011-10-19 09:39:37 +0000 (Wed, 19 Oct 2011)
Log Message:
-----------
Fix a typo in VfrCompile
Signed-off-by: ydong10
Modified Paths:
--------------
branches/Releases/BaseTools_r2100/Source/C/VfrCompile/VfrFormPkg.h
Modified: branches/Releases/BaseTools_r2100/Source/C/VfrCompile/VfrFormPkg.h
===================================================================
--- branches/Releases/BaseTools_r2100/Source/C/VfrCompile/VfrFormPkg.h 2011-10-19 09:38:36 UTC (rev 2373)
+++ branches/Releases/BaseTools_r2100/Source/C/VfrCompile/VfrFormPkg.h 2011-10-19 09:39:37 UTC (rev 2374)
@@ -847,7 +847,7 @@
public:
CIfrImage () : CIfrObj (EFI_IFR_IMAGE_OP, (CHAR8 **)&mImage),
- CIfrOpHeader (EFI_IFR_FORM_OP, &mImage->Header) {
+ CIfrOpHeader (EFI_IFR_IMAGE_OP, &mImage->Header) {
mImage->Id = EFI_IMAGE_ID_INVALID;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yd...@us...> - 2011-10-19 09:38:42
|
Revision: 2373
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2373&view=rev
Author: ydong10
Date: 2011-10-19 09:38:36 +0000 (Wed, 19 Oct 2011)
Log Message:
-----------
Fix a typo in VfrCompile
Signed-off-by: ydong10
Modified Paths:
--------------
trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h
Modified: trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h
===================================================================
--- trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h 2011-10-19 07:17:30 UTC (rev 2372)
+++ trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h 2011-10-19 09:38:36 UTC (rev 2373)
@@ -847,7 +847,7 @@
public:
CIfrImage () : CIfrObj (EFI_IFR_IMAGE_OP, (CHAR8 **)&mImage),
- CIfrOpHeader (EFI_IFR_FORM_OP, &mImage->Header) {
+ CIfrOpHeader (EFI_IFR_IMAGE_OP, &mImage->Header) {
mImage->Id = EFI_IMAGE_ID_INVALID;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2011-10-19 07:17:36
|
Revision: 2372
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2372&view=rev
Author: jsu1
Date: 2011-10-19 07:17:30 +0000 (Wed, 19 Oct 2011)
Log Message:
-----------
Update tool definition to only add gnu debug section when generating efi image for GCC toolchain DEBUG build.
Reviewed-by: gikidy
Signed-off-by: jsu1
Modified Paths:
--------------
trunk/BaseTools/Conf/build_rule.template
trunk/BaseTools/Conf/tools_def.template
Modified: trunk/BaseTools/Conf/build_rule.template
===================================================================
--- trunk/BaseTools/Conf/build_rule.template 2011-10-19 06:52:28 UTC (rev 2371)
+++ trunk/BaseTools/Conf/build_rule.template 2011-10-19 07:17:30 UTC (rev 2372)
@@ -305,7 +305,7 @@
#
#The below 2 lines are only needed for UNIXGCC tool chain, which genereates PE image directly
#
- -$(OBJCOPY) --add-gnu-debuglink=$(DEBUG_DIR)(+)$(MODULE_NAME).debug ${src}
+ -$(OBJCOPY) $(OBJCOPY_ADDDEBUGFLAG) ${src}
-$(CP) $(DEBUG_DIR)(+)$(MODULE_NAME).debug $(BIN_DIR)
"$(GENFW)" -e $(MODULE_TYPE) -o ${dst} ${src} $(GENFW_FLAGS)
Modified: trunk/BaseTools/Conf/tools_def.template
===================================================================
--- trunk/BaseTools/Conf/tools_def.template 2011-10-19 06:52:28 UTC (rev 2371)
+++ trunk/BaseTools/Conf/tools_def.template 2011-10-19 07:17:30 UTC (rev 2372)
@@ -1969,6 +1969,8 @@
*_*_*_OBJCOPY_FLAGS = objcopy not needed for
*_*_*_SYMRENAME_PATH = echo
*_*_*_SYMRENAME_FLAGS = Symbol renaming not needed for
+DEBUG_*_*_OBJCOPY_ADDDEBUGFLAG = --add-gnu-debuglink=$(DEBUG_DIR)\$(MODULE_NAME).debug
+RELEASE_*_*_OBJCOPY_ADDDEBUGFLAG =
DEFINE GCC_ALL_CC_FLAGS = -g -Os -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-missing-braces -Wno-array-bounds -c -include AutoGen.h
DEFINE GCC_IA32_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -m32 -malign-double -freorder-blocks -freorder-blocks-and-partition -O2 -mno-stack-arg-probe
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gi...@us...> - 2011-10-19 06:52:34
|
Revision: 2371
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2371&view=rev
Author: gikidy
Date: 2011-10-19 06:52:28 +0000 (Wed, 19 Oct 2011)
Log Message:
-----------
GenFds: Fixed invalid path generation during build
Incorrect usage of lstrip caused the path to be trimmed excessively.
This was observed under Linux when a long build path was used.
Signed-off-by: gikidy
Reviewed-by: jljusten
Modified Paths:
--------------
trunk/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
Modified: trunk/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
===================================================================
--- trunk/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py 2011-10-17 08:17:03 UTC (rev 2370)
+++ trunk/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py 2011-10-19 06:52:28 UTC (rev 2371)
@@ -117,7 +117,7 @@
if not BuildRuleDatabase:
return {}
- PathClassObj = PathClass(str(Inf.MetaFile).lstrip(GenFdsGlobalVariable.WorkSpaceDir),
+ PathClassObj = PathClass(Inf.MetaFile.File,
GenFdsGlobalVariable.WorkSpaceDir)
Macro = {}
Macro["WORKSPACE" ] = GenFdsGlobalVariable.WorkSpaceDir
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hc...@us...> - 2011-10-17 08:17:14
|
Revision: 2370
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2370&view=rev
Author: hchen30
Date: 2011-10-17 08:17:03 +0000 (Mon, 17 Oct 2011)
Log Message:
-----------
1. Remove the strict checkpoint for [in, out] and [in,out].
2. Remove the checkpoint of no initialization of CONST variables.
3. Fix a bug for getting wrong BOOLEAN type of some variables.
4. Fix a bug for wrong CSV report format.
5. Fix some coding style issues
Modified Paths:
--------------
trunk/BaseTools/Source/Python/Ecc/c.py
Modified: trunk/BaseTools/Source/Python/Ecc/c.py
===================================================================
--- trunk/BaseTools/Source/Python/Ecc/c.py 2011-10-13 08:47:16 UTC (rev 2369)
+++ trunk/BaseTools/Source/Python/Ecc/c.py 2011-10-17 08:17:03 UTC (rev 2370)
@@ -62,7 +62,7 @@
for Part in MsgPartList:
Msg += Part
Msg += ' '
- GetDB().TblReport.Insert(ErrorType, OtherMsg = Msg, BelongsToTable = TableName, BelongsToItem = ItemId)
+ GetDB().TblReport.Insert(ErrorType, OtherMsg=Msg, BelongsToTable=TableName, BelongsToItem=ItemId)
def GetIdType(Str):
Type = DataClass.MODEL_UNKNOWN
@@ -93,16 +93,16 @@
def GetIdentifierList():
IdList = []
for comment in FileProfile.CommentList:
- IdComment = DataClass.IdentifierClass(-1, '', '', '', comment.Content, DataClass.MODEL_IDENTIFIER_COMMENT, -1, -1, comment.StartPos[0],comment.StartPos[1],comment.EndPos[0],comment.EndPos[1])
+ IdComment = DataClass.IdentifierClass(-1, '', '', '', comment.Content, DataClass.MODEL_IDENTIFIER_COMMENT, -1, -1, comment.StartPos[0], comment.StartPos[1], comment.EndPos[0], comment.EndPos[1])
IdList.append(IdComment)
for pp in FileProfile.PPDirectiveList:
Type = GetIdType(pp.Content)
- IdPP = DataClass.IdentifierClass(-1, '', '', '', pp.Content, Type, -1, -1, pp.StartPos[0],pp.StartPos[1],pp.EndPos[0],pp.EndPos[1])
+ IdPP = DataClass.IdentifierClass(-1, '', '', '', pp.Content, Type, -1, -1, pp.StartPos[0], pp.StartPos[1], pp.EndPos[0], pp.EndPos[1])
IdList.append(IdPP)
for pe in FileProfile.PredicateExpressionList:
- IdPE = DataClass.IdentifierClass(-1, '', '', '', pe.Content, DataClass.MODEL_IDENTIFIER_PREDICATE_EXPRESSION, -1, -1, pe.StartPos[0],pe.StartPos[1],pe.EndPos[0],pe.EndPos[1])
+ IdPE = DataClass.IdentifierClass(-1, '', '', '', pe.Content, DataClass.MODEL_IDENTIFIER_PREDICATE_EXPRESSION, -1, -1, pe.StartPos[0], pe.StartPos[1], pe.EndPos[0], pe.EndPos[1])
IdList.append(IdPE)
FuncDeclPattern = GetFuncDeclPattern()
@@ -191,7 +191,7 @@
var.Modifier += ' ' + Name[LSBPos:]
Name = Name[0:LSBPos]
- IdVar = DataClass.IdentifierClass(-1, var.Modifier, '', Name, (len(DeclList) > 1 and [DeclList[1]]or [''])[0], DataClass.MODEL_IDENTIFIER_VARIABLE, -1, -1, var.StartPos[0],var.StartPos[1], VarNameStartLine, VarNameStartColumn)
+ IdVar = DataClass.IdentifierClass(-1, var.Modifier, '', Name, (len(DeclList) > 1 and [DeclList[1]]or [''])[0], DataClass.MODEL_IDENTIFIER_VARIABLE, -1, -1, var.StartPos[0], var.StartPos[1], VarNameStartLine, VarNameStartColumn)
IdList.append(IdVar)
else:
DeclList = var.Declarator.split('=')
@@ -200,15 +200,15 @@
LSBPos = var.Declarator.find('[')
var.Modifier += ' ' + Name[LSBPos:]
Name = Name[0:LSBPos]
- IdVar = DataClass.IdentifierClass(-1, var.Modifier, '', Name, (len(DeclList) > 1 and [DeclList[1]]or [''])[0], DataClass.MODEL_IDENTIFIER_VARIABLE, -1, -1, var.StartPos[0],var.StartPos[1], VarNameStartLine, VarNameStartColumn)
+ IdVar = DataClass.IdentifierClass(-1, var.Modifier, '', Name, (len(DeclList) > 1 and [DeclList[1]]or [''])[0], DataClass.MODEL_IDENTIFIER_VARIABLE, -1, -1, var.StartPos[0], var.StartPos[1], VarNameStartLine, VarNameStartColumn)
IdList.append(IdVar)
for enum in FileProfile.EnumerationDefinitionList:
LBPos = enum.Content.find('{')
RBPos = enum.Content.find('}')
Name = enum.Content[4:LBPos].strip()
- Value = enum.Content[LBPos+1:RBPos]
- IdEnum = DataClass.IdentifierClass(-1, '', '', Name, Value, DataClass.MODEL_IDENTIFIER_ENUMERATE, -1, -1, enum.StartPos[0],enum.StartPos[1],enum.EndPos[0],enum.EndPos[1])
+ Value = enum.Content[LBPos + 1:RBPos]
+ IdEnum = DataClass.IdentifierClass(-1, '', '', Name, Value, DataClass.MODEL_IDENTIFIER_ENUMERATE, -1, -1, enum.StartPos[0], enum.StartPos[1], enum.EndPos[0], enum.EndPos[1])
IdList.append(IdEnum)
for su in FileProfile.StructUnionDefinitionList:
@@ -226,8 +226,8 @@
Value = ''
else:
Name = su.Content[SkipLen:LBPos].strip()
- Value = su.Content[LBPos:RBPos+1]
- IdPE = DataClass.IdentifierClass(-1, '', '', Name, Value, Type, -1, -1, su.StartPos[0],su.StartPos[1],su.EndPos[0],su.EndPos[1])
+ Value = su.Content[LBPos:RBPos + 1]
+ IdPE = DataClass.IdentifierClass(-1, '', '', Name, Value, Type, -1, -1, su.StartPos[0], su.StartPos[1], su.EndPos[0], su.EndPos[1])
IdList.append(IdPE)
TdFuncPointerPattern = GetTypedefFuncPointerPattern()
@@ -238,7 +238,7 @@
if TdFuncPointerPattern.match(td.ToType):
Modifier = td.FromType
LBPos = td.ToType.find('(')
- TmpStr = td.ToType[LBPos+1:].strip()
+ TmpStr = td.ToType[LBPos + 1:].strip()
StarPos = TmpStr.find('*')
if StarPos != -1:
Modifier += ' ' + TmpStr[0:StarPos]
@@ -260,11 +260,11 @@
Value += Name[LBPos : RBPos + 1]
Name = Name[0 : LBPos]
- IdTd = DataClass.IdentifierClass(-1, Modifier, '', Name, Value, DataClass.MODEL_IDENTIFIER_TYPEDEF, -1, -1, td.StartPos[0],td.StartPos[1],td.EndPos[0],td.EndPos[1])
+ IdTd = DataClass.IdentifierClass(-1, Modifier, '', Name, Value, DataClass.MODEL_IDENTIFIER_TYPEDEF, -1, -1, td.StartPos[0], td.StartPos[1], td.EndPos[0], td.EndPos[1])
IdList.append(IdTd)
for funcCall in FileProfile.FunctionCallingList:
- IdFC = DataClass.IdentifierClass(-1, '', '', funcCall.FuncName, funcCall.ParamList, DataClass.MODEL_IDENTIFIER_FUNCTION_CALLING, -1, -1, funcCall.StartPos[0],funcCall.StartPos[1],funcCall.EndPos[0],funcCall.EndPos[1])
+ IdFC = DataClass.IdentifierClass(-1, '', '', funcCall.FuncName, funcCall.ParamList, DataClass.MODEL_IDENTIFIER_FUNCTION_CALLING, -1, -1, funcCall.StartPos[0], funcCall.StartPos[1], funcCall.EndPos[0], funcCall.EndPos[1])
IdList.append(IdFC)
return IdList
@@ -275,7 +275,7 @@
StrippedStr += Char
return StrippedStr
-def GetParamList(FuncDeclarator, FuncNameLine = 0, FuncNameOffset = 0):
+def GetParamList(FuncDeclarator, FuncNameLine=0, FuncNameOffset=0):
FuncDeclarator = StripComments(FuncDeclarator)
ParamIdList = []
#DeclSplitList = FuncDeclarator.split('(')
@@ -477,7 +477,7 @@
FuncNameStartColumn += 1
PreChar = FirstChar
- FuncObj = DataClass.FunctionClass(-1, FuncDef.Declarator, FuncDef.Modifier, FuncName.strip(), '', FuncDef.StartPos[0],FuncDef.StartPos[1],FuncDef.EndPos[0],FuncDef.EndPos[1], FuncDef.LeftBracePos[0], FuncDef.LeftBracePos[1], -1, ParamIdList, [], FuncNameStartLine, FuncNameStartColumn)
+ FuncObj = DataClass.FunctionClass(-1, FuncDef.Declarator, FuncDef.Modifier, FuncName.strip(), '', FuncDef.StartPos[0], FuncDef.StartPos[1], FuncDef.EndPos[0], FuncDef.EndPos[1], FuncDef.LeftBracePos[0], FuncDef.LeftBracePos[1], -1, ParamIdList, [], FuncNameStartLine, FuncNameStartColumn)
FuncObjList.append(FuncObj)
return FuncObjList
@@ -547,7 +547,7 @@
Db.UpdateIdentifierBelongsToFunction()
-def GetTableID(FullFileName, ErrorMsgList = None):
+def GetTableID(FullFileName, ErrorMsgList=None):
if ErrorMsgList == None:
ErrorMsgList = []
@@ -562,11 +562,11 @@
for Result in ResultSet:
if FileID != -1:
ErrorMsgList.append('Duplicate file ID found in DB for file %s' % FullFileName)
- return -2
+ return - 2
FileID = Result[0]
if FileID == -1:
ErrorMsgList.append('NO file ID found in DB for file %s' % FullFileName)
- return -1
+ return - 1
return FileID
def GetIncludeFileList(FullFileName):
@@ -645,7 +645,7 @@
while i < len(PES) - 1:
if (PES[i].isalnum() or PES[i] == '_' or PES[i] == '*') and LogicOpPos > PredicateBegin:
PredicateBegin = i
- if (PES[i] == '&' and PES[i+1] == '&') or (PES[i] == '|' and PES[i+1] == '|'):
+ if (PES[i] == '&' and PES[i + 1] == '&') or (PES[i] == '|' and PES[i + 1] == '|'):
LogicOpPos = i
Exp = PES[PredicateBegin:i].strip()
# Exp may contain '.' or '->'
@@ -670,7 +670,7 @@
PredicateList.append(Exp.rstrip(';').rstrip(')').strip())
return PredicateList
-def GetCNameList(Lvalue, StarList = []):
+def GetCNameList(Lvalue, StarList=[]):
Lvalue += ' '
i = 0
SearchBegin = 0
@@ -686,7 +686,7 @@
VarEnd = i
i += 1
elif VarEnd != -1:
- VarList.append(Lvalue[VarStart:VarEnd+1])
+ VarList.append(Lvalue[VarStart:VarEnd + 1])
i += 1
break
else:
@@ -714,7 +714,7 @@
return VarList
-def SplitPredicateByOp(Str, Op, IsFuncCalling = False):
+def SplitPredicateByOp(Str, Op, IsFuncCalling=False):
Name = Str.strip()
Value = None
@@ -760,7 +760,7 @@
return [Name]
Name = Str[0:Index + IndexInRemainingStr].strip()
- Value = Str[Index+IndexInRemainingStr+len(Op):].strip().strip(')')
+ Value = Str[Index + IndexInRemainingStr + len(Op):].strip().strip(')')
return [Name, Value]
TmpStr = Str.rstrip(';').rstrip(')')
@@ -769,7 +769,7 @@
if Index == -1:
return [Name]
- if Str[Index - 1].isalnum() or Str[Index - 1].isspace() or Str[Index - 1] == ')':
+ if Str[Index - 1].isalnum() or Str[Index - 1].isspace() or Str[Index - 1] == ')' or Str[Index - 1] == ']':
Name = Str[0:Index].strip()
Value = Str[Index + len(Op):].strip()
return [Name, Value]
@@ -826,15 +826,13 @@
def GetDataTypeFromModifier(ModifierStr):
MList = ModifierStr.split()
+ ReturnType = ''
for M in MList:
if M in EccGlobalData.gConfig.ModifierList:
- MList.remove(M)
+ continue
# remove array sufix
- if M.startswith('['):
- MList.remove(M)
-
- ReturnType = ''
- for M in MList:
+ if M.startswith('[') or M.endswith(']'):
+ continue
ReturnType += M + ' '
ReturnType = ReturnType.strip()
@@ -950,7 +948,7 @@
DoubleSlashComment = False
Index += 1
# check for */ comment end
- elif InComment and not DoubleSlashComment and ListFromStr[Index] == '*' and ListFromStr[Index+1] == '/':
+ elif InComment and not DoubleSlashComment and ListFromStr[Index] == '*' and ListFromStr[Index + 1] == '/':
ListFromStr[Index] = ' '
Index += 1
ListFromStr[Index] = ' '
@@ -961,12 +959,12 @@
ListFromStr[Index] = ' '
Index += 1
# check for // comment
- elif ListFromStr[Index] == '/' and ListFromStr[Index+1] == '/' and ListFromStr[Index+2] != '\n':
+ elif ListFromStr[Index] == '/' and ListFromStr[Index + 1] == '/' and ListFromStr[Index + 2] != '\n':
InComment = True
DoubleSlashComment = True
# check for /* comment start
- elif ListFromStr[Index] == '/' and ListFromStr[Index+1] == '*':
+ elif ListFromStr[Index] == '/' and ListFromStr[Index + 1] == '*':
ListFromStr[Index] = ' '
Index += 1
ListFromStr[Index] = ' '
@@ -1024,7 +1022,7 @@
return None
-def GetRealType(Type, TypedefDict, TargetType = None):
+def GetRealType(Type, TypedefDict, TargetType=None):
if TargetType != None and Type == TargetType:
return Type
while TypedefDict.get(Type):
@@ -1033,7 +1031,7 @@
return Type
return Type
-def GetTypeInfo(RefList, Modifier, FullFileName, TargetType = None):
+def GetTypeInfo(RefList, Modifier, FullFileName, TargetType=None):
TypedefDict = GetTypedefDict(FullFileName)
SUDict = GetSUDict(FullFileName)
Type = GetDataTypeFromModifier(Modifier).replace('*', '').strip()
@@ -1051,7 +1049,7 @@
# we only want to check if it is a pointer
else:
Type = FromType
- if Type.find('*') != -1 and Index == len(RefList)-1:
+ if Type.find('*') != -1 and Index == len(RefList) - 1:
return Type
Type = FromType.split()[0]
@@ -1061,7 +1059,7 @@
return Type
-def GetVarInfo(PredVarList, FuncRecord, FullFileName, IsFuncCall = False, TargetType = None, StarList = None):
+def GetVarInfo(PredVarList, FuncRecord, FullFileName, IsFuncCall=False, TargetType=None, StarList=None):
PredVar = PredVarList[0]
FileID = GetTableID(FullFileName)
@@ -1536,7 +1534,7 @@
FL.append(Result)
for F in FL:
- SqlStatement = """ select Name, Value, ID
+ SqlStatement = """ select Name, Value, ID, Modifier
from %s
where Model = %d and BelongsToFunction = %d
""" % (FileTable, DataClass.MODEL_IDENTIFIER_VARIABLE, F[0])
@@ -1545,7 +1543,7 @@
continue
for Result in ResultSet:
- if len(Result[1]) > 0:
+ if len(Result[1]) > 0 and 'CONST' not in Result[3]:
PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_NO_INIT_OF_VARIABLE, 'Variable Name: %s' % Result[0], FileTable, Result[2])
def CheckMemberVariableFormat(Name, Value, FileTable, TdId, ModelId):
@@ -1687,9 +1685,9 @@
# Check member variable format.
ErrMsgList = CheckMemberVariableFormat(Name, Value, FileTable, Td[5], ModelId)
for ErrMsg in ErrMsgList:
- if EccGlobalData.gException.IsException(ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME, Name+'.'+ErrMsg):
+ if EccGlobalData.gException.IsException(ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME, Name + '.' + ErrMsg):
continue
- PrintErrorMsg(ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME, 'Member variable [%s] NOT follow naming convention.' % (Name+'.'+ErrMsg), FileTable, Td[5])
+ PrintErrorMsg(ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME, 'Member variable [%s] NOT follow naming convention.' % (Name + '.' + ErrMsg), FileTable, Td[5])
# First check in current file to see whether struct/union/enum is typedef-ed.
UntypedefedList = []
@@ -1710,9 +1708,9 @@
continue
ErrMsgList = CheckMemberVariableFormat(Name, Value, FileTable, Result[3], ModelId)
for ErrMsg in ErrMsgList:
- if EccGlobalData.gException.IsException(ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME, Result[0]+'.'+ErrMsg):
+ if EccGlobalData.gException.IsException(ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME, Result[0] + '.' + ErrMsg):
continue
- PrintErrorMsg(ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME, 'Member variable [%s] NOT follow naming convention.' % (Result[0]+'.'+ErrMsg), FileTable, Result[3])
+ PrintErrorMsg(ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME, 'Member variable [%s] NOT follow naming convention.' % (Result[0] + '.' + ErrMsg), FileTable, Result[3])
# Check whether it is typedefed.
Found = False
for Td in TdList:
@@ -1949,7 +1947,7 @@
if SearchInCache:
Type = FuncReturnTypeDict.get(PredVarStr)
if Type != None:
- if Type.find('*') != -1:
+ if Type.find('*') != -1 and Type != 'BOOLEAN*':
PrintErrorMsg(ERROR_PREDICATE_EXPRESSION_CHECK_COMPARISON_NULL_TYPE, 'Predicate Expression: %s' % Exp, FileTable, Str[2])
continue
@@ -1962,7 +1960,7 @@
if Type == None:
continue
Type = GetTypeFromArray(Type, PredVarStr)
- if Type.find('*') != -1:
+ if Type.find('*') != -1 and Type != 'BOOLEAN*':
PrintErrorMsg(ERROR_PREDICATE_EXPRESSION_CHECK_COMPARISON_NULL_TYPE, 'Predicate Expression: %s' % Exp, FileTable, Str[2])
def CheckNonBooleanValueComparison(FullFileName):
@@ -2004,8 +2002,6 @@
continue
for Exp in GetPredicateListFromPredicateExpStr(Str[0]):
-# if p.match(Exp):
-# continue
PredInfo = SplitPredicateStr(Exp)
if PredInfo[1] == None:
PredVarStr = PredInfo[0][0].strip()
@@ -2037,7 +2033,6 @@
if PredVarStr in FuncReturnTypeDict:
continue
-
Type = GetVarInfo(PredVarList, FuncRecord, FullFileName, IsFuncCall, 'BOOLEAN', StarList)
if SearchInCache:
FuncReturnTypeDict[PredVarStr] = Type
@@ -2446,7 +2441,7 @@
return DoxygenStrList
-def CheckGeneralDoxygenCommentLayout(Str, StartLine, ErrorMsgList, CommentId = -1, TableName = ''):
+def CheckGeneralDoxygenCommentLayout(Str, StartLine, ErrorMsgList, CommentId= -1, TableName=''):
#/** --*/ @retval after @param
if not Str.startswith('/**'):
ErrorMsgList.append('Line %d : Comment does NOT have prefix /** ' % StartLine)
@@ -2460,7 +2455,7 @@
ErrorMsgList.append('Line %d : @retval appear before @param ' % StartLine)
PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER, 'in Comment, @retval appear before @param ', TableName, CommentId)
-def CheckFunctionHeaderConsistentWithDoxygenComment(FuncModifier, FuncHeader, FuncStartLine, CommentStr, CommentStartLine, ErrorMsgList, CommentId = -1, TableName = ''):
+def CheckFunctionHeaderConsistentWithDoxygenComment(FuncModifier, FuncHeader, FuncStartLine, CommentStr, CommentStartLine, ErrorMsgList, CommentId= -1, TableName=''):
ParamList = GetParamList(FuncHeader)
CheckGeneralDoxygenCommentLayout(CommentStr, CommentStartLine, ErrorMsgList, CommentId, TableName)
@@ -2480,18 +2475,18 @@
ParamName = ParamList[Index].Name.strip()
Tag = DoxygenStrList[Index].strip(' ')
if (not Tag[-1] == ('\n')) and (not Tag[-1] == ('\r')):
- ErrorMsgList.append('Line %d : in Comment, \"%s\" does NOT end with new line ' % (CommentStartLine, Tag.replace('\n', '').replace('\r', '')))
- PrintErrorMsg(ERROR_HEADER_CHECK_FUNCTION, 'in Comment, \"%s\" does NOT end with new line ' % (Tag.replace('\n', '').replace('\r', '')), TableName, CommentId)
+ ErrorMsgList.append('Line %d : in Comment, <%s> does NOT end with new line ' % (CommentStartLine, Tag.replace('\n', '').replace('\r', '')))
+ PrintErrorMsg(ERROR_HEADER_CHECK_FUNCTION, 'in Comment, <%s> does NOT end with new line ' % (Tag.replace('\n', '').replace('\r', '')), TableName, CommentId)
TagPartList = Tag.split()
if len(TagPartList) < 2:
- ErrorMsgList.append('Line %d : in Comment, \"%s\" does NOT contain doxygen contents ' % (CommentStartLine, Tag.replace('\n', '').replace('\r', '')))
- PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER, 'in Comment, \"%s\" does NOT contain doxygen contents ' % (Tag.replace('\n', '').replace('\r', '')), TableName, CommentId)
+ ErrorMsgList.append('Line %d : in Comment, <%s> does NOT contain doxygen contents ' % (CommentStartLine, Tag.replace('\n', '').replace('\r', '')))
+ PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER, 'in Comment, <%s> does NOT contain doxygen contents ' % (Tag.replace('\n', '').replace('\r', '')), TableName, CommentId)
Index += 1
continue
LBPos = Tag.find('[')
RBPos = Tag.find(']')
ParamToLBContent = Tag[len('@param'):LBPos].strip()
- if LBPos > 0 and len(ParamToLBContent)==0 and RBPos > LBPos:
+ if LBPos > 0 and len(ParamToLBContent) == 0 and RBPos > LBPos:
InOutStr = ''
ModifierPartList = ParamModifier.split()
for Part in ModifierPartList:
@@ -2504,12 +2499,19 @@
InOutStr = 'out'
if InOutStr != '':
- if Tag.find('['+InOutStr+']') == -1:
- ErrorMsgList.append('Line %d : in Comment, \"%s\" does NOT have %s ' % (CommentStartLine, (TagPartList[0] + ' ' +TagPartList[1]).replace('\n', '').replace('\r', ''), '['+InOutStr+']'))
- PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER, 'in Comment, \"%s\" does NOT have %s ' % ((TagPartList[0] + ' ' +TagPartList[1]).replace('\n', '').replace('\r', ''), '['+InOutStr+']'), TableName, CommentId)
+ if Tag.find('[' + InOutStr + ']') == -1:
+ if InOutStr != 'in, out':
+ ErrorMsgList.append('Line %d : in Comment, <%s> does NOT have %s ' % (CommentStartLine, (TagPartList[0] + ' ' + TagPartList[1]).replace('\n', '').replace('\r', ''), '[' + InOutStr + ']'))
+ PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER, 'in Comment, <%s> does NOT have %s ' % ((TagPartList[0] + ' ' + TagPartList[1]).replace('\n', '').replace('\r', ''), '[' + InOutStr + ']'), TableName, CommentId)
+ else:
+ if Tag.find('[in,out]') == -1:
+ ErrorMsgList.append('Line %d : in Comment, <%s> does NOT have %s ' % (CommentStartLine, (TagPartList[0] + ' ' + TagPartList[1]).replace('\n', '').replace('\r', ''), '[' + InOutStr + ']'))
+ PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER, 'in Comment, <%s> does NOT have %s ' % ((TagPartList[0] + ' ' + TagPartList[1]).replace('\n', '').replace('\r', ''), '[' + InOutStr + ']'), TableName, CommentId)
+
+
if Tag.find(ParamName) == -1 and ParamName != 'VOID' and ParamName != 'void':
- ErrorMsgList.append('Line %d : in Comment, \"%s\" does NOT consistent with parameter name %s ' % (CommentStartLine, (TagPartList[0] + ' ' +TagPartList[1]).replace('\n', '').replace('\r', ''), ParamName))
- PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER, 'in Comment, \"%s\" does NOT consistent with parameter name %s ' % ((TagPartList[0] + ' ' +TagPartList[1]).replace('\n', '').replace('\r', ''), ParamName), TableName, CommentId)
+ ErrorMsgList.append('Line %d : in Comment, <%s> does NOT consistent with parameter name %s ' % (CommentStartLine, (TagPartList[0] + ' ' + TagPartList[1]).replace('\n', '').replace('\r', ''), ParamName))
+ PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER, 'in Comment, <%s> does NOT consistent with parameter name %s ' % ((TagPartList[0] + ' ' + TagPartList[1]).replace('\n', '').replace('\r', ''), ParamName), TableName, CommentId)
Index += 1
if Index < ParamNumber:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2011-10-13 08:47:22
|
Revision: 2369
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2369&view=rev
Author: jsu1
Date: 2011-10-13 08:47:16 +0000 (Thu, 13 Oct 2011)
Log Message:
-----------
Update expression evaluation according following rule:
1. +/- with Boolean involved will be evaluated but report warning message, and the result will be same as regarding TRUE as 1 and FALSE as 0.
2. Comparison between string and number/Boolean:
== will always return FALSE, and warning message given
!= will always return TRUE, and warning message given
Others are not supported and error message given
3. Comparison between number and Boolean will be evaluated success, and the result will be same as regarding TRUE as 1 and FALSE as 0.
Reviewed-by: yingke
Signed-off-by: jsu1
Modified Paths:
--------------
trunk/BaseTools/Source/Python/Common/Expression.py
trunk/BaseTools/Source/Python/CommonDataClass/Exceptions.py
trunk/BaseTools/Source/Python/GenFds/FdfParser.py
trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py
Modified: trunk/BaseTools/Source/Python/Common/Expression.py
===================================================================
--- trunk/BaseTools/Source/Python/Common/Expression.py 2011-10-13 05:20:11 UTC (rev 2368)
+++ trunk/BaseTools/Source/Python/Common/Expression.py 2011-10-13 08:47:16 UTC (rev 2369)
@@ -15,6 +15,7 @@
from Common.GlobalData import *
from CommonDataClass.Exceptions import BadExpression
from CommonDataClass.Exceptions import SymbolNotFound
+from CommonDataClass.Exceptions import WrnExpression
from Misc import GuidStringToGuidStructureString
ERR_STRING_EXPR = 'This operator cannot be used in string expression: [%s].'
@@ -28,7 +29,10 @@
ERR_EXPR_TYPE = 'Different types found in expression.'
ERR_OPERATOR_UNSUPPORT = 'Unsupported operator: [%s]'
ERR_REL_NOT_IN = 'Expect "IN" after "not" operator.'
-ERR_BOOL_EXPR = 'Operand of boolean type cannot be used in arithmetic expression.'
+WRN_BOOL_EXPR = 'Operand of boolean type cannot be used in arithmetic expression.'
+WRN_EQCMP_STR_OTHERS = '== Comparison between Operand of string type and Boolean/Number Type always return False.'
+WRN_NECMP_STR_OTHERS = '!= Comparison between Operand of string type and Boolean/Number Type always return True.'
+ERR_RELCMP_STR_OTHERS = 'Operator taking Operand of string type and Boolean/Number Type is not allowed: [%s].'
ERR_STRING_CMP = 'Unicode string and general string cannot be compared: [%s %s %s]'
ERR_ARRAY_TOKEN = 'Bad C array or C format GUID token: [%s].'
ERR_ARRAY_ELE = 'This must be HEX value for NList or Array: [%s].'
@@ -128,13 +132,12 @@
@staticmethod
def Eval(Operator, Oprand1, Oprand2 = None):
+ WrnExp = None
+
if Operator not in ["==", "!=", ">=", "<=", ">", "<", "in", "not in"] and \
(type(Oprand1) == type('') or type(Oprand2) == type('')):
raise BadExpression(ERR_STRING_EXPR % Operator)
- if type(Oprand1) == type(True) and Operator in ['+', '-', '&', '|', '^']:
- raise BadExpression(ERR_BOOL_EXPR)
-
TypeDict = {
type(0) : 0,
type(0L) : 0,
@@ -148,9 +151,31 @@
raise BadExpression(ERR_STRING_EXPR % Operator)
EvalStr = 'not Oprand1'
else:
- if TypeDict[type(Oprand1)] != TypeDict[type(Oprand2)]:
- raise BadExpression(ERR_EXPR_TYPE)
- if type(Oprand1) == type(''):
+ if Operator in ["+", "-"] and (type(True) in [type(Oprand1), type(Oprand2)]):
+ # Boolean in '+'/'-' will be evaluated but raise warning
+ WrnExp = WrnExpression(WRN_BOOL_EXPR)
+ elif type('') in [type(Oprand1), type(Oprand2)] and type(Oprand1)!= type(Oprand2):
+ # == between string and number/boolean will always return False, != return True
+ if Operator == "==":
+ WrnExp = WrnExpression(WRN_EQCMP_STR_OTHERS)
+ WrnExp.result = False
+ raise WrnExp
+ elif Operator == "!=":
+ WrnExp = WrnExpression(WRN_EQCMP_STR_OTHERS)
+ WrnExp.result = True
+ raise WrnExp
+ else:
+ raise BadExpression(ERR_RELCMP_STR_OTHERS % Operator)
+ elif TypeDict[type(Oprand1)] != TypeDict[type(Oprand2)]:
+ if Operator in ["==", "!=", ">=", "<=", ">", "<"] and set((TypeDict[type(Oprand1)], TypeDict[type(Oprand2)])) == set((TypeDict[type(True)], TypeDict[type(0)])):
+ # comparison between number and boolean is allowed
+ pass
+ if Operator in ['&', '|', '^', "&&", "||"] and set((TypeDict[type(Oprand1)], TypeDict[type(Oprand2)])) == set((TypeDict[type(True)], TypeDict[type(0)])):
+ # bitwise and logical operation between number and boolean is allowed
+ pass
+ else:
+ raise BadExpression(ERR_EXPR_TYPE)
+ if type(Oprand1) == type('') and type(Oprand2) == type(''):
if (Oprand1.startswith('L"') and not Oprand2.startswith('L"')) or \
(not Oprand1.startswith('L"') and Oprand2.startswith('L"')):
raise BadExpression(ERR_STRING_CMP % (Oprand1, Operator, Oprand2))
@@ -173,6 +198,10 @@
Val = True
else:
Val = False
+
+ if WrnExp:
+ WrnExp.result = Val
+ raise WrnExp
return Val
def __init__(self, Expression, SymbolTable={}):
Modified: trunk/BaseTools/Source/Python/CommonDataClass/Exceptions.py
===================================================================
--- trunk/BaseTools/Source/Python/CommonDataClass/Exceptions.py 2011-10-13 05:20:11 UTC (rev 2368)
+++ trunk/BaseTools/Source/Python/CommonDataClass/Exceptions.py 2011-10-13 08:47:16 UTC (rev 2369)
@@ -10,12 +10,6 @@
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-##
-# Import Modules
-#
-import Common.EdkLogger as EdkLogger
-
-
## Exceptions used in Expression
class EvaluationException(Exception):
pass
@@ -23,6 +17,9 @@
class BadExpression(EvaluationException):
pass
+class WrnExpression(Exception):
+ pass
+
## Exceptions used in macro replacements
class MacroException(Exception):
pass
Modified: trunk/BaseTools/Source/Python/GenFds/FdfParser.py
===================================================================
--- trunk/BaseTools/Source/Python/GenFds/FdfParser.py 2011-10-13 05:20:11 UTC (rev 2368)
+++ trunk/BaseTools/Source/Python/GenFds/FdfParser.py 2011-10-13 08:47:16 UTC (rev 2369)
@@ -712,6 +712,15 @@
return ValueExpression(Expression, InputMacroDict)()
except SymbolNotFound:
return False
+ except WrnExpression, Excpt:
+ #
+ # Catch expression evaluation warning here. We need to report
+ # the precise number of line and return the evaluation result
+ #
+ EdkLogger.warn('Parser', "Suspicious expression: %s" % str(Excpt),
+ File=self.FileName, ExtraData=self.__CurrentLine(),
+ Line=Line)
+ return Excpt.result
except Exception, Excpt:
raise Warning("Invalid expression", *FileLineTuple)
else:
Modified: trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py
===================================================================
--- trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py 2011-10-13 05:20:11 UTC (rev 2368)
+++ trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py 2011-10-13 08:47:16 UTC (rev 2369)
@@ -1182,6 +1182,15 @@
except SymbolNotFound, Exc:
EdkLogger.debug(EdkLogger.DEBUG_5, str(Exc), self._ValueList[1])
Result = False
+ except WrnExpression, Excpt:
+ #
+ # Catch expression evaluation warning here. We need to report
+ # the precise number of line and return the evaluation result
+ #
+ EdkLogger.warn('Parser', "Suspicious expression: %s" % str(Excpt),
+ File=self._FileWithError, ExtraData=' '.join(self._ValueList),
+ Line=self._LineIndex+1)
+ Result = Excpt.result
if self._ItemType in [MODEL_META_DATA_CONDITIONAL_STATEMENT_IF,
MODEL_META_DATA_CONDITIONAL_STATEMENT_IFDEF,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gi...@us...> - 2011-10-13 05:20:18
|
Revision: 2368
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2368&view=rev
Author: gikidy
Date: 2011-10-13 05:20:11 +0000 (Thu, 13 Oct 2011)
Log Message:
-----------
Add -Map option for generate map file for ELFGCC DLINK flags.
Signed-off-by: gikidy
Reviewed-by: lgao4
Modified Paths:
--------------
trunk/BaseTools/Conf/tools_def.template
Modified: trunk/BaseTools/Conf/tools_def.template
===================================================================
--- trunk/BaseTools/Conf/tools_def.template 2011-10-12 02:36:57 UTC (rev 2367)
+++ trunk/BaseTools/Conf/tools_def.template 2011-10-13 05:20:11 UTC (rev 2368)
@@ -2473,7 +2473,7 @@
*_ELFGCC_IA32_CC_FLAGS = -m32 -g -fshort-wchar -fno-strict-aliasing -Wall -malign-double -c -include $(DEST_DIR_DEBUG)/AutoGen.h -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
*_ELFGCC_IA32_SLINK_FLAGS =
-*_ELFGCC_IA32_DLINK_FLAGS = -melf_i386 -nostdlib --shared --entry $(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT)
+*_ELFGCC_IA32_DLINK_FLAGS = -melf_i386 -nostdlib --shared --entry $(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map
#*_ELFGCC_IA32_DLINK_FLAGS = -melf_i386 -nostdlib -n -q -Ttext 0x220 --entry $(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT)
*_ELFGCC_IA32_ASM_FLAGS = -m32 -c -x assembler -imacros $(DEST_DIR_DEBUG)/AutoGen.h
*_ELFGCC_IA32_PP_FLAGS = -m32 -E -x assembler-with-cpp -include $(DEST_DIR_DEBUG)/AutoGen.h
@@ -2496,7 +2496,7 @@
*_ELFGCC_X64_RC_PATH = DEF(ELFGCC_BIN)/objcopy
*_ELFGCC_X64_CC_FLAGS = -Os -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-missing-braces -Wno-address -Wno-array-bounds -c -include AutoGen.h -D_EFI_P64
-*_ELFGCC_X64_DLINK_FLAGS = -nostdlib --shared --entry $(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT)
+*_ELFGCC_X64_DLINK_FLAGS = -nostdlib --shared --entry $(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map
*_ELFGCC_X64_SLINK_FLAGS =
*_ELFGCC_X64_ASM_FLAGS = -c -x assembler -imacros $(DEST_DIR_DEBUG)/AutoGen.h
*_ELFGCC_X64_PP_FLAGS = -E -x assembler-with-cpp -include $(DEST_DIR_DEBUG)/AutoGen.h
@@ -2518,7 +2518,7 @@
*_ELFGCC_IPF_RC_PATH = DEF(ELFGCC_BIN)/objcopy
*_ELFGCC_IPF_CC_FLAGS = -Os -fshort-wchar -Wall -Werror -c -include AutoGen.h -D_EFI_P64
-*_ELFGCC_IPF_DLINK_FLAGS = -nostdlib --shared --entry $(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT)
+*_ELFGCC_IPF_DLINK_FLAGS = -nostdlib --shared --entry $(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map
*_ELFGCC_IPF_SLINK_FLAGS =
*_ELFGCC_IPF_ASM_FLAGS = -c -x assembler -imacros $(DEST_DIR_DEBUG)/AutoGen.h
*_ELFGCC_IPF_PP_FLAGS = -E -x assembler-with-cpp -include $(DEST_DIR_DEBUG)/AutoGen.h
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2011-10-12 02:37:04
|
Revision: 2367
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2367&view=rev
Author: jsu1
Date: 2011-10-12 02:36:57 +0000 (Wed, 12 Oct 2011)
Log Message:
-----------
Commit following fix back:
gikidy 10/13/2010 1:03:57 PM
support format other than "TRUE", "FALSE" for a boolean type PCD, more precisely, following formats are supported:
'TRUE', 'true', 'True', '0x01', '0x1', '1'
'FALSE', 'false', 'False', '0x00', '0x0', '0'
Reviewed-by: gikidy
Signed-off-by: jsu1
Modified Paths:
--------------
trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py
Modified: trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py
===================================================================
--- trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py 2011-10-11 02:36:57 UTC (rev 2366)
+++ trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py 2011-10-12 02:36:57 UTC (rev 2367)
@@ -602,6 +602,14 @@
ExtraData=self._CurrentLine + " (<TokenSpaceGuidCName>.<PcdCName>)",
File=self.MetaFile, Line=self._LineIndex+1)
+ # if value are 'True', 'true', 'TRUE' or 'False', 'false', 'FALSE', replace with integer 1 or 0.
+ if self._ValueList[2] != '':
+ InfPcdValueList = GetSplitValueList(TokenList[1], TAB_VALUE_SPLIT, 1)
+ if InfPcdValueList[0] in ['True', 'true', 'TRUE']:
+ self._ValueList[2] = TokenList[1].replace(InfPcdValueList[0], '1', 1);
+ elif InfPcdValueList[0] in ['False', 'false', 'FALSE']:
+ self._ValueList[2] = TokenList[1].replace(InfPcdValueList[0], '0', 1);
+
## [depex] section parser
@ParseMacro
def _DepexParser(self):
@@ -932,6 +940,12 @@
EdkLogger.error('Parser', FORMAT_INVALID, "No PCD value given",
ExtraData=self._CurrentLine + " (<TokenSpaceGuidCName>.<TokenCName>|<PcdValue>)",
File=self.MetaFile, Line=self._LineIndex+1)
+ # if value are 'True', 'true', 'TRUE' or 'False', 'false', 'FALSE', replace with integer 1 or 0.
+ DscPcdValueList = GetSplitValueList(TokenList[1], TAB_VALUE_SPLIT, 1)
+ if DscPcdValueList[0] in ['True', 'true', 'TRUE']:
+ self._ValueList[2] = TokenList[1].replace(DscPcdValueList[0], '1', 1);
+ elif DscPcdValueList[0] in ['False', 'false', 'FALSE']:
+ self._ValueList[2] = TokenList[1].replace(DscPcdValueList[0], '0', 1);
## [components] section parser
@ParseMacro
@@ -1547,6 +1561,11 @@
EdkLogger.error('Parser', FORMAT_INVALID, Cause, ExtraData=self._CurrentLine,
File=self.MetaFile, Line=self._LineIndex+1)
+ if ValueList[0] in ['True', 'true', 'TRUE']:
+ ValueList[0] = '1'
+ elif ValueList[0] in ['False', 'false', 'FALSE']:
+ ValueList[0] = '0'
+
self._ValueList[2] = ValueList[0].strip() + '|' + ValueList[1].strip() + '|' + ValueList[2].strip()
_SectionParser = {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yd...@us...> - 2011-10-11 02:37:03
|
Revision: 2366
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2366&view=rev
Author: ydong10
Date: 2011-10-11 02:36:57 +0000 (Tue, 11 Oct 2011)
Log Message:
-----------
Enable goto op-code to have the question option list
Signed-off-by: ydong10
Reviewed-by: lgao4
Modified Paths:
--------------
branches/Releases/BaseTools_r2100/Source/C/VfrCompile/VfrSyntax.g
Modified: branches/Releases/BaseTools_r2100/Source/C/VfrCompile/VfrSyntax.g
===================================================================
--- branches/Releases/BaseTools_r2100/Source/C/VfrCompile/VfrSyntax.g 2011-10-11 02:33:50 UTC (rev 2365)
+++ branches/Releases/BaseTools_r2100/Source/C/VfrCompile/VfrSyntax.g 2011-10-11 02:36:57 UTC (rev 2366)
@@ -1646,6 +1646,7 @@
EFI_QUESTION_ID QId = EFI_QUESTION_ID_INVALID;
UINT32 BitMask;
CIfrQuestionHeader *QHObj = NULL;
+ CIfrOpHeader *OHObj = NULL;
CIfrRef *R1Obj = NULL;
CIfrRef2 *R2Obj = NULL;
CIfrRef3 *R3Obj = NULL;
@@ -1705,6 +1706,7 @@
{
R5Obj = new CIfrRef5;
QHObj = R5Obj;
+ OHObj = R5Obj;
R5Obj->SetLineNo(G->getLine());
break;
}
@@ -1712,6 +1714,7 @@
{
R4Obj = new CIfrRef4;
QHObj = R4Obj;
+ OHObj = R4Obj;
R4Obj->SetLineNo(G->getLine());
R4Obj->SetDevicePath (DevPath);
R4Obj->SetFormSetId (FSId);
@@ -1723,6 +1726,7 @@
{
R3Obj = new CIfrRef3;
QHObj = R3Obj;
+ OHObj = R3Obj;
R3Obj->SetLineNo(G->getLine());
R3Obj->SetFormSetId (FSId);
R3Obj->SetFormId (FId);
@@ -1733,6 +1737,7 @@
{
R2Obj = new CIfrRef2;
QHObj = R2Obj;
+ OHObj = R2Obj;
R2Obj->SetLineNo(G->getLine());
R2Obj->SetFormId (FId);
R2Obj->SetQuestionId (QId);
@@ -1742,6 +1747,7 @@
{
R1Obj = new CIfrRef;
QHObj = R1Obj;
+ OHObj = R1Obj;
R1Obj->SetLineNo(G->getLine());
R1Obj->SetFormId (FId);
break;
@@ -1750,11 +1756,14 @@
}
>>
vfrQuestionHeader[*QHObj, QUESTION_REF]
- { "," vfrStatementStatTagList }
{ "," F:FLAGS "=" vfrGotoFlags[QHObj, F->getLine()] }
{
"," Key "=" KN:Number << AssignQuestionKey (*QHObj, KN); >>
}
+ {
+ E:","
+ vfrStatementQuestionOptionList << OHObj->SetScope(1); CRT_END_OP (E);>>
+ }
";" << if (R1Obj != NULL) {delete R1Obj;} if (R2Obj != NULL) {delete R2Obj;} if (R3Obj != NULL) {delete R3Obj;} if (R4Obj != NULL) {delete R4Obj;} if (R5Obj != NULL) {delete R5Obj;}>>
;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yd...@us...> - 2011-10-11 02:33:56
|
Revision: 2365
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2365&view=rev
Author: ydong10
Date: 2011-10-11 02:33:50 +0000 (Tue, 11 Oct 2011)
Log Message:
-----------
Enable goto op-code to have the question option list
Signed-off-by: ydong10
Reviewed-by: lgao4
Modified Paths:
--------------
trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g
Modified: trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g
===================================================================
--- trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g 2011-10-10 14:38:38 UTC (rev 2364)
+++ trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g 2011-10-11 02:33:50 UTC (rev 2365)
@@ -1646,6 +1646,7 @@
EFI_QUESTION_ID QId = EFI_QUESTION_ID_INVALID;
UINT32 BitMask;
CIfrQuestionHeader *QHObj = NULL;
+ CIfrOpHeader *OHObj = NULL;
CIfrRef *R1Obj = NULL;
CIfrRef2 *R2Obj = NULL;
CIfrRef3 *R3Obj = NULL;
@@ -1705,6 +1706,7 @@
{
R5Obj = new CIfrRef5;
QHObj = R5Obj;
+ OHObj = R5Obj;
R5Obj->SetLineNo(G->getLine());
break;
}
@@ -1712,6 +1714,7 @@
{
R4Obj = new CIfrRef4;
QHObj = R4Obj;
+ OHObj = R4Obj;
R4Obj->SetLineNo(G->getLine());
R4Obj->SetDevicePath (DevPath);
R4Obj->SetFormSetId (FSId);
@@ -1723,6 +1726,7 @@
{
R3Obj = new CIfrRef3;
QHObj = R3Obj;
+ OHObj = R3Obj;
R3Obj->SetLineNo(G->getLine());
R3Obj->SetFormSetId (FSId);
R3Obj->SetFormId (FId);
@@ -1733,6 +1737,7 @@
{
R2Obj = new CIfrRef2;
QHObj = R2Obj;
+ OHObj = R2Obj;
R2Obj->SetLineNo(G->getLine());
R2Obj->SetFormId (FId);
R2Obj->SetQuestionId (QId);
@@ -1742,6 +1747,7 @@
{
R1Obj = new CIfrRef;
QHObj = R1Obj;
+ OHObj = R1Obj;
R1Obj->SetLineNo(G->getLine());
R1Obj->SetFormId (FId);
break;
@@ -1750,11 +1756,14 @@
}
>>
vfrQuestionHeader[*QHObj, QUESTION_REF]
- { "," vfrStatementStatTagList }
{ "," F:FLAGS "=" vfrGotoFlags[QHObj, F->getLine()] }
{
"," Key "=" KN:Number << AssignQuestionKey (*QHObj, KN); >>
}
+ {
+ E:","
+ vfrStatementQuestionOptionList << OHObj->SetScope(1); CRT_END_OP (E);>>
+ }
";" << if (R1Obj != NULL) {delete R1Obj;} if (R2Obj != NULL) {delete R2Obj;} if (R3Obj != NULL) {delete R3Obj;} if (R4Obj != NULL) {delete R4Obj;} if (R5Obj != NULL) {delete R5Obj;}>>
;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yd...@us...> - 2011-10-10 14:38:44
|
Revision: 2364
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2364&view=rev
Author: ydong10
Date: 2011-10-10 14:38:38 +0000 (Mon, 10 Oct 2011)
Log Message:
-----------
Refine check question id validation logic to avoid label conflict
Signed-off-by: ydong10
Reviewed-by: lgao4
Modified Paths:
--------------
branches/Releases/BaseTools_r2100/Source/C/VfrCompile/VfrFormPkg.h
branches/Releases/BaseTools_r2100/Source/C/VfrCompile/VfrSyntax.g
Modified: branches/Releases/BaseTools_r2100/Source/C/VfrCompile/VfrFormPkg.h
===================================================================
--- branches/Releases/BaseTools_r2100/Source/C/VfrCompile/VfrFormPkg.h 2011-10-10 14:30:06 UTC (rev 2363)
+++ branches/Releases/BaseTools_r2100/Source/C/VfrCompile/VfrFormPkg.h 2011-10-10 14:38:38 UTC (rev 2364)
@@ -1061,12 +1061,8 @@
mRef2->FormId = FormId;
}
- EFI_VFR_RETURN_CODE SetQuestionId (IN EFI_QUESTION_ID QuestionId) {
- if (QuestionId == EFI_QUESTION_ID_INVALID) {
- return VFR_RETURN_UNDEFINED;
- }
+ VOID SetQuestionId (IN EFI_QUESTION_ID QuestionId) {
mRef2->QuestionId = QuestionId;
- return VFR_RETURN_SUCCESS;
}
};
Modified: branches/Releases/BaseTools_r2100/Source/C/VfrCompile/VfrSyntax.g
===================================================================
--- branches/Releases/BaseTools_r2100/Source/C/VfrCompile/VfrSyntax.g 2011-10-10 14:30:06 UTC (rev 2363)
+++ branches/Releases/BaseTools_r2100/Source/C/VfrCompile/VfrSyntax.g 2011-10-10 14:38:38 UTC (rev 2364)
@@ -1682,8 +1682,13 @@
FormId "=" F3:Number "," << RefType = 2; FId = _STOFID(F3->getText()); >>
Question "="
(
- QN3:StringIdentifier "," << mCVfrQuestionDB.GetQuestionId (QN3->getText (), NULL, QId, BitMask); >>
- | QN3:Number "," << QId = _STOQID(QN3->getText()); >>
+ QN3:StringIdentifier "," <<
+ mCVfrQuestionDB.GetQuestionId (QN3->getText (), NULL, QId, BitMask);
+ if (QId == EFI_QUESTION_ID_INVALID) {
+ _PCATCH(VFR_RETURN_UNDEFINED, QN3);
+ }
+ >>
+ | QN4:Number "," << QId = _STOQID(QN4->getText()); >>
)
)
|
@@ -1730,7 +1735,7 @@
QHObj = R2Obj;
R2Obj->SetLineNo(G->getLine());
R2Obj->SetFormId (FId);
- _PCATCH(R2Obj->SetQuestionId (QId), QN3);
+ R2Obj->SetQuestionId (QId);
break;
}
case 1:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yd...@us...> - 2011-10-10 14:30:16
|
Revision: 2363
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2363&view=rev
Author: ydong10
Date: 2011-10-10 14:30:06 +0000 (Mon, 10 Oct 2011)
Log Message:
-----------
Refine check question id validation logic to avoid label conflict
Signed-off-by: ydong10
Reviewed-by: lgao4
Modified Paths:
--------------
trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h
trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g
Modified: trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h
===================================================================
--- trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h 2011-10-10 08:20:54 UTC (rev 2362)
+++ trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h 2011-10-10 14:30:06 UTC (rev 2363)
@@ -1061,12 +1061,8 @@
mRef2->FormId = FormId;
}
- EFI_VFR_RETURN_CODE SetQuestionId (IN EFI_QUESTION_ID QuestionId) {
- if (QuestionId == EFI_QUESTION_ID_INVALID) {
- return VFR_RETURN_UNDEFINED;
- }
+ VOID SetQuestionId (IN EFI_QUESTION_ID QuestionId) {
mRef2->QuestionId = QuestionId;
- return VFR_RETURN_SUCCESS;
}
};
Modified: trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g
===================================================================
--- trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g 2011-10-10 08:20:54 UTC (rev 2362)
+++ trunk/BaseTools/Source/C/VfrCompile/VfrSyntax.g 2011-10-10 14:30:06 UTC (rev 2363)
@@ -1682,8 +1682,13 @@
FormId "=" F3:Number "," << RefType = 2; FId = _STOFID(F3->getText()); >>
Question "="
(
- QN3:StringIdentifier "," << mCVfrQuestionDB.GetQuestionId (QN3->getText (), NULL, QId, BitMask); >>
- | QN3:Number "," << QId = _STOQID(QN3->getText()); >>
+ QN3:StringIdentifier "," <<
+ mCVfrQuestionDB.GetQuestionId (QN3->getText (), NULL, QId, BitMask);
+ if (QId == EFI_QUESTION_ID_INVALID) {
+ _PCATCH(VFR_RETURN_UNDEFINED, QN3);
+ }
+ >>
+ | QN4:Number "," << QId = _STOQID(QN4->getText()); >>
)
)
|
@@ -1730,7 +1735,7 @@
QHObj = R2Obj;
R2Obj->SetLineNo(G->getLine());
R2Obj->SetFormId (FId);
- _PCATCH(R2Obj->SetQuestionId (QId), QN3);
+ R2Obj->SetQuestionId (QId);
break;
}
case 1:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lg...@us...> - 2011-10-10 08:21:01
|
Revision: 2362
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2362&view=rev
Author: lgao4
Date: 2011-10-10 08:20:54 +0000 (Mon, 10 Oct 2011)
Log Message:
-----------
Update executables for the latest source on r2361
Singed-off-by: lgao4
Revision Links:
--------------
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2361&view=rev
Modified Paths:
--------------
branches/Releases/BaseTools_r2100/Bin/Win32/BPDG.exe
branches/Releases/BaseTools_r2100/Bin/Win32/BootSectImage.exe
branches/Releases/BaseTools_r2100/Bin/Win32/EfiLdrImage.exe
branches/Releases/BaseTools_r2100/Bin/Win32/EfiRom.exe
branches/Releases/BaseTools_r2100/Bin/Win32/Fpd2Dsc.exe
branches/Releases/BaseTools_r2100/Bin/Win32/GenBootSector.exe
branches/Releases/BaseTools_r2100/Bin/Win32/GenCrc32.exe
branches/Releases/BaseTools_r2100/Bin/Win32/GenDepex.exe
branches/Releases/BaseTools_r2100/Bin/Win32/GenFds.exe
branches/Releases/BaseTools_r2100/Bin/Win32/GenFfs.exe
branches/Releases/BaseTools_r2100/Bin/Win32/GenFv.exe
branches/Releases/BaseTools_r2100/Bin/Win32/GenFw.exe
branches/Releases/BaseTools_r2100/Bin/Win32/GenPage.exe
branches/Releases/BaseTools_r2100/Bin/Win32/GenPatchPcdTable.exe
branches/Releases/BaseTools_r2100/Bin/Win32/GenSec.exe
branches/Releases/BaseTools_r2100/Bin/Win32/GenVtf.exe
branches/Releases/BaseTools_r2100/Bin/Win32/LzmaCompress.exe
branches/Releases/BaseTools_r2100/Bin/Win32/MigrationMsa2Inf.exe
branches/Releases/BaseTools_r2100/Bin/Win32/PatchPcdValue.exe
branches/Releases/BaseTools_r2100/Bin/Win32/Spd2Dec.exe
branches/Releases/BaseTools_r2100/Bin/Win32/Split.exe
branches/Releases/BaseTools_r2100/Bin/Win32/TargetTool.exe
branches/Releases/BaseTools_r2100/Bin/Win32/TianoCompress.exe
branches/Releases/BaseTools_r2100/Bin/Win32/Trim.exe
branches/Releases/BaseTools_r2100/Bin/Win32/UPT.exe
branches/Releases/BaseTools_r2100/Bin/Win32/VfrCompile.exe
branches/Releases/BaseTools_r2100/Bin/Win32/VolInfo.exe
branches/Releases/BaseTools_r2100/Bin/Win32/build.exe
branches/Releases/BaseTools_r2100/Source/C/Include/Common/BuildVersion.h
branches/Releases/BaseTools_r2100/Source/Python/Common/BuildVersion.py
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/BPDG.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/BootSectImage.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/EfiLdrImage.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/EfiRom.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/Fpd2Dsc.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/GenBootSector.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/GenCrc32.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/GenDepex.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/GenFds.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/GenFfs.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/GenFv.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/GenFw.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/GenPage.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/GenPatchPcdTable.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/GenSec.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/GenVtf.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/LzmaCompress.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/MigrationMsa2Inf.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/PatchPcdValue.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/Spd2Dec.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/Split.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/TargetTool.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/TianoCompress.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/Trim.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/UPT.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/VfrCompile.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/VolInfo.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/build.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Source/C/Include/Common/BuildVersion.h
===================================================================
--- branches/Releases/BaseTools_r2100/Source/C/Include/Common/BuildVersion.h 2011-10-10 06:56:32 UTC (rev 2361)
+++ branches/Releases/BaseTools_r2100/Source/C/Include/Common/BuildVersion.h 2011-10-10 08:20:54 UTC (rev 2362)
@@ -1,3 +1,3 @@
//This file is for build version number auto generation
//
-#define __BUILD_VERSION "Build 2357"
+#define __BUILD_VERSION "Build 2361"
Modified: branches/Releases/BaseTools_r2100/Source/Python/Common/BuildVersion.py
===================================================================
--- branches/Releases/BaseTools_r2100/Source/Python/Common/BuildVersion.py 2011-10-10 06:56:32 UTC (rev 2361)
+++ branches/Releases/BaseTools_r2100/Source/Python/Common/BuildVersion.py 2011-10-10 08:20:54 UTC (rev 2362)
@@ -1,3 +1,3 @@
#This file is for build version number auto generation
#
-gBUILD_VERSION = "Build 2357"
+gBUILD_VERSION = "Build 2361"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yi...@us...> - 2011-10-10 06:56:38
|
Revision: 2361
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2361&view=rev
Author: yingke
Date: 2011-10-10 06:56:32 +0000 (Mon, 10 Oct 2011)
Log Message:
-----------
Remove extra spaces from GenFds command line.
Signed-off-by: yingke
Reviewed-by: lgao4
Modified Paths:
--------------
branches/Releases/BaseTools_r2100/Source/Python/AutoGen/GenMake.py
Modified: branches/Releases/BaseTools_r2100/Source/Python/AutoGen/GenMake.py
===================================================================
--- branches/Releases/BaseTools_r2100/Source/Python/AutoGen/GenMake.py 2011-10-10 01:34:53 UTC (rev 2360)
+++ branches/Releases/BaseTools_r2100/Source/Python/AutoGen/GenMake.py 2011-10-10 06:56:32 UTC (rev 2361)
@@ -1253,7 +1253,7 @@
#
fds: init
\t-@cd $(FV_DIR)
-${BEGIN}\tGenFds -f ${fdf_file} -o $(BUILD_DIR) -t $(TOOLCHAIN) -b $(TARGET) -p ${active_platform} -a ${build_architecture_list} ${extra_options}${END}${BEGIN} -r ${fd} ${END}${BEGIN} -i ${fv} ${END}${BEGIN} -C ${cap} ${END}${BEGIN} -D ${macro} ${END}
+${BEGIN}\tGenFds -f ${fdf_file} -o $(BUILD_DIR) -t $(TOOLCHAIN) -b $(TARGET) -p ${active_platform} -a ${build_architecture_list}${END}${BEGIN}${extra_options}${END}${BEGIN} -r ${fd}${END}${BEGIN} -i ${fv}${END}${BEGIN} -C ${cap}${END}${BEGIN} -D${macro}${END}
#
# run command for emulator platform only
@@ -1335,6 +1335,9 @@
if GlobalData.gCaseInsensitive:
ExtraOption += " -c"
+ ExtraOptionList = []
+ if ExtraOption:
+ ExtraOptionList.append(ExtraOption)
MakefileName = self._FILE_NAME_[self._FileType]
SubBuildCommandList = []
@@ -1366,7 +1369,7 @@
"fd" : PlatformInfo.FdTargetList,
"fv" : PlatformInfo.FvTargetList,
"cap" : PlatformInfo.CapTargetList,
- "extra_options" : ExtraOption,
+ "extra_options" : ExtraOptionList,
"macro" : MacroList,
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yi...@us...> - 2011-10-10 01:34:59
|
Revision: 2360
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2360&view=rev
Author: yingke
Date: 2011-10-10 01:34:53 +0000 (Mon, 10 Oct 2011)
Log Message:
-----------
Fix bug to allow more than one dot contained in module file name.
Signed-off-by: yingke
Reviewed-by: jsu1
Reviewed-by: gikidy
Modified Paths:
--------------
trunk/BaseTools/Source/Python/GenFds/FfsInfStatement.py
Modified: trunk/BaseTools/Source/Python/GenFds/FfsInfStatement.py
===================================================================
--- trunk/BaseTools/Source/Python/GenFds/FfsInfStatement.py 2011-10-10 01:33:26 UTC (rev 2359)
+++ trunk/BaseTools/Source/Python/GenFds/FfsInfStatement.py 2011-10-10 01:34:53 UTC (rev 2360)
@@ -456,7 +456,7 @@
Arch = ''
OutputPath = ''
(ModulePath, FileName) = os.path.split(self.InfFileName)
- Index = FileName.find('.')
+ Index = FileName.rfind('.')
FileName = FileName[0:Index]
Arch = "NoneArch"
if self.CurrentArch != None:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yi...@us...> - 2011-10-10 01:33:32
|
Revision: 2359
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2359&view=rev
Author: yingke
Date: 2011-10-10 01:33:26 +0000 (Mon, 10 Oct 2011)
Log Message:
-----------
Fix bug to allow more than one dot contained in module file name.
Signed-off-by: yingke
Reviewed-by: jsu1
Reviewed-by: gikidy
Modified Paths:
--------------
branches/Releases/BaseTools_r2100/Source/Python/GenFds/FfsInfStatement.py
Modified: branches/Releases/BaseTools_r2100/Source/Python/GenFds/FfsInfStatement.py
===================================================================
--- branches/Releases/BaseTools_r2100/Source/Python/GenFds/FfsInfStatement.py 2011-10-09 08:58:23 UTC (rev 2358)
+++ branches/Releases/BaseTools_r2100/Source/Python/GenFds/FfsInfStatement.py 2011-10-10 01:33:26 UTC (rev 2359)
@@ -456,7 +456,7 @@
Arch = ''
OutputPath = ''
(ModulePath, FileName) = os.path.split(self.InfFileName)
- Index = FileName.find('.')
+ Index = FileName.rfind('.')
FileName = FileName[0:Index]
Arch = "NoneArch"
if self.CurrentArch != None:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lg...@us...> - 2011-10-09 08:58:29
|
Revision: 2358
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2358&view=rev
Author: lgao4
Date: 2011-10-09 08:58:23 +0000 (Sun, 09 Oct 2011)
Log Message:
-----------
Update executables for the latest source on r2357
Singed-off-by: lgao4
Revision Links:
--------------
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2357&view=rev
Modified Paths:
--------------
branches/Releases/BaseTools_r2100/Bin/Win32/BPDG.exe
branches/Releases/BaseTools_r2100/Bin/Win32/BootSectImage.exe
branches/Releases/BaseTools_r2100/Bin/Win32/EfiLdrImage.exe
branches/Releases/BaseTools_r2100/Bin/Win32/EfiRom.exe
branches/Releases/BaseTools_r2100/Bin/Win32/Fpd2Dsc.exe
branches/Releases/BaseTools_r2100/Bin/Win32/GenBootSector.exe
branches/Releases/BaseTools_r2100/Bin/Win32/GenCrc32.exe
branches/Releases/BaseTools_r2100/Bin/Win32/GenDepex.exe
branches/Releases/BaseTools_r2100/Bin/Win32/GenFds.exe
branches/Releases/BaseTools_r2100/Bin/Win32/GenFfs.exe
branches/Releases/BaseTools_r2100/Bin/Win32/GenFv.exe
branches/Releases/BaseTools_r2100/Bin/Win32/GenFw.exe
branches/Releases/BaseTools_r2100/Bin/Win32/GenPage.exe
branches/Releases/BaseTools_r2100/Bin/Win32/GenPatchPcdTable.exe
branches/Releases/BaseTools_r2100/Bin/Win32/GenSec.exe
branches/Releases/BaseTools_r2100/Bin/Win32/GenVtf.exe
branches/Releases/BaseTools_r2100/Bin/Win32/LzmaCompress.exe
branches/Releases/BaseTools_r2100/Bin/Win32/MigrationMsa2Inf.exe
branches/Releases/BaseTools_r2100/Bin/Win32/PatchPcdValue.exe
branches/Releases/BaseTools_r2100/Bin/Win32/Spd2Dec.exe
branches/Releases/BaseTools_r2100/Bin/Win32/Split.exe
branches/Releases/BaseTools_r2100/Bin/Win32/TargetTool.exe
branches/Releases/BaseTools_r2100/Bin/Win32/TianoCompress.exe
branches/Releases/BaseTools_r2100/Bin/Win32/Trim.exe
branches/Releases/BaseTools_r2100/Bin/Win32/UPT.exe
branches/Releases/BaseTools_r2100/Bin/Win32/VfrCompile.exe
branches/Releases/BaseTools_r2100/Bin/Win32/VolInfo.exe
branches/Releases/BaseTools_r2100/Bin/Win32/build.exe
branches/Releases/BaseTools_r2100/Source/C/Include/Common/BuildVersion.h
branches/Releases/BaseTools_r2100/Source/Python/Common/BuildVersion.py
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/BPDG.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/BootSectImage.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/EfiLdrImage.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/EfiRom.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/Fpd2Dsc.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/GenBootSector.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/GenCrc32.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/GenDepex.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/GenFds.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/GenFfs.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/GenFv.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/GenFw.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/GenPage.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/GenPatchPcdTable.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/GenSec.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/GenVtf.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/LzmaCompress.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/MigrationMsa2Inf.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/PatchPcdValue.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/Spd2Dec.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/Split.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/TargetTool.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/TianoCompress.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/Trim.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/UPT.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/VfrCompile.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/VolInfo.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Bin/Win32/build.exe
===================================================================
(Binary files differ)
Modified: branches/Releases/BaseTools_r2100/Source/C/Include/Common/BuildVersion.h
===================================================================
--- branches/Releases/BaseTools_r2100/Source/C/Include/Common/BuildVersion.h 2011-10-09 07:44:46 UTC (rev 2357)
+++ branches/Releases/BaseTools_r2100/Source/C/Include/Common/BuildVersion.h 2011-10-09 08:58:23 UTC (rev 2358)
@@ -1,3 +1,3 @@
//This file is for build version number auto generation
//
-#define __BUILD_VERSION "Build 2322"
+#define __BUILD_VERSION "Build 2357"
Modified: branches/Releases/BaseTools_r2100/Source/Python/Common/BuildVersion.py
===================================================================
--- branches/Releases/BaseTools_r2100/Source/Python/Common/BuildVersion.py 2011-10-09 07:44:46 UTC (rev 2357)
+++ branches/Releases/BaseTools_r2100/Source/Python/Common/BuildVersion.py 2011-10-09 08:58:23 UTC (rev 2358)
@@ -1,3 +1,3 @@
#This file is for build version number auto generation
#
-gBUILD_VERSION = "Build 2322"
+gBUILD_VERSION = "Build 2357"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2011-10-09 07:44:52
|
Revision: 2357
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2357&view=rev
Author: jsu1
Date: 2011-10-09 07:44:46 +0000 (Sun, 09 Oct 2011)
Log Message:
-----------
Update the ?\226?\128?\147d MACRO semantics and empty string expression handle
Signed-off-by: jsu1
Reviewed-by: gikidy
Reviewed-by: yingke
Modified Paths:
--------------
trunk/BaseTools/Source/Python/Common/Expression.py
trunk/BaseTools/Source/Python/GenFds/GenFds.py
trunk/BaseTools/Source/Python/build/build.py
Modified: trunk/BaseTools/Source/Python/Common/Expression.py
===================================================================
--- trunk/BaseTools/Source/Python/Common/Expression.py 2011-10-09 05:32:27 UTC (rev 2356)
+++ trunk/BaseTools/Source/Python/Common/Expression.py 2011-10-09 07:44:46 UTC (rev 2357)
@@ -90,7 +90,10 @@
# $(ARCH) is replaced with "IA32 X64"
RetStr += '"' + Macros[Macro] + '"'
else:
- RetStr += Macros[Macro]
+ if Macros[Macro].strip() != "":
+ RetStr += Macros[Macro]
+ else:
+ RetStr += '""'
RetStr += String[MacroEndPos+1:]
String = RetStr
MacroStartPos = String.find('$(')
@@ -173,13 +176,20 @@
return Val
def __init__(self, Expression, SymbolTable={}):
+ self._NoProcess = False
if type(Expression) != type(''):
self._Expr = Expression
+ self._NoProcess = True
return
self._Expr = ReplaceExprMacro(Expression.strip(),
SymbolTable,
['TARGET', 'TOOL_CHAIN_TAG', 'ARCH'])
+
+ if not self._Expr.strip():
+ self._NoProcess = True
+ return
+
#
# The symbol table including PCD and macro mapping
#
@@ -194,7 +204,7 @@
# Public entry for this class
def __call__(self):
- if type(self._Expr) != type(''):
+ if self._NoProcess:
return self._Expr
Val = self._OrExpr()
Modified: trunk/BaseTools/Source/Python/GenFds/GenFds.py
===================================================================
--- trunk/BaseTools/Source/Python/GenFds/GenFds.py 2011-10-09 05:32:27 UTC (rev 2356)
+++ trunk/BaseTools/Source/Python/GenFds/GenFds.py 2011-10-09 07:44:46 UTC (rev 2357)
@@ -172,7 +172,7 @@
else:
GlobalData.gCommandLineDefines[List[0].strip()] = List[1].strip()
else:
- GlobalData.gCommandLineDefines[List[0].strip()] = ""
+ GlobalData.gCommandLineDefines[List[0].strip()] = "TRUE"
os.environ["WORKSPACE"] = Workspace
"""call Workspace build create database"""
Modified: trunk/BaseTools/Source/Python/build/build.py
===================================================================
--- trunk/BaseTools/Source/Python/build/build.py 2011-10-09 05:32:27 UTC (rev 2356)
+++ trunk/BaseTools/Source/Python/build/build.py 2011-10-09 07:44:46 UTC (rev 2357)
@@ -1625,7 +1625,7 @@
ExtraData=DefineTokenList[0])
if len(DefineTokenList) == 1:
- DefineDict[DefineTokenList[0]] = ""
+ DefineDict[DefineTokenList[0]] = "TRUE"
else:
DefineDict[DefineTokenList[0]] = DefineTokenList[1].strip()
return DefineDict
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2011-10-09 05:32:33
|
Revision: 2356
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2356&view=rev
Author: jsu1
Date: 2011-10-09 05:32:27 +0000 (Sun, 09 Oct 2011)
Log Message:
-----------
Enhancing build tool to improve AutoGen StrGather performance.
Signed-off-by: jsu1
Reviewed-by: lgao4
Modified Paths:
--------------
trunk/BaseTools/Source/Python/AutoGen/StrGather.py
trunk/BaseTools/Source/Python/AutoGen/UniClassObject.py
Modified: trunk/BaseTools/Source/Python/AutoGen/StrGather.py
===================================================================
--- trunk/BaseTools/Source/Python/AutoGen/StrGather.py 2011-10-09 05:28:51 UTC (rev 2355)
+++ trunk/BaseTools/Source/Python/AutoGen/StrGather.py 2011-10-09 05:32:27 UTC (rev 2356)
@@ -168,8 +168,9 @@
Str = WriteLine(Str, Line)
Line = COMMENT_DEFINE_STR + ' ' + PRINTABLE_LANGUAGE_NAME_STRING_NAME + ' ' * (ValueStartPtr - len(DEFINE_STR + PRINTABLE_LANGUAGE_NAME_STRING_NAME)) + DecToHexStr(1, 4) + COMMENT_NOT_REFERENCED
Str = WriteLine(Str, Line)
+ UnusedStr = ''
- #Group the referred STRING token together.
+ #Group the referred/Unused STRING token together.
for Index in range(2, len(UniObjectClass.OrderedStringList[UniObjectClass.LanguageDef[0][0]])):
StringItem = UniObjectClass.OrderedStringList[UniObjectClass.LanguageDef[0][0]][Index]
Name = StringItem.StringName
@@ -183,22 +184,15 @@
else:
Line = DEFINE_STR + ' ' + Name + ' ' * (ValueStartPtr - len(DEFINE_STR + Name)) + DecToHexStr(Token, 4)
Str = WriteLine(Str, Line)
-
- #Group the unused STRING token together.
- for Index in range(2, len(UniObjectClass.OrderedStringList[UniObjectClass.LanguageDef[0][0]])):
- StringItem = UniObjectClass.OrderedStringList[UniObjectClass.LanguageDef[0][0]][Index]
- Name = StringItem.StringName
- Token = StringItem.Token
- Referenced = StringItem.Referenced
- if Name != None:
- Line = ''
- if Referenced == False:
+ else:
if (ValueStartPtr - len(DEFINE_STR + Name)) <= 0:
Line = COMMENT_DEFINE_STR + ' ' + Name + ' ' + DecToHexStr(Token, 4) + COMMENT_NOT_REFERENCED
else:
Line = COMMENT_DEFINE_STR + ' ' + Name + ' ' * (ValueStartPtr - len(DEFINE_STR + Name)) + DecToHexStr(Token, 4) + COMMENT_NOT_REFERENCED
- Str = WriteLine(Str, Line)
+ UnusedStr = WriteLine(UnusedStr, Line)
+ Str = ''.join([Str,UnusedStr])
+
Str = WriteLine(Str, '')
if IsCompatibleMode or UniGenCFlag:
Str = WriteLine(Str, 'extern unsigned char ' + BaseName + 'Strings[];')
@@ -383,7 +377,6 @@
#
for IndexI in range(len(UniObjectClass.LanguageDef)):
Language = UniObjectClass.LanguageDef[IndexI][0]
- LangPrintName = UniObjectClass.LanguageDef[IndexI][1]
if Language not in UniLanguageListFiltered:
continue
@@ -393,12 +386,12 @@
NumberOfUseOtherLangDef = 0
Index = 0
for IndexJ in range(1, len(UniObjectClass.OrderedStringList[UniObjectClass.LanguageDef[IndexI][0]])):
- Item = UniObjectClass.FindByToken(IndexJ, Language)
+ Item = UniObjectClass.OrderedStringListByToken[Language][IndexJ]
+
Name = Item.StringName
Value = Item.StringValueByteList
Referenced = Item.Referenced
Token = Item.Token
- Length = Item.Length
UseOtherLangDef = Item.UseOtherLangDef
if UseOtherLangDef != '' and Referenced:
@@ -595,10 +588,7 @@
# This function is used for UEFI2.1 spec
#
#
-def GetStringFiles(UniFilList, SourceFileList, IncludeList, IncludePathList, SkipList, BaseName, IsCompatibleMode = False, ShellMode = False, UniGenCFlag = True, UniGenBinBuffer = None, FilterInfo = [True, []]):
- Status = True
- ErrorMessage = ''
-
+def GetStringFiles(UniFilList, SourceFileList, IncludeList, IncludePathList, SkipList, BaseName, IsCompatibleMode = False, ShellMode = False, UniGenCFlag = True, UniGenBinBuffer = None, FilterInfo = [True, []]):
if len(UniFilList) > 0:
if ShellMode:
#
@@ -627,13 +617,13 @@
# Write an item
#
def Write(Target, Item):
- return Target + Item
+ return ''.join([Target,Item])
#
# Write an item with a break line
#
def WriteLine(Target, Item):
- return Target + Item + '\n'
+ return ''.join([Target,Item,'\n'])
# This acts like the main() function for the script, unless it is 'import'ed into another
# script.
Modified: trunk/BaseTools/Source/Python/AutoGen/UniClassObject.py
===================================================================
--- trunk/BaseTools/Source/Python/AutoGen/UniClassObject.py 2011-10-09 05:28:51 UTC (rev 2355)
+++ trunk/BaseTools/Source/Python/AutoGen/UniClassObject.py 2011-10-09 05:32:27 UTC (rev 2356)
@@ -193,6 +193,8 @@
self.Token = 2
self.LanguageDef = [] #[ [u'LanguageIdentifier', u'PrintableName'], ... ]
self.OrderedStringList = {} #{ u'LanguageIdentifier' : [StringDefClassObject] }
+ self.OrderedStringDict = {} #{ u'LanguageIdentifier' : {StringName:(IndexInList)} }
+ self.OrderedStringListByToken = {} #{ u'LanguageIdentifier' : {Token: StringDefClassObject} }
self.IsCompatibleMode = IsCompatibleMode
self.IncludePathList = IncludePathList
if len(self.FileList) > 0:
@@ -246,14 +248,13 @@
else:
OtherLang = FirstLangName
self.OrderedStringList[LangName].append (StringDefClassObject(Item.StringName, '', Item.Referenced, Item.Token, OtherLang))
-
+ self.OrderedStringDict[LangName][Item.StringName] = len(self.OrderedStringList[LangName]) - 1
return True
#
# Get String name and value
#
def GetStringObject(self, Item):
- Name = ''
Language = ''
Value = ''
@@ -476,20 +477,22 @@
if Language not in self.OrderedStringList:
self.OrderedStringList[Language] = []
+ self.OrderedStringDict[Language] = {}
IsAdded = True
- for Item in self.OrderedStringList[Language]:
- if Name == Item.StringName:
- IsAdded = False
- if Value != None:
- Item.UpdateValue(Value)
- Item.UseOtherLangDef = ''
- break
+ if Name in self.OrderedStringDict[Language]:
+ IsAdded = False
+ if Value != None:
+ ItemIndexInList = self.OrderedStringDict[Language][Name]
+ Item = self.OrderedStringList[Language][ItemIndexInList]
+ Item.UpdateValue(Value)
+ Item.UseOtherLangDef = ''
if IsAdded:
Token = len(self.OrderedStringList[Language])
if Index == -1:
self.OrderedStringList[Language].append(StringDefClassObject(Name, Value, Referenced, Token, UseOtherLangDef))
+ self.OrderedStringDict[Language][Name] = Token
for LangName in self.LanguageDef:
#
# New STRING token will be added into all language string lists.
@@ -501,8 +504,10 @@
else:
OtherLangDef = Language
self.OrderedStringList[LangName[0]].append(StringDefClassObject(Name, '', Referenced, Token, OtherLangDef))
+ self.OrderedStringDict[LangName[0]][Name] = len(self.OrderedStringList[LangName[0]]) - 1
else:
self.OrderedStringList[Language].insert(Index, StringDefClassObject(Name, Value, Referenced, Token, UseOtherLangDef))
+ self.OrderedStringDict[Language][Name] = Index
#
# Set the string as referenced
@@ -513,17 +518,18 @@
# So, only update the status of string stoken in first language string list.
#
Lang = self.LanguageDef[0][0]
- for Item in self.OrderedStringList[Lang]:
- if Name == Item.StringName:
- Item.Referenced = True
- break
+ if Name in self.OrderedStringDict[Lang]:
+ ItemIndexInList = self.OrderedStringDict[Lang][Name]
+ Item = self.OrderedStringList[Lang][ItemIndexInList]
+ Item.Referenced = True
+
#
# Search the string in language definition by Name
#
def FindStringValue(self, Name, Lang):
- for Item in self.OrderedStringList[Lang]:
- if Item.StringName == Name:
- return Item
+ if Name in self.OrderedStringDict[Lang]:
+ ItemIndexInList = self.OrderedStringDict[Lang][Name]
+ return self.OrderedStringList[Lang][ItemIndexInList]
return None
@@ -546,6 +552,10 @@
#
FirstLangName = self.LanguageDef[0][0]
+ # Convert the OrderedStringList to be OrderedStringListByToken in order to faciliate future search by token
+ for LangNameItem in self.LanguageDef:
+ self.OrderedStringListByToken[LangNameItem[0]] = {}
+
#
# Use small token for all referred string stoken.
#
@@ -558,6 +568,7 @@
OtherLangItem = self.OrderedStringList[LangName][Index]
OtherLangItem.Referenced = True
OtherLangItem.Token = RefToken
+ self.OrderedStringListByToken[LangName][OtherLangItem.Token] = OtherLangItem
RefToken = RefToken + 1
#
@@ -571,6 +582,7 @@
LangName = LangNameItem[0]
OtherLangItem = self.OrderedStringList[LangName][Index]
OtherLangItem.Token = RefToken + UnRefToken
+ self.OrderedStringListByToken[LangName][OtherLangItem.Token] = OtherLangItem
UnRefToken = UnRefToken + 1
#
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2011-10-09 05:28:57
|
Revision: 2355
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2355&view=rev
Author: jsu1
Date: 2011-10-09 05:28:51 +0000 (Sun, 09 Oct 2011)
Log Message:
-----------
Enhancing build tool to improve AutoGen StrGather performance.
Signed-off-by: jsu1
Reviewed-by: lgao4
Modified Paths:
--------------
branches/Releases/BaseTools_r2100/Source/Python/AutoGen/StrGather.py
branches/Releases/BaseTools_r2100/Source/Python/AutoGen/UniClassObject.py
Modified: branches/Releases/BaseTools_r2100/Source/Python/AutoGen/StrGather.py
===================================================================
--- branches/Releases/BaseTools_r2100/Source/Python/AutoGen/StrGather.py 2011-10-09 05:20:46 UTC (rev 2354)
+++ branches/Releases/BaseTools_r2100/Source/Python/AutoGen/StrGather.py 2011-10-09 05:28:51 UTC (rev 2355)
@@ -168,8 +168,9 @@
Str = WriteLine(Str, Line)
Line = COMMENT_DEFINE_STR + ' ' + PRINTABLE_LANGUAGE_NAME_STRING_NAME + ' ' * (ValueStartPtr - len(DEFINE_STR + PRINTABLE_LANGUAGE_NAME_STRING_NAME)) + DecToHexStr(1, 4) + COMMENT_NOT_REFERENCED
Str = WriteLine(Str, Line)
+ UnusedStr = ''
- #Group the referred STRING token together.
+ #Group the referred/Unused STRING token together.
for Index in range(2, len(UniObjectClass.OrderedStringList[UniObjectClass.LanguageDef[0][0]])):
StringItem = UniObjectClass.OrderedStringList[UniObjectClass.LanguageDef[0][0]][Index]
Name = StringItem.StringName
@@ -183,22 +184,15 @@
else:
Line = DEFINE_STR + ' ' + Name + ' ' * (ValueStartPtr - len(DEFINE_STR + Name)) + DecToHexStr(Token, 4)
Str = WriteLine(Str, Line)
-
- #Group the unused STRING token together.
- for Index in range(2, len(UniObjectClass.OrderedStringList[UniObjectClass.LanguageDef[0][0]])):
- StringItem = UniObjectClass.OrderedStringList[UniObjectClass.LanguageDef[0][0]][Index]
- Name = StringItem.StringName
- Token = StringItem.Token
- Referenced = StringItem.Referenced
- if Name != None:
- Line = ''
- if Referenced == False:
+ else:
if (ValueStartPtr - len(DEFINE_STR + Name)) <= 0:
Line = COMMENT_DEFINE_STR + ' ' + Name + ' ' + DecToHexStr(Token, 4) + COMMENT_NOT_REFERENCED
else:
Line = COMMENT_DEFINE_STR + ' ' + Name + ' ' * (ValueStartPtr - len(DEFINE_STR + Name)) + DecToHexStr(Token, 4) + COMMENT_NOT_REFERENCED
- Str = WriteLine(Str, Line)
+ UnusedStr = WriteLine(UnusedStr, Line)
+ Str = ''.join([Str,UnusedStr])
+
Str = WriteLine(Str, '')
if IsCompatibleMode or UniGenCFlag:
Str = WriteLine(Str, 'extern unsigned char ' + BaseName + 'Strings[];')
@@ -383,7 +377,6 @@
#
for IndexI in range(len(UniObjectClass.LanguageDef)):
Language = UniObjectClass.LanguageDef[IndexI][0]
- LangPrintName = UniObjectClass.LanguageDef[IndexI][1]
if Language not in UniLanguageListFiltered:
continue
@@ -393,12 +386,12 @@
NumberOfUseOtherLangDef = 0
Index = 0
for IndexJ in range(1, len(UniObjectClass.OrderedStringList[UniObjectClass.LanguageDef[IndexI][0]])):
- Item = UniObjectClass.FindByToken(IndexJ, Language)
+ Item = UniObjectClass.OrderedStringListByToken[Language][IndexJ]
+
Name = Item.StringName
Value = Item.StringValueByteList
Referenced = Item.Referenced
Token = Item.Token
- Length = Item.Length
UseOtherLangDef = Item.UseOtherLangDef
if UseOtherLangDef != '' and Referenced:
@@ -595,10 +588,7 @@
# This function is used for UEFI2.1 spec
#
#
-def GetStringFiles(UniFilList, SourceFileList, IncludeList, IncludePathList, SkipList, BaseName, IsCompatibleMode = False, ShellMode = False, UniGenCFlag = True, UniGenBinBuffer = None, FilterInfo = [True, []]):
- Status = True
- ErrorMessage = ''
-
+def GetStringFiles(UniFilList, SourceFileList, IncludeList, IncludePathList, SkipList, BaseName, IsCompatibleMode = False, ShellMode = False, UniGenCFlag = True, UniGenBinBuffer = None, FilterInfo = [True, []]):
if len(UniFilList) > 0:
if ShellMode:
#
@@ -627,13 +617,13 @@
# Write an item
#
def Write(Target, Item):
- return Target + Item
+ return ''.join([Target,Item])
#
# Write an item with a break line
#
def WriteLine(Target, Item):
- return Target + Item + '\n'
+ return ''.join([Target,Item,'\n'])
# This acts like the main() function for the script, unless it is 'import'ed into another
# script.
Modified: branches/Releases/BaseTools_r2100/Source/Python/AutoGen/UniClassObject.py
===================================================================
--- branches/Releases/BaseTools_r2100/Source/Python/AutoGen/UniClassObject.py 2011-10-09 05:20:46 UTC (rev 2354)
+++ branches/Releases/BaseTools_r2100/Source/Python/AutoGen/UniClassObject.py 2011-10-09 05:28:51 UTC (rev 2355)
@@ -193,6 +193,8 @@
self.Token = 2
self.LanguageDef = [] #[ [u'LanguageIdentifier', u'PrintableName'], ... ]
self.OrderedStringList = {} #{ u'LanguageIdentifier' : [StringDefClassObject] }
+ self.OrderedStringDict = {} #{ u'LanguageIdentifier' : {StringName:(IndexInList)} }
+ self.OrderedStringListByToken = {} #{ u'LanguageIdentifier' : {Token: StringDefClassObject} }
self.IsCompatibleMode = IsCompatibleMode
self.IncludePathList = IncludePathList
if len(self.FileList) > 0:
@@ -246,14 +248,13 @@
else:
OtherLang = FirstLangName
self.OrderedStringList[LangName].append (StringDefClassObject(Item.StringName, '', Item.Referenced, Item.Token, OtherLang))
-
+ self.OrderedStringDict[LangName][Item.StringName] = len(self.OrderedStringList[LangName]) - 1
return True
#
# Get String name and value
#
def GetStringObject(self, Item):
- Name = ''
Language = ''
Value = ''
@@ -476,20 +477,22 @@
if Language not in self.OrderedStringList:
self.OrderedStringList[Language] = []
+ self.OrderedStringDict[Language] = {}
IsAdded = True
- for Item in self.OrderedStringList[Language]:
- if Name == Item.StringName:
- IsAdded = False
- if Value != None:
- Item.UpdateValue(Value)
- Item.UseOtherLangDef = ''
- break
+ if Name in self.OrderedStringDict[Language]:
+ IsAdded = False
+ if Value != None:
+ ItemIndexInList = self.OrderedStringDict[Language][Name]
+ Item = self.OrderedStringList[Language][ItemIndexInList]
+ Item.UpdateValue(Value)
+ Item.UseOtherLangDef = ''
if IsAdded:
Token = len(self.OrderedStringList[Language])
if Index == -1:
self.OrderedStringList[Language].append(StringDefClassObject(Name, Value, Referenced, Token, UseOtherLangDef))
+ self.OrderedStringDict[Language][Name] = Token
for LangName in self.LanguageDef:
#
# New STRING token will be added into all language string lists.
@@ -501,8 +504,10 @@
else:
OtherLangDef = Language
self.OrderedStringList[LangName[0]].append(StringDefClassObject(Name, '', Referenced, Token, OtherLangDef))
+ self.OrderedStringDict[LangName[0]][Name] = len(self.OrderedStringList[LangName[0]]) - 1
else:
self.OrderedStringList[Language].insert(Index, StringDefClassObject(Name, Value, Referenced, Token, UseOtherLangDef))
+ self.OrderedStringDict[Language][Name] = Index
#
# Set the string as referenced
@@ -513,17 +518,18 @@
# So, only update the status of string stoken in first language string list.
#
Lang = self.LanguageDef[0][0]
- for Item in self.OrderedStringList[Lang]:
- if Name == Item.StringName:
- Item.Referenced = True
- break
+ if Name in self.OrderedStringDict[Lang]:
+ ItemIndexInList = self.OrderedStringDict[Lang][Name]
+ Item = self.OrderedStringList[Lang][ItemIndexInList]
+ Item.Referenced = True
+
#
# Search the string in language definition by Name
#
def FindStringValue(self, Name, Lang):
- for Item in self.OrderedStringList[Lang]:
- if Item.StringName == Name:
- return Item
+ if Name in self.OrderedStringDict[Lang]:
+ ItemIndexInList = self.OrderedStringDict[Lang][Name]
+ return self.OrderedStringList[Lang][ItemIndexInList]
return None
@@ -546,6 +552,10 @@
#
FirstLangName = self.LanguageDef[0][0]
+ # Convert the OrderedStringList to be OrderedStringListByToken in order to faciliate future search by token
+ for LangNameItem in self.LanguageDef:
+ self.OrderedStringListByToken[LangNameItem[0]] = {}
+
#
# Use small token for all referred string stoken.
#
@@ -558,6 +568,7 @@
OtherLangItem = self.OrderedStringList[LangName][Index]
OtherLangItem.Referenced = True
OtherLangItem.Token = RefToken
+ self.OrderedStringListByToken[LangName][OtherLangItem.Token] = OtherLangItem
RefToken = RefToken + 1
#
@@ -571,6 +582,7 @@
LangName = LangNameItem[0]
OtherLangItem = self.OrderedStringList[LangName][Index]
OtherLangItem.Token = RefToken + UnRefToken
+ self.OrderedStringListByToken[LangName][OtherLangItem.Token] = OtherLangItem
UnRefToken = UnRefToken + 1
#
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|