]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/GenBuild/org/tianocore/build/autogen/AutoGen.java
Fix EDKT186.
[mirror_edk2.git] / Tools / Source / GenBuild / org / tianocore / build / autogen / AutoGen.java
index 366e0ac59d98de60400444fce8d63ceff549e82a..2d7bb0901cc036c5e37df32644878c4439f83d37 100644 (file)
@@ -98,6 +98,21 @@ public class AutoGen {
     // area and it's dependence on library instance surface are.\r
     //\r
     private List<PackageIdentification> mDepPkgList = new LinkedList<PackageIdentification>();\r
+\r
+       //\r
+       //  For non library module, add its library instance's construct and destructor to \r
+       //  list.\r
+       //  \r
+       private List<String> libConstructList = new ArrayList<String>();\r
+       private List<String> libDestructList = new ArrayList<String>();\r
+\r
+       //\r
+       // List to store SetVirtalAddressMapCallBack, ExitBootServiceCallBack  \r
+       // \r
+       private List<String> setVirtalAddList = new ArrayList<String>();\r
+       private List<String> exitBootServiceList = new ArrayList<String>();\r
+\r
+       \r
        /**\r
         * Construct function\r
         * \r
@@ -204,6 +219,7 @@ public class AutoGen {
        void moduleGenAutogen() throws BuildException {\r
 \r
                try {\r
+                       collectLibInstanceInfo();\r
                        moduleGenAutogenC();\r
                        moduleGenAutogenH();\r
                } catch (Exception e) {\r
@@ -456,25 +472,18 @@ public class AutoGen {
                GuidGuidToAutogenC(fileBuffer);\r
 \r
                //\r
-               // Call pcd autogen. PCDAutoGenAction tool only need module name and\r
-               // isPcdEmulatedDriver as parameter. Library inherits PCD and module's\r
-               // PCD information has been collected in FPDParser task by\r
-               // CollectPCDAction.\r
-               // Note : when PCD image tool ready,\r
-               // isPCDEmulatedDriver parameter will be removed.\r
-               //\r
-                try {\r
-//              this.myPcdAutogen = new PCDAutoGenAction(moduleId.getName(),\r
-//              moduleId.getGuid(), moduleId.getPackage().getName(), moduleId.getPackage().getGuid(),this.arch,moduleId.getVersion(),false, null);\r
-         this.myPcdAutogen = new PCDAutoGenAction(moduleId.getName(),null,null,null, this.arch,null,false, null);\r
-                this.myPcdAutogen.execute();\r
-                } catch (Exception e) {\r
-                throw new BuildException("PCD Autogen failed:" + e.getMessage());\r
-                }\r
+               // Call pcd autogen. \r
+               //\r
+                this.myPcdAutogen = new PCDAutoGenAction(moduleId, this.arch, false, null);\r
+                try {\r
+                    this.myPcdAutogen.execute();\r
+                } catch (Exception exp) {\r
+                    throw new PcdAutogenException (exp.getMessage());\r
+                }\r
                \r
                if (this.myPcdAutogen != null) {\r
-            fileBuffer.append("\r\n");\r
-                       fileBuffer.append(this.myPcdAutogen.OutputC());\r
+                    fileBuffer.append("\r\n");\r
+                    fileBuffer.append(this.myPcdAutogen.OutputC());\r
                }\r
 \r
                if (!saveFile(outputPath + File.separatorChar + "AutoGen.c", fileBuffer)) {\r
@@ -601,7 +610,7 @@ public class AutoGen {
         * @throws BuildException\r
         *             Failed to generate AutoGen.c.\r
         */\r
-       void libGenAutogenC() throws BuildException {\r
+       void libGenAutogenC() throws BuildException, PcdAutogenException {\r
                StringBuffer fileBuffer = new StringBuffer(10240);\r
 \r
                //\r
@@ -613,33 +622,21 @@ public class AutoGen {
                fileBuffer.append("\r\n");\r
 \r
                //\r
-               // Call pcd autogen. PCDAutoGenAction tool only need module name and\r
-               // isPcdEmulatedDriver as parameter. Library inherit PCD and module's\r
-               // PCD information has been collected in FPDParser task by\r
-               // CollectPCDAction.\r
-               // Note : when PCD image tool ready,\r
-               // isPCDEmulatedDriver parameter will be removed.\r
+               // Call pcd autogen. \r
                //\r
+                this.myPcdAutogen = new PCDAutoGenAction(this.moduleId,\r
+                                                         this.arch,\r
+                                                         true, \r
+                                                         SurfaceAreaQuery.getModulePcdEntryNameArray());\r
                try {\r
-//                      this.myPcdAutogen = new PCDAutoGenAction(this.moduleId.getName(),\r
-//                      this.moduleId.getGuid(),moduleId.getPackage().getName(),moduleId.getPackage().getGuid(), this.arch, moduleId.getVersion(),true, SurfaceAreaQuery.getModulePcdEntryNameArray());\r
-            this.myPcdAutogen = new PCDAutoGenAction(this.moduleId.getName(),\r
-                                                     null,\r
-                                                     null,\r
-                                                     null,\r
-                                                     this.arch,\r
-                                                     null,\r
-                                                     true, \r
-                                                     SurfaceAreaQuery.getModulePcdEntryNameArray());\r
-                     \r
-                       this.myPcdAutogen.execute();\r
+                    this.myPcdAutogen.execute();\r
                } catch (Exception e) {\r
-                       throw new BuildException(e.getMessage());\r
+                    throw new PcdAutogenException(e.getMessage());\r
                }\r
 \r
                if (this.myPcdAutogen != null) {\r
-            fileBuffer.append("\r\n");\r
-                       fileBuffer.append(this.myPcdAutogen.OutputC());\r
+                    fileBuffer.append("\r\n");\r
+                    fileBuffer.append(this.myPcdAutogen.OutputC());\r
                }\r
 \r
                if (!saveFile(outputPath + File.separatorChar + "AutoGen.c", fileBuffer)) {\r
@@ -1093,10 +1090,10 @@ public class AutoGen {
                 }\r
                 fileBuffer.append("}\r\n\r\n");\r
 \r
-                fileBuffer.append("VOID\n");\r
-                fileBuffer.append("EFIAPI\n");\r
+                fileBuffer.append("VOID\r\n");\r
+                fileBuffer.append("EFIAPI\r\n");\r
                 fileBuffer.append("ExitDriver (\r\n");\r
-                fileBuffer.append("  IN EFI_STATUS  Status\n");\r
+                fileBuffer.append("  IN EFI_STATUS  Status\r\n");\r
                 fileBuffer.append("  )\r\n\r\n");\r
                 fileBuffer.append("{\r\n");\r
                 if (entryPointCount <= 1) {\r
@@ -1352,128 +1349,17 @@ public class AutoGen {
         * @throws BuildException\r
         */\r
        void LibInstanceToAutogenC(StringBuffer fileBuffer) throws BuildException {\r
-               int index;\r
-\r
-               String moduleType = SurfaceAreaQuery.getModuleType();\r
-               List<String> libConstructList = new ArrayList<String>();\r
-               List<String> libDestructList = new ArrayList<String>();\r
-\r
-               String libConstructName = null;\r
-               String libDestructName = null;\r
-               ModuleIdentification[] libraryIdList = SurfaceAreaQuery\r
-                               .getLibraryInstance(this.arch);\r
-\r
                try {\r
-                       if (libraryIdList != null) {\r
-                               //\r
-                               // Reorder library instance sequence.\r
-                               //\r
-                               AutogenLibOrder libOrder = new AutogenLibOrder(libraryIdList,\r
-                                               this.arch);\r
-                               List<ModuleIdentification> orderList = libOrder\r
-                                               .orderLibInstance();\r
-\r
-                               if (orderList != null) {\r
-                                       //\r
-                                       // Process library instance one by one.\r
-                                       //\r
-                                       for (int i = 0; i < orderList.size(); i++) {\r
-\r
-                                               //\r
-                                               // Get library instance basename.\r
-                                               //\r
-                                               ModuleIdentification libInstanceId = orderList.get(i);\r
-\r
-                                               //\r
-                                               // Get override map\r
-                                               //\r
-                                                \r
-                                               Map<String, XmlObject> libDoc = GlobalData.getDoc(\r
-                                                               libInstanceId, this.arch);\r
-                                               SurfaceAreaQuery.push(libDoc);\r
-\r
-                                               //\r
-                                               // Get <PPis>, <Protocols>, <Guids> list of this library\r
-                                               // instance.\r
-                                               //\r
-                                               String[] ppiList = SurfaceAreaQuery.getPpiArray(this.arch);\r
-                                               String[] ppiNotifyList = SurfaceAreaQuery\r
-                                                               .getPpiNotifyArray(this.arch);\r
-                                               String[] protocolList = SurfaceAreaQuery\r
-                                                               .getProtocolArray(this.arch);\r
-                                               String[] protocolNotifyList = SurfaceAreaQuery\r
-                                                               .getProtocolNotifyArray(this.arch);\r
-                                               String[] guidList = SurfaceAreaQuery\r
-                                                               .getGuidEntryArray(this.arch);\r
-                        PackageIdentification[] pkgList = SurfaceAreaQuery.getDependencePkg(this.arch);\r
-\r
-                                               //\r
-                                               // Add those ppi, protocol, guid in global ppi,\r
-                                               // protocol, guid\r
-                                               // list.\r
-                                               //\r
-                                               for (index = 0; index < ppiList.length; index++) {\r
-                                                       this.mPpiList.add(ppiList[index]);\r
-                                               }\r
-\r
-                                               for (index = 0; index < ppiNotifyList.length; index++) {\r
-                                                       this.mPpiList.add(ppiNotifyList[index]);\r
-                                               }\r
-\r
-                                               for (index = 0; index < protocolList.length; index++) {\r
-                                                       this.mProtocolList.add(protocolList[index]);\r
-                                               }\r
-\r
-                                               for (index = 0; index < protocolNotifyList.length; index++) {\r
-                                                       this.mProtocolList.add(protocolNotifyList[index]);\r
-                                               }\r
-\r
-                                               for (index = 0; index < guidList.length; index++) {\r
-                                                       this.mGuidList.add(guidList[index]);\r
-                                               }\r
-                        for (index = 0; index < pkgList.length; index++){\r
-                            if (!this.mDepPkgList.contains(pkgList[index])){\r
-                                this.mDepPkgList.add(pkgList[index]);\r
-                            }\r
-                        }\r
-\r
-                                               //\r
-                                               // If not yet parse this library instance's constructor\r
-                                               // element,parse it.\r
-                                               //\r
-                                               libConstructName = SurfaceAreaQuery\r
-                                                               .getLibConstructorName();\r
-                                               libDestructName = SurfaceAreaQuery\r
-                                                               .getLibDestructorName();\r
-\r
-                                               SurfaceAreaQuery.pop();\r
-                                               //\r
-                                               // Add dependent library instance constructor function.\r
-                                               //\r
-                                               if (libConstructName != null) {\r
-                                                       libConstructList.add(libConstructName);\r
-                                               }\r
-                                               //\r
-                                               // Add dependent library instance destructor fuction.\r
-                                               //\r
-                                               if (libDestructName != null) {\r
-                                                       libDestructList.add(libDestructName);\r
-                                               }\r
-                                       }\r
-\r
-                               }\r
-\r
-                               //\r
-                               // Add library constructor to AutoGen.c\r
-                               //\r
-                               LibConstructorToAutogenC(libConstructList, moduleType,\r
-                                               fileBuffer/* autogenC */);\r
-                               //\r
-                               // Add library destructor to AutoGen.c\r
-                               //\r
-                               LibDestructorToAutogenC(libDestructList, moduleType, fileBuffer/* autogenC */);\r
-                       }\r
-\r
+            String moduleType = this.moduleId.getModuleType();\r
+                   //\r
+                       // Add library constructor to AutoGen.c\r
+                       //\r
+                       LibConstructorToAutogenC(libConstructList, moduleType,\r
+                               fileBuffer/* autogenC */);\r
+                       //\r
+                       // Add library destructor to AutoGen.c\r
+                       //\r
+                       LibDestructorToAutogenC(libDestructList, moduleType, fileBuffer/* autogenC */);\r
                } catch (Exception e) {\r
                        throw new BuildException(e.getMessage());\r
                }\r
@@ -1886,15 +1772,31 @@ public class AutoGen {
         */\r
        void ExternCallBackToAutoGenC(StringBuffer fileBuffer)\r
                        throws BuildException {\r
-               String[] setVirtualList = SurfaceAreaQuery\r
-                               .getSetVirtualAddressMapCallBackArray();\r
-               String[] exitBootList = SurfaceAreaQuery\r
-                               .getExitBootServicesCallBackArray();\r
-               String moduleType = SurfaceAreaQuery.getModuleType();\r
+               //\r
+               // Collect module's <SetVirtualAddressMapCallBack> and \r
+               // <ExitBootServiceCallBack> and add to setVirtualAddList \r
+               //  exitBootServiceList.\r
+               // \r
+        String[] setVirtuals = SurfaceAreaQuery.getSetVirtualAddressMapCallBackArray();\r
+        String[] exitBoots = SurfaceAreaQuery.getExitBootServicesCallBackArray();\r
+        if (setVirtuals != null) {\r
+            for (int j = 0; j < setVirtuals.length; j++) {\r
+                           this.setVirtalAddList.add(setVirtuals[j]);\r
+                       }\r
+               }\r
+               if (exitBoots != null) {\r
+                   for (int k = 0; k < exitBoots.length; k++) {\r
+                           this.exitBootServiceList.add(exitBoots[k]);\r
+                       }\r
+               }\r
+               //\r
+               //  Add c code in autogen.c which relate to <SetVirtualAddressMapCallBack>\r
+               //  and <ExitBootServicesCallBack> \r
+               // \r
+               String moduleType = this.moduleId.getModuleType();\r
                boolean UefiOrDxeModule = false;\r
                int Count = 0;\r
                int i;\r
-\r
                switch (CommonDefinition.getModuleType(moduleType)) {\r
                case CommonDefinition.ModuleTypeDxeDriver:\r
                case CommonDefinition.ModuleTypeDxeRuntimeDriver:\r
@@ -1914,9 +1816,9 @@ public class AutoGen {
                        // set count to the number of valid entries\r
                        //\r
                        Count = 0;\r
-                       if (setVirtualList != null) {\r
-                               for (i = 0; i < setVirtualList.length; i++) {\r
-                                       if (setVirtualList[i].equalsIgnoreCase("")) {\r
+                       if (this.setVirtalAddList != null) {\r
+                               for (i = 0; i < this.setVirtalAddList.size(); i++) {\r
+                                       if (this.setVirtalAddList.get(i).equalsIgnoreCase("")) {\r
                                                break;\r
                                        }\r
                                }\r
@@ -1930,7 +1832,7 @@ public class AutoGen {
                        break;\r
                }\r
 \r
-               if (setVirtualList == null) {\r
+               if (this.setVirtalAddList == null || this.setVirtalAddList.size() == 0) {\r
                        if (UefiOrDxeModule) {\r
                                //\r
                                // No data so make a NULL list\r
@@ -1944,13 +1846,13 @@ public class AutoGen {
                        //\r
                        // Write SetVirtualAddressMap function definition.\r
                        //\r
-                       for (i = 0; i < setVirtualList.length; i++) {\r
-                               if (setVirtualList[i].equalsIgnoreCase("")) {\r
+                       for (i = 0; i < this.setVirtalAddList.size(); i++) {\r
+                               if (this.setVirtalAddList.get(i).equalsIgnoreCase("")) {\r
                                        break;\r
                                }\r
                                fileBuffer.append("VOID\r\n");\r
                                fileBuffer.append("EFIAPI\r\n");\r
-                               fileBuffer.append(setVirtualList[i]);\r
+                               fileBuffer.append(this.setVirtalAddList.get(i));\r
                                fileBuffer.append(" (\r\n");\r
                                fileBuffer.append("  IN EFI_EVENT  Event,\r\n");\r
                                fileBuffer.append("  IN VOID       *Context\r\n");\r
@@ -1962,8 +1864,8 @@ public class AutoGen {
                        //\r
                        fileBuffer\r
                                        .append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED const EFI_EVENT_NOTIFY _gDriverSetVirtualAddressMapEvent[] = {");\r
-                       for (i = 0; i < setVirtualList.length; i++) {\r
-                               if (setVirtualList[i].equalsIgnoreCase("")) {\r
+                       for (i = 0; i < this.setVirtalAddList.size(); i++) {\r
+                               if (this.setVirtalAddList.get(i).equalsIgnoreCase("")) {\r
                                        break;\r
                                }\r
 \r
@@ -1973,7 +1875,7 @@ public class AutoGen {
                                        fileBuffer.append(",\r\n  ");\r
                                }\r
 \r
-                               fileBuffer.append(setVirtualList[i]);\r
+                               fileBuffer.append(this.setVirtalAddList.get(i));\r
                        }\r
                        //\r
                        //  If module is not DXE_DRIVER, DXE_RUNTIME_DIRVER, UEFI_DRIVER\r
@@ -1998,9 +1900,9 @@ public class AutoGen {
                        // set count to the number of valid entries.\r
                        //\r
                        Count = 0;\r
-                       if (exitBootList != null) {\r
-                               for (i = 0; i < exitBootList.length; i++) {\r
-                                       if (exitBootList[i].equalsIgnoreCase("")) {\r
+                       if (this.exitBootServiceList != null) {\r
+                               for (i = 0; i < this.exitBootServiceList.size(); i++) {\r
+                                       if (this.exitBootServiceList.get(i).equalsIgnoreCase("")) {\r
                                                break;\r
                                        }\r
                                }\r
@@ -2010,7 +1912,7 @@ public class AutoGen {
                        fileBuffer.append(";\r\n\r\n");\r
                }\r
 \r
-               if (exitBootList == null) {\r
+               if (this.exitBootServiceList == null || this.exitBootServiceList.size() == 0) {\r
                        if (UefiOrDxeModule) {\r
                                //\r
                                // No data so make a NULL list.\r
@@ -2024,14 +1926,14 @@ public class AutoGen {
                        //\r
                        // Write DriverExitBootServices function definition.\r
                        //\r
-                       for (i = 0; i < exitBootList.length; i++) {\r
-                               if (exitBootList[i].equalsIgnoreCase("")) {\r
+                       for (i = 0; i < this.exitBootServiceList.size(); i++) {\r
+                               if (this.exitBootServiceList.get(i).equalsIgnoreCase("")) {\r
                                        break;\r
                                }\r
 \r
                                fileBuffer.append("VOID\r\n");\r
                                fileBuffer.append("EFIAPI\r\n");\r
-                               fileBuffer.append(exitBootList[i]);\r
+                               fileBuffer.append(this.exitBootServiceList.get(i));\r
                                fileBuffer.append(" (\r\n");\r
                                fileBuffer.append("  IN EFI_EVENT  Event,\r\n");\r
                                fileBuffer.append("  IN VOID       *Context\r\n");\r
@@ -2043,8 +1945,8 @@ public class AutoGen {
                        //\r
                        fileBuffer\r
                                        .append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED const EFI_EVENT_NOTIFY _gDriverExitBootServicesEvent[] = {");\r
-                       for (i = 0; i < exitBootList.length; i++) {\r
-                               if (exitBootList[i].equalsIgnoreCase("")) {\r
+                       for (i = 0; i < this.exitBootServiceList.size(); i++) {\r
+                               if (this.exitBootServiceList.get(i).equalsIgnoreCase("")) {\r
                                        break;\r
                                }\r
 \r
@@ -2053,7 +1955,7 @@ public class AutoGen {
                                } else {\r
                                        fileBuffer.append(",\r\n  ");\r
                                }\r
-                               fileBuffer.append(exitBootList[i]);\r
+                               fileBuffer.append(this.exitBootServiceList.get(i));\r
                        }\r
                        if (!UefiOrDxeModule) {\r
                                fileBuffer.append(",\r\n  NULL");\r
@@ -2090,4 +1992,144 @@ public class AutoGen {
             }\r
                }\r
     }\r
-}
\ No newline at end of file
+    \r
+    /**\r
+    *This function first order the library instances, then collect\r
+    *library instance 's PPI, Protocol, GUID,\r
+    *SetVirtalAddressMapCallBack, ExitBootServiceCallBack, and\r
+    *Destructor, Constructor.\r
+    *\r
+       **/\r
+       private void collectLibInstanceInfo(){\r
+               int index;\r
+\r
+               String moduleType = SurfaceAreaQuery.getModuleType();\r
+               String libConstructName = null;\r
+               String libDestructName = null;\r
+               String[] setVirtuals = null;\r
+               String[] exitBoots = null;\r
+\r
+               ModuleIdentification[] libraryIdList = SurfaceAreaQuery\r
+                               .getLibraryInstance(this.arch);\r
+               try {\r
+                       if (libraryIdList != null) {\r
+                               //\r
+                               // Reorder library instance sequence.\r
+                               //\r
+                               AutogenLibOrder libOrder = new AutogenLibOrder(libraryIdList,\r
+                                               this.arch);\r
+                               List<ModuleIdentification> orderList = libOrder\r
+                                               .orderLibInstance();\r
+\r
+                               if (orderList != null) {\r
+                                       //\r
+                                       // Process library instance one by one.\r
+                                       //\r
+                                       for (int i = 0; i < orderList.size(); i++) {\r
+\r
+                                               //\r
+                                               // Get library instance basename.\r
+                                               //\r
+                                               ModuleIdentification libInstanceId = orderList.get(i);\r
+\r
+                                               //\r
+                                               // Get override map\r
+                                               //\r
+\r
+                                               Map<String, XmlObject> libDoc = GlobalData.getDoc(\r
+                                                               libInstanceId, this.arch);\r
+                                               SurfaceAreaQuery.push(libDoc);\r
+                                               //\r
+                                               // Get <PPis>, <Protocols>, <Guids> list of this library\r
+                                               // instance.\r
+                                               //\r
+                                               String[] ppiList = SurfaceAreaQuery.getPpiArray(this.arch);\r
+                                               String[] ppiNotifyList = SurfaceAreaQuery\r
+                                                               .getPpiNotifyArray(this.arch);\r
+                                               String[] protocolList = SurfaceAreaQuery\r
+                                                               .getProtocolArray(this.arch);\r
+                                               String[] protocolNotifyList = SurfaceAreaQuery\r
+                                                               .getProtocolNotifyArray(this.arch);\r
+                                               String[] guidList = SurfaceAreaQuery\r
+                                                               .getGuidEntryArray(this.arch);\r
+                                               PackageIdentification[] pkgList = SurfaceAreaQuery.getDependencePkg(this.arch);\r
+\r
+                                               //\r
+                                               // Add those ppi, protocol, guid in global ppi,\r
+                                               // protocol, guid\r
+                                               // list.\r
+                                               //\r
+                                               for (index = 0; index < ppiList.length; index++) {\r
+                                                       this.mPpiList.add(ppiList[index]);\r
+                                               }\r
+\r
+                                               for (index = 0; index < ppiNotifyList.length; index++) {\r
+                                                       this.mPpiList.add(ppiNotifyList[index]);\r
+                                               }\r
+\r
+                                               for (index = 0; index < protocolList.length; index++) {\r
+                                                       this.mProtocolList.add(protocolList[index]);\r
+                                               }\r
+\r
+                                               for (index = 0; index < protocolNotifyList.length; index++) {\r
+                                                       this.mProtocolList.add(protocolNotifyList[index]);\r
+                                               }\r
+\r
+                                               for (index = 0; index < guidList.length; index++) {\r
+                                                       this.mGuidList.add(guidList[index]);\r
+                                               }\r
+                                               for (index = 0; index < pkgList.length; index++){\r
+                                                       if (!this.mDepPkgList.contains(pkgList[index])){\r
+                                                               this.mDepPkgList.add(pkgList[index]);\r
+                                                       }\r
+                                               }\r
+\r
+                                               //\r
+                                               // If not yet parse this library instance's constructor\r
+                                               // element,parse it.\r
+                                               //\r
+                                               libConstructName = SurfaceAreaQuery\r
+                                                               .getLibConstructorName();\r
+                                               libDestructName = SurfaceAreaQuery\r
+                                                               .getLibDestructorName();\r
+\r
+                                               //\r
+                                               // Collect SetVirtualAddressMapCallBack and \r
+                                               // ExitBootServiceCallBack.\r
+                                               // \r
+                        setVirtuals = SurfaceAreaQuery.getSetVirtualAddressMapCallBackArray();\r
+                        exitBoots = SurfaceAreaQuery.getExitBootServicesCallBackArray();\r
+                        if (setVirtuals != null) {\r
+                            for (int j = 0; j < setVirtuals.length; j++) {\r
+                                                           this.setVirtalAddList.add(setVirtuals[j]);\r
+                                                   }\r
+                                               }\r
+                                               if (exitBoots != null) {\r
+                                                       for (int k = 0; k < exitBoots.length; k++) {\r
+                                                           this.exitBootServiceList.add(exitBoots[k]);\r
+                                                   }\r
+                                               }\r
+                                               SurfaceAreaQuery.pop();\r
+                                               //\r
+                                               // Add dependent library instance constructor function.\r
+                                               //\r
+                                               if (libConstructName != null) {\r
+                                                       this.libConstructList.add(libConstructName);\r
+                                               }\r
+                                               //\r
+                                               // Add dependent library instance destructor fuction.\r
+                                               //\r
+                                               if (libDestructName != null) {\r
+                                                       this.libDestructList.add(libDestructName);\r
+                                               }\r
+                                       }\r
+                               }\r
+\r
+                       }\r
+\r
+       }catch (Exception e){\r
+       System.out.println(e.getMessage());\r
+       System.out.println("Collect library instance failed!");\r
+}\r
+}\r
+}\r