]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/Ecc/Check.py
Sync EDKII BaseTools to BaseTools project r2042.
[mirror_edk2.git] / BaseTools / Source / Python / Ecc / Check.py
index dbfedb514bc809020d9e822da3f7c9a456708be8..1e9ce34f8b24357876a66ccd7ab381a4b34007d7 100644 (file)
@@ -30,6 +30,7 @@ class Check(object):
 \r
     # Check all required checkpoints\r
     def Check(self):\r
+        self.GeneralCheck()\r
         self.MetaDataFileCheck()\r
         self.DoxygenCheck()\r
         self.IncludeFileCheck()\r
@@ -38,6 +39,29 @@ class Check(object):
         self.FunctionLayoutCheck()\r
         self.NamingConventionCheck()\r
 \r
+    # General Checking\r
+    def GeneralCheck(self):\r
+        self.GeneralCheckNonAcsii()\r
+\r
+    # Check whether file has non ACSII char\r
+    def GeneralCheckNonAcsii(self):\r
+        if EccGlobalData.gConfig.GeneralCheckNonAcsii == '1' or EccGlobalData.gConfig.GeneralCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':\r
+            EdkLogger.quiet("Checking Non-ACSII char in file ...")\r
+            SqlCommand = """select ID, FullPath, ExtName from File"""\r
+            RecordSet = EccGlobalData.gDb.TblInf.Exec(SqlCommand)\r
+            for Record in RecordSet:\r
+                if Record[2].upper() not in EccGlobalData.gConfig.BinaryExtList:\r
+                    op = open(Record[1]).readlines()\r
+                    IndexOfLine = 0\r
+                    for Line in op:\r
+                        IndexOfLine += 1\r
+                        IndexOfChar = 0\r
+                        for Char in Line:\r
+                            IndexOfChar += 1\r
+                            if ord(Char) > 126:\r
+                                OtherMsg = "File %s has Non-ASCII char at line %s column %s" %(Record[1], IndexOfLine, IndexOfChar)\r
+                                EccGlobalData.gDb.TblReport.Insert(ERROR_GENERAL_CHECK_NON_ACSII, OtherMsg = OtherMsg, BelongsToTable = 'File', BelongsToItem = Record[0])\r
+\r
     # C Function Layout Checking\r
     def FunctionLayoutCheck(self):\r
         self.FunctionLayoutCheckReturnType()\r
@@ -67,22 +91,26 @@ class Check(object):
         if EccGlobalData.gConfig.CFunctionLayoutCheckReturnType == '1' or EccGlobalData.gConfig.CFunctionLayoutCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':\r
             EdkLogger.quiet("Checking function layout return type ...")\r
 \r
-            for Dirpath, Dirnames, Filenames in self.WalkTree():\r
-                for F in Filenames:\r
-                    if os.path.splitext(F)[1] in ('.c', '.h'):\r
-                        FullName = os.path.join(Dirpath, F)\r
-                        c.CheckFuncLayoutReturnType(FullName)\r
+#            for Dirpath, Dirnames, Filenames in self.WalkTree():\r
+#                for F in Filenames:\r
+#                    if os.path.splitext(F)[1] in ('.c', '.h'):\r
+#                        FullName = os.path.join(Dirpath, F)\r
+#                        c.CheckFuncLayoutReturnType(FullName)\r
+            for FullName in EccGlobalData.gCFileList + EccGlobalData.gHFileList:\r
+                c.CheckFuncLayoutReturnType(FullName)\r
 \r
     # Check whether any optional functional modifiers exist and next to the return type\r
     def FunctionLayoutCheckModifier(self):\r
         if EccGlobalData.gConfig.CFunctionLayoutCheckOptionalFunctionalModifier == '1' or EccGlobalData.gConfig.CFunctionLayoutCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':\r
             EdkLogger.quiet("Checking function layout modifier ...")\r
 \r
-            for Dirpath, Dirnames, Filenames in self.WalkTree():\r
-                for F in Filenames:\r
-                    if os.path.splitext(F)[1] in ('.c', '.h'):\r
-                        FullName = os.path.join(Dirpath, F)\r
-                        c.CheckFuncLayoutModifier(FullName)\r
+#            for Dirpath, Dirnames, Filenames in self.WalkTree():\r
+#                for F in Filenames:\r
+#                    if os.path.splitext(F)[1] in ('.c', '.h'):\r
+#                        FullName = os.path.join(Dirpath, F)\r
+#                        c.CheckFuncLayoutModifier(FullName)\r
+            for FullName in EccGlobalData.gCFileList + EccGlobalData.gHFileList:\r
+                c.CheckFuncLayoutModifier(FullName)\r
 \r
     # Check whether the next line contains the function name, left justified, followed by the beginning of the parameter list\r
     # Check whether the closing parenthesis is on its own line and also indented two spaces\r
