Do not pass a native image path to coreclr_execute_assembly (#222)
author김상욱/Common Platform Lab(SR)/Engineer/삼성전자 <swift.kim@samsung.com>
Fri, 24 Apr 2020 02:37:07 +0000 (11:37 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Fri, 24 Apr 2020 02:37:07 +0000 (11:37 +0900)
Passing a native image path will result in a BadImageFormatException

NativeLauncher/launcher/exec/corerun.cc

index 4842867..2ac5d63 100644 (file)
@@ -37,7 +37,7 @@ 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");
+               "trace          collect or convert a diagnostic event trace\n\n");
 }
 
 int main(int argc, const char* argv[]) {
@@ -114,16 +114,12 @@ int main(int argc, const char* argv[]) {
                        fprintf(stderr, "This command is not currently supported.\n");
                        return -1;
                } else {
-                       managedAssemblyPath = toolDllsPath + "/dotnet-" + arg;
+                       managedAssemblyPath = toolDllsPath + "/dotnet-" + arg + ".dll";
 
-                       if (isFileExist(managedAssemblyPath + ".ni.dll")) {
-                               managedAssemblyPath += ".ni.dll";
-                       } else if (isFileExist(managedAssemblyPath + ".dll")) {
-                               managedAssemblyPath += ".dll";
-                       } else {
+                       if (!isFileExist(managedAssemblyPath)) {
                                fprintf(stderr,
                                        "Could not execute because dotnet-%s does not exist.\n"
-                                       "Follow the instructions for tool installation: https://github.com/Samsung/diagnostic-tools\n", argv[0]);
+                                       "Go to https://developer.samsung.com/tizen to learn how to install tools.\n\n", argv[0]);
                                return -1;
                        }