Copy the pdb file where the native image file exists 27/227127/1 accepted/tizen/5.5/unified/20200310.151139 submit/tizen_5.5/20200310.035515
authorj-h.choi <j-h.choi@samsung.com>
Thu, 5 Mar 2020 01:23:47 +0000 (10:23 +0900)
committerHyungju Lee <leee.lee@samsung.com>
Tue, 10 Mar 2020 03:22:13 +0000 (12:22 +0900)
Change-Id: Icc627f19110b5782d55cde1c350d649d42b957d8

NativeLauncher/tool/ni_common.cc

index bd72dc2..3a2a476 100644 (file)
@@ -227,7 +227,7 @@ static ni_error_e crossgen(const std::string& dllPath, const std::string& appPat
        }
 
        if (!isManagedAssembly(dllPath)) {
-               fprintf(stderr, "Input file is not a dll file : %s\n", dllPath.c_str());
+               //fprintf(stderr, "Input file is not a dll file : %s\n", dllPath.c_str());
                return NI_ERROR_INVALID_PARAMETER;
        }
 
@@ -238,6 +238,8 @@ static ni_error_e crossgen(const std::string& dllPath, const std::string& appPat
 
        std::string absDllPath = absolutePath(dllPath);
        std::string absNiPath = getNiFilePath(dllPath);
+
+
        if (absNiPath.empty()) {
                fprintf(stderr, "Fail to get ni file name\n");
                return NI_ERROR_UNKNOWN;
@@ -268,6 +270,13 @@ static ni_error_e crossgen(const std::string& dllPath, const std::string& appPat
                        // niEixst() return false for System.Private.Corelib.dll
                        if (isFileExist(absNiPath)) {
                                copySmackAndOwnership(absDllPath, absNiPath);
+                               std::string absPdbPath = replaceAll(absDllPath, ".dll", ".pdb");
+                               std::string pdbFilePath = replaceAll(absNiPath, ".ni.dll", ".pdb");
+                               if (isFileExist(absPdbPath) && (absPdbPath != pdbFilePath)) {
+                                       if (!copyFile(absPdbPath, pdbFilePath)) {
+                                               fprintf(stderr, "Failed to copy a .pdb file\n");
+                                       }
+                               }
 #ifdef UNIQUE_DEFAULT_BASE_ADDR_SUPPORT
                                if (baseAddr != 0) {
                                        updateBaseAddrFile(absNiPath, baseAddr);
@@ -697,14 +706,14 @@ ni_error_e removeNiUnderPkgRoot(const std::string& pkgId)
 
        std::string binNIDir = concatPath(binDir, APP_NI_SUB_DIR);
        if (isFileExist(binNIDir)) {
-               if (rmdir(binNIDir.c_str()) != 0) {
+               if (!removeAll(binNIDir.c_str())) {
                        fprintf(stderr, "Failed to remove app ni dir [%s]\n", binNIDir.c_str());
                }
        }
 
        std::string libNIDir = concatPath(libDir, APP_NI_SUB_DIR);
        if (isFileExist(libNIDir)) {
-               if (rmdir(libNIDir.c_str()) != 0) {
+               if (!removeAll(libNIDir.c_str())) {
                        fprintf(stderr, "Failed to remove app ni dir [%s]\n", libNIDir.c_str());
                }
        }