Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit da5b94e

Browse files
lucenticusMike McLaughlin
authored andcommitted
[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'
1 parent 3b5550f commit da5b94e

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/ToolBox/SOS/Strike/util.cpp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6229,16 +6229,20 @@ HRESULT SymbolReader::LoadCoreCLR()
62296229
{
62306230
HRESULT Status = S_OK;
62316231

6232-
std::string absolutePath, coreClrPath;
6233-
absolutePath = g_ExtServices->GetCoreClrDirectory();
6234-
GetDirectory(absolutePath.c_str(), coreClrPath);
6232+
std::string absolutePath;
6233+
std::string coreClrPath = g_ExtServices->GetCoreClrDirectory();
6234+
if (!GetAbsolutePath(coreClrPath.c_str(), absolutePath))
6235+
{
6236+
ExtErr("Error: fail to convert CLR files path to absolute path \n");
6237+
return E_FAIL;
6238+
}
62356239
coreClrPath.append("/");
62366240
coreClrPath.append(coreClrDll);
62376241

62386242
coreclrLib = dlopen(coreClrPath.c_str(), RTLD_NOW | RTLD_LOCAL);
62396243
if (coreclrLib == nullptr)
62406244
{
6241-
fprintf(stderr, "Error: Fail to load %s\n", coreClrPath.c_str());
6245+
ExtErr("Error: Fail to load %s\n", coreClrPath.c_str());
62426246
return E_FAIL;
62436247
}
62446248
void *hostHandle;
@@ -6270,7 +6274,7 @@ HRESULT SymbolReader::LoadCoreCLR()
62706274

62716275
if (!GetEntrypointExecutableAbsolutePath(entryPointExecutablePath))
62726276
{
6273-
perror("Could not get full path to current executable");
6277+
ExtErr("Could not get full path to current executable");
62746278
return E_FAIL;
62756279
}
62766280

@@ -6280,7 +6284,7 @@ HRESULT SymbolReader::LoadCoreCLR()
62806284
propertyKeys, propertyValues, &hostHandle, &domainId);
62816285
if (Status != S_OK)
62826286
{
6283-
fprintf(stderr, "Error: Fail to initialize CoreCLR\n");
6287+
ExtErr("Error: Fail to initialize CoreCLR\n");
62846288
return Status;
62856289
}
62866290

0 commit comments

Comments
 (0)