@@ -90,33 +118,41 @@ class Check(object):
         if EccGlobalData.gConfig.CFunctionLayoutCheckFunctionName == '1' or EccGlobalData.gConfig.CFunctionLayoutCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':\r
             EdkLogger.quiet("Checking function layout function name ...")\r
 \r
-            for Dirpath, Dirnames, Filenames in self.WalkTree():\r
-                for F in Filenames:\r
-                    if os.path.splitext(F)[1] in ('.c', '.h'):\r
-                        FullName = os.path.join(Dirpath, F)\r
-                        c.CheckFuncLayoutName(FullName)\r
+#            for Dirpath, Dirnames, Filenames in self.WalkTree():\r
+#                for F in Filenames:\r
+#                    if os.path.splitext(F)[1] in ('.c', '.h'):\r
+#                        FullName = os.path.join(Dirpath, F)\r
+#                        c.CheckFuncLayoutName(FullName)\r
+            for FullName in EccGlobalData.gCFileList + EccGlobalData.gHFileList:\r
+                c.CheckFuncLayoutName(FullName)\r
+\r
     # Check whether the function prototypes in include files have the same form as function definitions\r
     def FunctionLayoutCheckPrototype(self):\r
         if EccGlobalData.gConfig.CFunctionLayoutCheckFunctionPrototype == '1' or EccGlobalData.gConfig.CFunctionLayoutCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':\r
             EdkLogger.quiet("Checking function layout function prototype ...")\r
 \r
-            for Dirpath, Dirnames, Filenames in self.WalkTree():\r
-                for F in Filenames:\r
-                    if os.path.splitext(F)[1] in ('.c'):\r
-                        FullName = os.path.join(Dirpath, F)\r
-                        EdkLogger.quiet("[PROTOTYPE]" + FullName)\r
-                        c.CheckFuncLayoutPrototype(FullName)\r
+#            for Dirpath, Dirnames, Filenames in self.WalkTree():\r
+#                for F in Filenames:\r
+#                    if os.path.splitext(F)[1] in ('.c'):\r
+#                        FullName = os.path.join(Dirpath, F)\r
+#                        EdkLogger.quiet("[PROTOTYPE]" + FullName)\r
+#                        c.CheckFuncLayoutPrototype(FullName)\r
+            for FullName in EccGlobalData.gCFileList:\r
+                EdkLogger.quiet("[PROTOTYPE]" + FullName)\r
+                c.CheckFuncLayoutPrototype(FullName)\r
 \r
     # Check whether the body of a function is contained by open and close braces that must be in the first column\r
     def FunctionLayoutCheckBody(self):\r
         if EccGlobalData.gConfig.CFunctionLayoutCheckFunctionBody == '1' or EccGlobalData.gConfig.CFunctionLayoutCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':\r
             EdkLogger.quiet("Checking function layout function body ...")\r
 \r
-            for Dirpath, Dirnames, Filenames in self.WalkTree():\r
-                for F in Filenames:\r
-                    if os.path.splitext(F)[1] in ('.c'):\r
-                        FullName = os.path.join(Dirpath, F)\r
-                        c.CheckFuncLayoutBody(FullName)\r
+#            for Dirpath, Dirnames, Filenames in self.WalkTree():\r
+#                for F in Filenames:\r
+#                    if os.path.splitext(F)[1] in ('.c'):\r
+#                        FullName = os.path.join(Dirpath, F)\r
+#                        c.CheckFuncLayoutBody(FullName)\r
+            for FullName in EccGlobalData.gCFileList:\r
+                c.CheckFuncLayoutBody(FullName)\r
 \r
     # Check whether the data declarations is the first code in a module.\r
     # self.CFunctionLayoutCheckDataDeclaration = 1\r
@@ -125,11 +161,14 @@ class Check(object):
         if EccGlobalData.gConfig.CFunctionLayoutCheckNoInitOfVariable == '1' or EccGlobalData.gConfig.CFunctionLayoutCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':\r
             EdkLogger.quiet("Checking function layout local variables ...")\r
 \r
