}
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;
}
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;
// 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);
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());
}
}