diff options
author | Evgeny Pavlov <lucenticus@gmail.com> | 2016-07-21 20:52:10 +0400 |
---|---|---|
committer | Mike McLaughlin <mikem@microsoft.com> | 2016-07-21 09:52:10 -0700 |
commit | da5b94ed35602c43c505381bfe62b894895a9736 (patch) | |
tree | 444e9d446a0dbe34965f181b789028c19daffafa /src | |
parent | 3b5550f9892bce0e17cc50f26e655f2215ce3c9e (diff) | |
download | coreclr-da5b94ed35602c43c505381bfe62b894895a9736.tar.gz coreclr-da5b94ed35602c43c505381bfe62b894895a9736.tar.bz2 coreclr-da5b94ed35602c43c505381bfe62b894895a9736.zip |
[SOS][Linux] Fix incorrect processing 'setclrpath' command with portable PDB reader (#6358)
* Fix incorrect processing 'setclrpath' command in lldb libsosplugin.so with portable PDB reader
* Replace 'fprintf' and 'perror' to 'ExtErr'
Diffstat (limited to 'src')
-rw-r--r-- | src/ToolBox/SOS/Strike/util.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/ToolBox/SOS/Strike/util.cpp b/src/ToolBox/SOS/Strike/util.cpp index bdf5be25e6..16c382dd0f 100644 --- a/src/ToolBox/SOS/Strike/util.cpp +++ b/src/ToolBox/SOS/Strike/util.cpp @@ -6229,16 +6229,20 @@ HRESULT SymbolReader::LoadCoreCLR() { HRESULT Status = S_OK; - std::string absolutePath, coreClrPath; - absolutePath = g_ExtServices->GetCoreClrDirectory(); - GetDirectory(absolutePath.c_str(), coreClrPath); + std::string absolutePath; + std::string coreClrPath = g_ExtServices->GetCoreClrDirectory(); + if (!GetAbsolutePath(coreClrPath.c_str(), absolutePath)) + { + ExtErr("Error: fail to convert CLR files path to absolute path \n"); + return E_FAIL; + } coreClrPath.append("/"); coreClrPath.append(coreClrDll); coreclrLib = dlopen(coreClrPath.c_str(), RTLD_NOW | RTLD_LOCAL); if (coreclrLib == nullptr) { - fprintf(stderr, "Error: Fail to load %s\n", coreClrPath.c_str()); + ExtErr("Error: Fail to load %s\n", coreClrPath.c_str()); return E_FAIL; } void *hostHandle; @@ -6270,7 +6274,7 @@ HRESULT SymbolReader::LoadCoreCLR() if (!GetEntrypointExecutableAbsolutePath(entryPointExecutablePath)) { - perror("Could not get full path to current executable"); + ExtErr("Could not get full path to current executable"); return E_FAIL; } @@ -6280,7 +6284,7 @@ HRESULT SymbolReader::LoadCoreCLR() propertyKeys, propertyValues, &hostHandle, &domainId); if (Status != S_OK) { - fprintf(stderr, "Error: Fail to initialize CoreCLR\n"); + ExtErr("Error: Fail to initialize CoreCLR\n"); return Status; } |