-            for Dirpath, Dirnames, Filenames in self.WalkTree():\r
-                for F in Filenames:\r
-                    if os.path.splitext(F)[1] in ('.c'):\r
-                        FullName = os.path.join(Dirpath, F)\r
-                        c.CheckFuncLayoutLocalVariable(FullName)\r
+#            for Dirpath, Dirnames, Filenames in self.WalkTree():\r
+#                for F in Filenames:\r
+#                    if os.path.splitext(F)[1] in ('.c'):\r
+#                        FullName = os.path.join(Dirpath, F)\r
+#                        c.CheckFuncLayoutLocalVariable(FullName)\r
+\r
+            for FullName in EccGlobalData.gCFileList:\r
+                c.CheckFuncLayoutLocalVariable(FullName)\r
 \r
     # Check whether no use of STATIC for functions\r
     # self.CFunctionLayoutCheckNoStatic = 1\r
@@ -150,22 +189,26 @@ class Check(object):
         if EccGlobalData.gConfig.DeclarationDataTypeCheckNoUseCType == '1' or EccGlobalData.gConfig.DeclarationDataTypeCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':\r
             EdkLogger.quiet("Checking Declaration No use C type ...")\r
 \r
-            for Dirpath, Dirnames, Filenames in self.WalkTree():\r
-                for F in Filenames:\r
-                    if os.path.splitext(F)[1] in ('.h', '.c'):\r
-                        FullName = os.path.join(Dirpath, F)\r
-                        c.CheckDeclNoUseCType(FullName)\r
+#            for Dirpath, Dirnames, Filenames in self.WalkTree():\r
+#                for F in Filenames:\r
+#                    if os.path.splitext(F)[1] in ('.h', '.c'):\r
+#                        FullName = os.path.join(Dirpath, F)\r
+#                        c.CheckDeclNoUseCType(FullName)\r
+            for FullName in EccGlobalData.gCFileList + EccGlobalData.gHFileList:\r
+                c.CheckDeclNoUseCType(FullName)\r
 \r
     # Check whether the modifiers IN, OUT, OPTIONAL, and UNALIGNED are used only to qualify arguments to a function and should not appear in a data type declaration\r
     def DeclCheckInOutModifier(self):\r
         if EccGlobalData.gConfig.DeclarationDataTypeCheckInOutModifier == '1' or EccGlobalData.gConfig.DeclarationDataTypeCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':\r
             EdkLogger.quiet("Checking Declaration argument modifier ...")\r
 \r
-            for Dirpath, Dirnames, Filenames in self.WalkTree():\r
-                for F in Filenames:\r
-                    if os.path.splitext(F)[1] in ('.h', '.c'):\r
-                        FullName = os.path.join(Dirpath, F)\r
-                        c.CheckDeclArgModifier(FullName)\r
+#            for Dirpath, Dirnames, Filenames in self.WalkTree():\r
+#                for F in Filenames:\r
+#                    if os.path.splitext(F)[1] in ('.h', '.c'):\r
+#                        FullName = os.path.join(Dirpath, F)\r
+#                        c.CheckDeclArgModifier(FullName)\r
+            for FullName in EccGlobalData.gCFileList + EccGlobalData.gHFileList:\r
+                c.CheckDeclArgModifier(FullName)\r
 \r
     # Check whether the EFIAPI modifier should be used at the entry of drivers, events, and member functions of protocols\r
     def DeclCheckEFIAPIModifier(self):\r
@@ -177,24 +220,30 @@ class Check(object):
         if EccGlobalData.gConfig.DeclarationDataTypeCheckEnumeratedType == '1' or EccGlobalData.gConfig.DeclarationDataTypeCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':\r
             EdkLogger.quiet("Checking Declaration enum typedef ...")\r
 \r
