public static ICorDebug?CreateCorDebug(int pid, CoreCLRTypeAttachInfo info, out string coreclrFilename, out string?otherVersion) { string?clrPath = info.CoreCLRFilename; otherVersion = info.Version; if (clrPath is null || otherVersion is null) { var infos = GetCoreCLRInfos(pid, runtimePath: null, dbgshimPath: info.DbgShimFilename); if (infos.Length != 0) { clrPath ??= infos[0].CoreCLRTypeInfo.CoreCLRFilename; otherVersion ??= infos[0].CoreCLRTypeInfo.Version; } else { throw new ArgumentException("Couldn't find a CoreCLR process"); } } coreclrFilename = clrPath ?? throw new ArgumentException($"Couldn't get the CLR path"); var dbgShimState = GetOrCreateDbgShimState(null, info.DbgShimFilename); if (dbgShimState is null) { return(null); } int hr = dbgShimState.CreateDebuggingInterfaceFromVersionEx !(CorDebugInterfaceVersion.CorDebugVersion_4_0, otherVersion, out object obj); return(obj as ICorDebug); }
public static ICorDebug CreateCorDebug(CoreCLRTypeAttachInfo info) { var dbgShimState = GetOrCreateDbgShimState(null, info.DbgShimFilename); if (dbgShimState == null) { return(null); } object obj; int hr = dbgShimState.CreateDebuggingInterfaceFromVersionEx(CorDebugInterfaceVersion.CorDebugVersion_4_0, info.Version, out obj); return(obj as ICorDebug); }
public CoreCLRInfo(int pid, string coreclrFilename, string?version, string dbgShimFilename) { ProcessId = pid; CoreCLRTypeInfo = new CoreCLRTypeAttachInfo(version, dbgShimFilename, coreclrFilename); }
public CoreCLRInfo(int pid, string filename, string version, string dbgShimFilename) { ProcessId = pid; CoreCLRTypeInfo = new CoreCLRTypeAttachInfo(version, dbgShimFilename); CoreCLRFilename = filename; }