return E_INVALIDARG;
}
- CheckBreakingRuntimeChange();
+ if (CheckBreakingRuntimeChange())
+ {
+ return E_FAIL;
+ }
if (bLineNumbers)
{
if (bSupported)
{
- CheckBreakingRuntimeChange();
-
+ if (CheckBreakingRuntimeChange())
+ {
+ return E_FAIL;
+ }
HRESULT Status2 = PrintSpecialThreads();
if (!SUCCEEDED(Status2))
Status = Status2;
return E_FAIL;
}
- CheckBreakingRuntimeChange();
+ if (CheckBreakingRuntimeChange())
+ {
+ return E_FAIL;
+ }
+
LoadRuntimeSymbols();
const char* fileName = "StressLog.txt";
{
if (version > SOS_BREAKING_CHANGE_VERSION)
{
- ExtWarn("WARNING: SOS needs to be upgraded for this version of the runtime. Some commands may not work correctly.\n");
- ExtWarn("For more information see https://go.microsoft.com/fwlink/?linkid=2135652\n");
- ExtWarn("\n");
+ ExtErr("SOS needs to be upgraded for this version of the runtime. Some commands may not work correctly.\n");
+ ExtErr("For more information see https://go.microsoft.com/fwlink/?linkid=2135652\n");
+ ExtErr("\n");
result = true;
}
}
try
{
using DataTarget dataTarget = DataTarget.LoadDump(dump_path.FullName);
-
OSPlatform targetPlatform = dataTarget.DataReader.TargetPlatform;
- if (targetPlatform != OSPlatform.OSX &&
- (RuntimeInformation.IsOSPlatform(OSPlatform.OSX) ||
- dataTarget.DataReader.EnumerateModules().Any((module) => Path.GetExtension(module.FileName) == ".dylib")))
+ if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX) && (targetPlatform != OSPlatform.OSX))
+ {
+ throw new NotSupportedException("Analyzing Windows or Linux dumps not supported when running on MacOS");
+ }
+ if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) && (targetPlatform != OSPlatform.Linux))
{
- targetPlatform = OSPlatform.OSX;
+ throw new NotSupportedException("Analyzing Windows or MacOS dumps not supported when running on Linux");
}
TargetFromDataReader target = new(dataTarget.DataReader, targetPlatform, this, _targetIdFactory++, dump_path.FullName);
contextService.SetCurrentTarget(target);