-            for Dirpath, Dirnames, Filenames in self.WalkTree():\r
-                for F in Filenames:\r
-                    if os.path.splitext(F)[1] in ('.h', '.c'):\r
-                        FullName = os.path.join(Dirpath, F)\r
-                        EdkLogger.quiet("[ENUM]" + FullName)\r
-                        c.CheckDeclEnumTypedef(FullName)\r
+#            for Dirpath, Dirnames, Filenames in self.WalkTree():\r
+#                for F in Filenames:\r
+#                    if os.path.splitext(F)[1] in ('.h', '.c'):\r
+#                        FullName = os.path.join(Dirpath, F)\r
+#                        EdkLogger.quiet("[ENUM]" + FullName)\r
+#                        c.CheckDeclEnumTypedef(FullName)\r
+            for FullName in EccGlobalData.gCFileList + EccGlobalData.gHFileList:\r
+                EdkLogger.quiet("[ENUM]" + FullName)\r
+                c.CheckDeclEnumTypedef(FullName)\r
 \r
     # Check whether Structure Type has a 'typedef' and the name is capital\r
     def DeclCheckStructureDeclaration(self):\r
         if EccGlobalData.gConfig.DeclarationDataTypeCheckStructureDeclaration == '1' or EccGlobalData.gConfig.DeclarationDataTypeCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':\r
             EdkLogger.quiet("Checking Declaration struct typedef ...")\r
 \r
-            for Dirpath, Dirnames, Filenames in self.WalkTree():\r
-                for F in Filenames:\r
-                    if os.path.splitext(F)[1] in ('.h', '.c'):\r
-                        FullName = os.path.join(Dirpath, F)\r
-                        EdkLogger.quiet("[STRUCT]" + FullName)\r
-                        c.CheckDeclStructTypedef(FullName)\r
+#            for Dirpath, Dirnames, Filenames in self.WalkTree():\r
+#                for F in Filenames:\r
+#                    if os.path.splitext(F)[1] in ('.h', '.c'):\r
+#                        FullName = os.path.join(Dirpath, F)\r
+#                        EdkLogger.quiet("[STRUCT]" + FullName)\r
+#                        c.CheckDeclStructTypedef(FullName)\r
+            for FullName in EccGlobalData.gCFileList + EccGlobalData.gHFileList:\r
+                EdkLogger.quiet("[STRUCT]" + FullName)\r
+                c.CheckDeclStructTypedef(FullName)\r
 \r
     # Check whether having same Structure\r
     def DeclCheckSameStructure(self):\r
@@ -223,12 +272,15 @@ class Check(object):
         if EccGlobalData.gConfig.DeclarationDataTypeCheckUnionType == '1' or EccGlobalData.gConfig.DeclarationDataTypeCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':\r
             EdkLogger.quiet("Checking Declaration union typedef ...")\r
 \r
-            for Dirpath, Dirnames, Filenames in self.WalkTree():\r
-                for F in Filenames:\r
-                    if os.path.splitext(F)[1] in ('.h', '.c'):\r
-                        FullName = os.path.join(Dirpath, F)\r
-                        EdkLogger.quiet("[UNION]" + FullName)\r
-                        c.CheckDeclUnionTypedef(FullName)\r
+#            for Dirpath, Dirnames, Filenames in self.WalkTree():\r
+#                for F in Filenames:\r
+#                    if os.path.splitext(F)[1] in ('.h', '.c'):\r
+#                        FullName = os.path.join(Dirpath, F)\r
+#                        EdkLogger.quiet("[UNION]" + FullName)\r
+#                        c.CheckDeclUnionTypedef(FullName)\r
+            for FullName in EccGlobalData.gCFileList + EccGlobalData.gHFileList:\r
+                EdkLogger.quiet("[UNION]" + FullName)\r
+                c.CheckDeclUnionTypedef(FullName)\r
 \r
     # Predicate Expression Checking\r
     def PredicateExpressionCheck(self):\r
@@ -241,35 +293,46 @@ class Check(object):
         if EccGlobalData.gConfig.PredicateExpressionCheckBooleanValue == '1' or EccGlobalData.gConfig.PredicateExpressionCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':\r
             EdkLogger.quiet("Checking predicate expression Boolean value ...")\r
 \r
