From da08ea5a9b057822e02003e492d0cd8bb37d1cea Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EA=B9=80=EC=83=81=EC=9A=B1/Common=20Platform=20Lab=28SR=29?= =?utf8?q?/Engineer/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Fri, 24 Apr 2020 11:37:07 +0900 Subject: [PATCH] Do not pass a native image path to coreclr_execute_assembly (#222) Passing a native image path will result in a BadImageFormatException --- NativeLauncher/launcher/exec/corerun.cc | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/NativeLauncher/launcher/exec/corerun.cc b/NativeLauncher/launcher/exec/corerun.cc index 4842867..2ac5d63 100644 --- a/NativeLauncher/launcher/exec/corerun.cc +++ b/NativeLauncher/launcher/exec/corerun.cc @@ -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; } -- 2.7.4