Add dotnet-stack tool
[platform/core/dotnet/launcher.git] / NativeLauncher / launcher / exec / corerun.cc
index 2ac5d63..0e8293d 100644 (file)
@@ -37,7 +37,8 @@ void DisplayUsage() {
                "counters       monitor or collect performance counters\n"
                "dump           capture or analyze a coredump\n"
                "gcdump         capture a heapdump\n"
-               "trace          collect or convert a diagnostic event trace\n\n");
+               "trace          collect or convert a diagnostic event trace\n"
+               "stack          reports the managed stacks\n\n");
 }
 
 int main(int argc, const char* argv[]) {
@@ -85,7 +86,7 @@ int main(int argc, const char* argv[]) {
                        argc--;
                        argv++;
                } else if (arg == "--additionalprobingpath" && argc > 1) {
-                       additionalProbingPath = absolutePath(argv[1]);
+                       additionalProbingPath = getAbsolutePath(argv[1]);
                        argc--;
                        argv++;
                } else if (arg == "--globalizationinvariant") {
@@ -100,7 +101,7 @@ int main(int argc, const char* argv[]) {
                        DisplayUsage();
                        return -1;
                } else if (isManagedAssembly(arg) || isNativeImage(arg)) {
-                       if (!isFileExist(arg)) {
+                       if (!isFile(arg)) {
                                fprintf(stderr, "The specified file does not exist.\n");
                                return -1;
                        }
@@ -116,7 +117,7 @@ int main(int argc, const char* argv[]) {
                } else {
                        managedAssemblyPath = toolDllsPath + "/dotnet-" + arg + ".dll";
 
-                       if (!isFileExist(managedAssemblyPath)) {
+                       if (!isFile(managedAssemblyPath)) {
                                fprintf(stderr,
                                        "Could not execute because dotnet-%s does not exist.\n"
                                        "Go to https://developer.samsung.com/tizen to learn how to install tools.\n\n", argv[0]);
@@ -138,26 +139,26 @@ int main(int argc, const char* argv[]) {
                argv++;
        }
 
-       std::string currentExeAbsolutePath = absolutePath("/proc/self/exe");
+       std::string currentExeAbsolutePath = getAbsolutePath("/proc/self/exe");
        if (currentExeAbsolutePath.empty()) {
                fprintf(stderr, "Failed to get the current executable's absolute path.\n");
                return -1;
        }
 
-       std::string clrFilesAbsolutePath = absolutePath(clrFilesPath);
+       std::string clrFilesAbsolutePath = getAbsolutePath(clrFilesPath);
        if (clrFilesAbsolutePath.empty()) {
                fprintf(stderr, "Failed to resolve the full path to the CLR files.\n");
                return -1;
        }
 
-       std::string managedAssemblyAbsolutePath = absolutePath(managedAssemblyPath);
+       std::string managedAssemblyAbsolutePath = getAbsolutePath(managedAssemblyPath);
        if (managedAssemblyAbsolutePath.empty()) {
                fprintf(stderr, "Failed to get the managed assembly's absolute path.\n");
                return -1;
        }
 
        std::string coreclrLibPath(clrFilesAbsolutePath + "/libcoreclr.so");
-       std::string appPath = baseName(managedAssemblyAbsolutePath);
+       std::string appPath = getBaseName(managedAssemblyAbsolutePath);
        std::string nativeDllSearchDirs(appPath);
        nativeDllSearchDirs += ":" + additionalProbingPath;
        nativeDllSearchDirs += ":" + clrFilesAbsolutePath;