-            for Dirpath, Dirnames, Filenames in self.WalkTree():\r
-                for F in Filenames:\r
-                    if os.path.splitext(F)[1] in ('.c'):\r
-                        FullName = os.path.join(Dirpath, F)\r
-                        EdkLogger.quiet("[BOOLEAN]" + FullName)\r
-                        c.CheckBooleanValueComparison(FullName)\r
+#            for Dirpath, Dirnames, Filenames in self.WalkTree():\r
+#                for F in Filenames:\r
+#                    if os.path.splitext(F)[1] in ('.c'):\r
+#                        FullName = os.path.join(Dirpath, F)\r
+#                        EdkLogger.quiet("[BOOLEAN]" + FullName)\r
+#                        c.CheckBooleanValueComparison(FullName)\r
+            for FullName in EccGlobalData.gCFileList:\r
+                EdkLogger.quiet("[BOOLEAN]" + FullName)\r
+                c.CheckBooleanValueComparison(FullName)\r
 \r
     # Check whether Non-Boolean comparisons use a compare operator (==, !=, >, < >=, <=).\r
     def PredicateExpressionCheckNonBooleanOperator(self):\r
         if EccGlobalData.gConfig.PredicateExpressionCheckNonBooleanOperator == '1' or EccGlobalData.gConfig.PredicateExpressionCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':\r
             EdkLogger.quiet("Checking predicate expression Non-Boolean variable...")\r
 \r
-            for Dirpath, Dirnames, Filenames in self.WalkTree():\r
-                for F in Filenames:\r
-                    if os.path.splitext(F)[1] in ('.c'):\r
-                        FullName = os.path.join(Dirpath, F)\r
-                        EdkLogger.quiet("[NON-BOOLEAN]" + FullName)\r
-                        c.CheckNonBooleanValueComparison(FullName)\r
+#            for Dirpath, Dirnames, Filenames in self.WalkTree():\r
+#                for F in Filenames:\r
+#                    if os.path.splitext(F)[1] in ('.c'):\r
+#                        FullName = os.path.join(Dirpath, F)\r
+#                        EdkLogger.quiet("[NON-BOOLEAN]" + FullName)\r
+#                        c.CheckNonBooleanValueComparison(FullName)\r
+            for FullName in EccGlobalData.gCFileList:\r
+                EdkLogger.quiet("[NON-BOOLEAN]" + FullName)\r
+                c.CheckNonBooleanValueComparison(FullName)\r
+\r
     # Check whether a comparison of any pointer to zero must be done via the NULL type\r
     def PredicateExpressionCheckComparisonNullType(self):\r
         if EccGlobalData.gConfig.PredicateExpressionCheckComparisonNullType == '1' or EccGlobalData.gConfig.PredicateExpressionCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':\r
             EdkLogger.quiet("Checking predicate expression NULL pointer ...")\r
 \r
-            for Dirpath, Dirnames, Filenames in self.WalkTree():\r
-                for F in Filenames:\r
-                    if os.path.splitext(F)[1] in ('.c'):\r
-                        FullName = os.path.join(Dirpath, F)\r
-                        EdkLogger.quiet("[POINTER]" + FullName)\r
-                        c.CheckPointerNullComparison(FullName)\r
+#            for Dirpath, Dirnames, Filenames in self.WalkTree():\r
+#                for F in Filenames:\r
+#                    if os.path.splitext(F)[1] in ('.c'):\r
+#                        FullName = os.path.join(Dirpath, F)\r
+#                        EdkLogger.quiet("[POINTER]" + FullName)\r
+#                        c.CheckPointerNullComparison(FullName)\r
+            for FullName in EccGlobalData.gCFileList:\r
+                EdkLogger.quiet("[POINTER]" + FullName)\r
+                c.CheckPointerNullComparison(FullName)\r
+\r
     # Include file checking\r
     def IncludeFileCheck(self):\r
         self.IncludeFileCheckIfndef()\r
@@ -309,22 +372,26 @@ class Check(object):
         if EccGlobalData.gConfig.IncludeFileCheckIfndefStatement == '1' or EccGlobalData.gConfig.IncludeFileCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':\r
             EdkLogger.quiet("Checking header file ifndef ...")\r
 \r
-            for Dirpath, Dirnames, Filenames in self.WalkTree():\r
-                for F in Filenames:\r
-                    if os.path.splitext(F)[1] in ('.h'):\r
-                        FullName = os.path.join(Dirpath, F)\r
-                        MsgList = c.CheckHeaderFileIfndef(FullName)\r
+#            for Dirpath, Dirnames, Filenames in self.WalkTree():\r
+#                for F in Filenames:\r
+#                    if os.path.splitext(F)[1] in ('.h'):\r
+#                        FullName = os.path.join(Dirpath, F)\r
+#                        MsgList = c.CheckHeaderFileIfndef(FullName)\r
+            for FullName in EccGlobalData.gHFileList:\r
+                MsgList = c.CheckHeaderFileIfndef(FullName)\r
 \r
     # Check whether include files NOT contain code or define data variables\r
     def IncludeFileCheckData(self):\r
         if EccGlobalData.gConfig.IncludeFileCheckData == '1' or EccGlobalData.gConfig.IncludeFileCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':\r
             EdkLogger.quiet("Checking header file data ...")\r
 \r
-            for Dirpath, Dirnames, Filenames in self.WalkTree():\r
-                for F in Filenames:\r
-                    if os.path.splitext(F)[1] in ('.h'):\r
-                        FullName = os.path.join(Dirpath, F)\r
-                        MsgList = c.CheckHeaderFileData(FullName)\r
+#            for Dirpath, Dirnames, Filenames in self.WalkTree():\r
+#                for F in Filenames:\r
+#                    if os.path.splitext(F)[1] in ('.h'):\r
+#                        FullName = os.path.join(Dirpath, F)\r
+#                        MsgList = c.CheckHeaderFileData(FullName)\r
+            for FullName in EccGlobalData.gHFileList:\r
+                MsgList = c.CheckHeaderFileData(FullName)\r
 \r
     # Doxygen document checking\r
     def DoxygenCheck(self):\r
@@ -347,24 +414,28 @@ class Check(object):
                         MsgList = c.CheckFileHeaderDoxygenComments(FullName)\r
                     elif Ext in ('.inf', '.dec', '.dsc', '.fdf'):\r
                         FullName = os.path.join(Dirpath, F)\r
-                        if not open(FullName).read().startswith('## @file'):\r
+                        op = open(FullName).readlines()\r
+                        if not op[0].startswith('## @file') and op[6].startswith('## @file') and op[7].startswith('## @file'):\r
                             SqlStatement = """ select ID from File where FullPath like '%s'""" % FullName\r
                             ResultSet = EccGlobalData.gDb.TblFile.Exec(SqlStatement)\r
                             for Result in ResultSet:\r
                                 Msg = 'INF/DEC/DSC/FDF file header comment should begin with ""## @file""'\r
                                 EccGlobalData.gDb.TblReport.Insert(ERROR_DOXYGEN_CHECK_FILE_HEADER, Msg, "File", Result[0])\r
-                                        \r
+\r
 \r
     # Check whether the function headers are followed Doxygen special documentation blocks in section 2.3.5\r
     def DoxygenCheckFunctionHeader(self):\r
         if EccGlobalData.gConfig.DoxygenCheckFunctionHeader == '1' or EccGlobalData.gConfig.DoxygenCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':\r
             EdkLogger.quiet("Checking Doxygen function header ...")\r
 \r
-            for Dirpath, Dirnames, Filenames in self.WalkTree():\r
-                for F in Filenames:\r
-                    if os.path.splitext(F)[1] in ('.h', '.c'):\r
-                        FullName = os.path.join(Dirpath, F)\r
-                        MsgList = c.CheckFuncHeaderDoxygenComments(FullName)\r
+#            for Dirpath, Dirnames, Filenames in self.WalkTree():\r
+#                for F in Filenames:\r
+#                    if os.path.splitext(F)[1] in ('.h', '.c'):\r
+#                        FullName = os.path.join(Dirpath, F)\r
+#                        MsgList = c.CheckFuncHeaderDoxygenComments(FullName)\r
+            for FullName in EccGlobalData.gCFileList + EccGlobalData.gHFileList:\r
+                MsgList = c.CheckFuncHeaderDoxygenComments(FullName)\r
+\r
 \r
     # Check whether the first line of text in a comment block is a brief description of the element being documented.\r
     # The brief description must end with a period.\r
@@ -377,22 +448,26 @@ class Check(object):
         if EccGlobalData.gConfig.DoxygenCheckCommentFormat == '1' or EccGlobalData.gConfig.DoxygenCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':\r
             EdkLogger.quiet("Checking Doxygen comment ///< ...")\r
 \r
-            for Dirpath, Dirnames, Filenames in self.WalkTree():\r
-                for F in Filenames:\r
-                    if os.path.splitext(F)[1] in ('.h', '.c'):\r
-                        FullName = os.path.join(Dirpath, F)\r
-                        MsgList = c.CheckDoxygenTripleForwardSlash(FullName)\r
+#            for Dirpath, Dirnames, Filenames in self.WalkTree():\r
+#                for F in Filenames:\r
+#                    if os.path.splitext(F)[1] in ('.h', '.c'):\r
+#                        FullName = os.path.join(Dirpath, F)\r
+#                        MsgList = c.CheckDoxygenTripleForwardSlash(FullName)\r
+            for FullName in EccGlobalData.gCFileList + EccGlobalData.gHFileList:\r
+                MsgList = c.CheckDoxygenTripleForwardSlash(FullName)\r
 \r
     # Check whether only Doxygen commands allowed to mark the code are @bug and @todo.\r
     def DoxygenCheckCommand(self):\r
         if EccGlobalData.gConfig.DoxygenCheckCommand == '1' or EccGlobalData.gConfig.DoxygenCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':\r
             EdkLogger.quiet("Checking Doxygen command ...")\r
 \r
-            for Dirpath, Dirnames, Filenames in self.WalkTree():\r
-                for F in Filenames:\r
-                    if os.path.splitext(F)[1] in ('.h', '.c'):\r
-                        FullName = os.path.join(Dirpath, F)\r
-                        MsgList = c.CheckDoxygenCommand(FullName)\r
+#            for Dirpath, Dirnames, Filenames in self.WalkTree():\r
+#                for F in Filenames:\r
+#                    if os.path.splitext(F)[1] in ('.h', '.c'):\r
+#                        FullName = os.path.join(Dirpath, F)\r
+#                        MsgList = c.CheckDoxygenCommand(FullName)\r
+            for FullName in EccGlobalData.gCFileList + EccGlobalData.gHFileList:\r
+                MsgList = c.CheckDoxygenCommand(FullName)\r
 \r
     # Meta-Data File Processing Checking\r
     def MetaDataFileCheck(self):\r
@@ -556,7 +631,6 @@ class Check(object):
                 SqlCommand2 = """select Name from File where ID = %s""" %Record[5]\r
                 DscFileName = os.path.splitext(EccGlobalData.gDb.TblDsc.Exec(SqlCommand1)[0][0])[0]\r
                 FdfFileName = os.path.splitext(EccGlobalData.gDb.TblDsc.Exec(SqlCommand2)[0][0])[0]\r
-                print DscFileName, 111, FdfFileName\r
                 if DscFileName != FdfFileName:\r
                     continue\r
                 if not EccGlobalData.gException.IsException(ERROR_META_DATA_FILE_CHECK_PCD_DUPLICATE, Record[1]):\r
@@ -680,8 +754,8 @@ class Check(object):
                 SqlCommand = """\r
                              select ID from File where FullPath in\r
                             (select B.Path || '\\' || A.Value1 from INF as A, File as B where A.Model = %s and A.BelongsToFile = %s\r
-                             and B.ID = %s)\r
-                             """ %(MODEL_EFI_SOURCE_FILE, BelongsToFile, BelongsToFile)\r
+                             and B.ID = %s and (B.Model = %s or B.Model = %s))\r
+                             """ %(MODEL_EFI_SOURCE_FILE, BelongsToFile, BelongsToFile, MODEL_FILE_C, MODEL_FILE_H)\r
                 TableSet = EccGlobalData.gDb.TblFile.Exec(SqlCommand)\r
                 for Tbl in TableSet:\r
                     TblName = 'Identifier' + str(Tbl[0])\r
@@ -714,7 +788,7 @@ class Check(object):
             if Path.startswith('\\') or Path.startswith('/'):\r
                 Path = Path[1:]\r
         return Path\r
-    \r
+\r
     # Check whether two module INFs under one workspace has the same FILE_GUID value\r
     def MetaDataFileCheckModuleFileGuidDuplication(self):\r
         if EccGlobalData.gConfig.MetaDataFileCheckModuleFileGuidDuplication == '1' or EccGlobalData.gConfig.MetaDataFileCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':\r
@@ -733,7 +807,7 @@ class Check(object):
                     if not EccGlobalData.gException.IsException(ERROR_META_DATA_FILE_CHECK_MODULE_FILE_GUID_DUPLICATION, InfPath1):\r
                         Msg = "The FILE_GUID of INF file [%s] is duplicated with that of %s" % (InfPath1, InfPath2)\r
                         EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA_FILE_CHECK_MODULE_FILE_GUID_DUPLICATION, OtherMsg = Msg, BelongsToTable = Table.Table, BelongsToItem = Record[0])\r
-        \r
+\r
 \r
     # Check whether these is duplicate Guid/Ppi/Protocol name\r
     def CheckGuidProtocolPpi(self, ErrorID, Model, Table):\r