diff --git a/src/SOS/SOS.Extensions/HostServices.cs b/src/SOS/SOS.Extensions/HostServices.cs index b44ebebe35..744d54c590 100644 --- a/src/SOS/SOS.Extensions/HostServices.cs +++ b/src/SOS/SOS.Extensions/HostServices.cs @@ -391,6 +391,8 @@ private void Uninitialize( if (DebuggerServices != null) { + // This turns off any logging to console now that debugger services will be released and the console service will no longer work. + DiagnosticLoggingService.Instance.SetConsole(consoleService: null, fileLoggingService: null); DebuggerServices.Release(); DebuggerServices = null; } diff --git a/src/SOS/SOS.UnitTests/Scripts/NestedExceptionTest.script b/src/SOS/SOS.UnitTests/Scripts/NestedExceptionTest.script index 4edba2d505..2c13f641df 100644 --- a/src/SOS/SOS.UnitTests/Scripts/NestedExceptionTest.script +++ b/src/SOS/SOS.UnitTests/Scripts/NestedExceptionTest.script @@ -41,7 +41,7 @@ SOSCOMMAND:PrintException VERIFY:Exception object:\s+\s+ VERIFY:Exception type:\s+System\.InvalidOperationException\s+ VERIFY:Message:\s+(|Invalid operation exception, outer)\s+ -VERIFY:InnerException:\s+System\.FormatException, Use !PrintException to see more.\s+ +VERIFY:InnerException:\s+System\.FormatException, Use !?printexception to see more.\s+ VERIFY:StackTrace \(generated\):\s+ VERIFY:\s+SP\s+IP\s+\s+Function\s+ VERIFY:\s+\s+\s+[Nn]ested[Ee]xception[Tt]est.*!NestedExceptionTest\.Program\.Main(\(.*\))?\+0x\s+ @@ -54,7 +54,7 @@ SOSCOMMAND:PrintException -nested VERIFY:Exception object:\s+\s+ VERIFY:Exception type:\s+System\.InvalidOperationException\s+ VERIFY:Message:\s+(|Invalid operation exception, outer)\s+ -VERIFY:InnerException:\s+System\.FormatException, Use !PrintException to see more.\s+ +VERIFY:InnerException:\s+System\.FormatException, Use !?printexception to see more.\s+ VERIFY:StackTrace \(generated\):\s+ VERIFY:\s+SP\s+IP\s+Function\s+ VERIFY:\s+\s+\s+[Nn]ested[Ee]xception[Tt]est.*!NestedExceptionTest\.Program\.Main(\(.*\))?\+0x\s+ @@ -72,7 +72,7 @@ VERIFY:(StackTraceString: \s+)? VERIFY:HResult:\s+80131537 # 6) Verifying that the Exception Object/ID gives us the same output about the reflected exception. -SOSCOMMAND:PrintException InnerException:\s+System\.FormatException, Use !PrintException () to see more +SOSCOMMAND:PrintException InnerException:\s+System\.FormatException, Use !?printexception () to see more VERIFY:Exception object:\s+\s+ VERIFY:Exception type:\s+System\.FormatException\s+ VERIFY:Message:\s+(|Bad format exception, inner)\s+ @@ -89,7 +89,7 @@ SOSCOMMAND:PrintException -lines VERIFY:Exception object:\s+\s+ VERIFY:Exception type:\s+System\.InvalidOperationException\s+ VERIFY:Message:\s+(|Invalid operation exception, outer)\s+ -VERIFY:InnerException:\s+System\.FormatException, Use !PrintException to see more.\s+ +VERIFY:InnerException:\s+System\.FormatException, Use !?printexception to see more.\s+ VERIFY:StackTrace \(generated\): VERIFY:\s+SP\s+IP\s+Function\s+ VERIFY:\s+\s+\s+[Nn]ested[Ee]xception[Tt]est.*!NestedExceptionTest\.Program\.Main(\(.*\))?\+0x\s* diff --git a/src/SOS/SOS.UnitTests/Scripts/Reflection.script b/src/SOS/SOS.UnitTests/Scripts/Reflection.script index 96d755177c..6a85c32d0d 100644 --- a/src/SOS/SOS.UnitTests/Scripts/Reflection.script +++ b/src/SOS/SOS.UnitTests/Scripts/Reflection.script @@ -14,14 +14,14 @@ SOSCOMMAND:PrintException VERIFY:Exception object:\s+\s+ VERIFY:Exception type:\s+System\.Reflection\.TargetInvocationException\s+ VERIFY:Message:\s+(|Exception has been thrown by the target of an invocation\.)\s+ -VERIFY:InnerException:\s+System\.Exception, Use !PrintException to see more.\s+ +VERIFY:InnerException:\s+System\.Exception, Use !?printexception to see more.\s+ VERIFY:StackTrace \(generated\):\s+ VERIFY:\s+\s+[Rr]eflection[Tt]est.*!(\$0_)?RefLoader(\.|::)Loader\.Main(\(\))?\+0x VERIFY:(StackTraceString: \s+)? VERIFY:HResult:\s+80131604 # 6) Verifying that the Exception Object/ID gives us the same output about the reflected exception. -SOSCOMMAND:PrintException InnerException:\s+System\.Exception, Use !PrintException () to see more +SOSCOMMAND:PrintException InnerException:\s+System\.Exception, Use !?printexception () to see more VERIFY:Exception object:\s+\s+ VERIFY:Exception type:\s+System\.Exception\s+ VERIFY:Message:\s+(|Exception from InvokedCode\.Invoked\.ExceptionNoHandler(\(\))?)\s+ @@ -35,7 +35,7 @@ VERIFY:HResult:\s+80131500 SOSCOMMAND:PrintException -lines VERIFY:Exception type:\s+System\.Reflection\.TargetInvocationException\s+ VERIFY:Message:\s+(|Exception has been thrown by the target of an invocation\.)\s+ -VERIFY:InnerException:\s+System\.Exception, Use !PrintException to see more\.\s+ +VERIFY:InnerException:\s+System\.Exception, Use !?printexception to see more\.\s+ VERIFY:StackTrace \(generated\):\s+ VERIFY:\s+\s+\s+[Rr]eflection[Tt]est.*!(\$0_)?RefLoader\.Loader\.Main(\(\))?\+0x\s* VERIFY:[.*[\\|/]Debuggees[\\|/].*[Rr]eflection[Tt]est[\\|/][Rr]eflection[Tt]est\.cs @ 32\s*\] diff --git a/src/SOS/SOS.UnitTests/Scripts/TaskNestedException.script b/src/SOS/SOS.UnitTests/Scripts/TaskNestedException.script index a85c0447c4..4ffbd05303 100644 --- a/src/SOS/SOS.UnitTests/Scripts/TaskNestedException.script +++ b/src/SOS/SOS.UnitTests/Scripts/TaskNestedException.script @@ -13,18 +13,18 @@ SOSCOMMAND:PrintException VERIFY:Exception object:\s+\s+ VERIFY:Exception type:\s+System\.AggregateException\s+ VERIFY:Message:\s+(|One or more errors occurred\.)\s+ -VERIFY:InnerException:\s+System\.FormatException, Use !PrintException to see more\.\s+ +VERIFY:InnerException:\s+System\.FormatException, Use !?printexception to see more\.\s+ VERIFY:StackTrace \(generated\):\s+ VERIFY:\s+SP\s+IP\s+Function\s+ VERIFY:\s+\s+.+System(::|\.)Threading(::|\.)Tasks(::|\.)Task\.Wait(\(\))?\+0x\s+ VERIFY:\s+\s+\s+.*RandomUserTask\.WaitTask(\(\))?\+0x\s+ VERIFY:\s+\s+\s+.*SosTests(::|\.)TaskException\.Main(\(\))?\+0x\s+ -SOSCOMMAND:PrintException -lines InnerException:\s+System\.FormatException, Use !PrintException () to see more +SOSCOMMAND:PrintException -lines InnerException:\s+System\.FormatException, Use !?printexception () to see more VERIFY:Exception object:\s+\s+ VERIFY:Exception type:\s+System\.FormatException\s+ VERIFY:Message:\s+(|Bad format exception, outer\.)\s+ -VERIFY:InnerException:\s+System\.InvalidOperationException, Use !PrintException to see more\.\s+ +VERIFY:InnerException:\s+System\.InvalidOperationException, Use !?printexception to see more\.\s+ VERIFY:StackTrace \(generated\):\s+ VERIFY:\s+SP\s+IP\s+Function\s+ VERIFY:\s+\s+.+RandomTest(::|\.)RandomUserTask\.<\.ctor>.+\+0x\s* @@ -34,7 +34,7 @@ VERIFY:[.+[\\|/]Debuggees[\\|/].*[Tt]ask[Nn]ested[Ee]xception[\\|/][Rr]andom[Uu] ENDIF:TRIAGE_DUMP ENDIF:DESKTOP -SOSCOMMAND:PrintException -lines InnerException:\s+System\.InvalidOperationException, Use !PrintException () to see more +SOSCOMMAND:PrintException -lines InnerException:\s+System\.InvalidOperationException, Use !?printexception () to see more VERIFY:Exception object:\s+\s+ VERIFY:Exception type:\s+System\.InvalidOperationException\s+ VERIFY:Message:\s+(|This is an Inner InvalidOperationException\.)\s+ diff --git a/src/SOS/Strike/exts.cpp b/src/SOS/Strike/exts.cpp index adede7e4c4..c6603051b8 100644 --- a/src/SOS/Strike/exts.cpp +++ b/src/SOS/Strike/exts.cpp @@ -217,6 +217,7 @@ void __cdecl _SOS_invalid_parameter( } bool g_Initialized = false; +const char* g_sosPrefix = ""; bool IsInitializedByDbgEng() { @@ -238,6 +239,7 @@ DebugExtensionInitialize(PULONG Version, PULONG Flags) return S_OK; } g_Initialized = true; + g_sosPrefix = "!"; ReleaseHolder debugClient; if ((hr = DebugCreate(__uuidof(IDebugClient), (void **)&debugClient)) != S_OK) diff --git a/src/SOS/Strike/sosdocsunix.txt b/src/SOS/Strike/sosdocsunix.txt index 00127b9d5a..53d3f8c8fa 100644 --- a/src/SOS/Strike/sosdocsunix.txt +++ b/src/SOS/Strike/sosdocsunix.txt @@ -536,7 +536,7 @@ memory in that range, you'll see the object pointers that are registered: You could run dumpobj on any of those pointers to learn more. In this example, there are no objects ready for finalization, presumably because they still have -roots (You can use !GCRoot to find out). The statistics section provides a +roots (You can use gcroot to find out). The statistics section provides a higher-level summary of the objects registered for finalization. Note that objects ready for finalization are also included in the statistics (if any). @@ -1326,14 +1326,14 @@ It means that Thread e04 owns object 00a7a194, and Thread ab8 owns object 0404ea04 77f5c524 SharedUserData!SystemCallStub+0x4 0404ea08 77e75ee0 ntdll!NtWaitForMultipleObjects+0xc 0404eaa4 5d9de9d6 KERNEL32!WaitForMultipleObjectsEx+0x12c - 0404eb38 5d9def80 clr!Thread::DoAppropriateAptStateWait+0x156 - 0404ecc4 5d9dd8bb clr!Thread::DoAppropriateWaitWorker+0x360 - 0404ed20 5da628dd clr!Thread::DoAppropriateWait+0xbb - 0404ede4 5da4e2e2 clr!CLREvent::Wait+0x29d - 0404ee70 5da4dd41 clr!AwareLock::EnterEpilog+0x132 - 0404ef34 5da4efa3 clr!AwareLock::Enter+0x2c1 - 0404f09c 5d767880 clr!AwareLock::Contention+0x483 - 0404f1c4 03f00229 clr!JITutil_MonContention+0x2c0 + 0404eb38 5d9def80 coreclr!Thread::DoAppropriateAptStateWait+0x156 + 0404ecc4 5d9dd8bb coreclr!Thread::DoAppropriateWaitWorker+0x360 + 0404ed20 5da628dd coreclr!Thread::DoAppropriateWait+0xbb + 0404ede4 5da4e2e2 coreclr!CLREvent::Wait+0x29d + 0404ee70 5da4dd41 coreclr!AwareLock::EnterEpilog+0x132 + 0404ef34 5da4efa3 coreclr!AwareLock::Enter+0x2c1 + 0404f09c 5d767880 coreclr!AwareLock::Contention+0x483 + 0404f1c4 03f00229 coreclr!JITutil_MonContention+0x2c0 0404f1f4 5b6ef077 image00400000!Worker.Work()+0x79 ... @@ -1706,10 +1706,10 @@ VerifyObj VerifyObj is a diagnostic tool that checks the object that is passed as an argument for signs of corruption. - 0:002> !verifyobj 028000ec + 0:002> verifyobj 028000ec object 0x28000ec does not have valid method table - 0:002> !verifyobj 0680017c + 0:002> verifyobj 0680017c object 0x680017c: bad member 00000001 at 06800184 \\ @@ -1763,14 +1763,14 @@ generations too, and report those roots. \\ COMMAND: analyzeoom. -AnalyzeOOM +analyzeoom AnalyzeOOM displays the info of the last OOM occurred on an allocation request to the GC heap (in Server GC it displays OOM, if any, on each GC heap). To see the managed exception(s) use the clrthreads command which will show you managed exception(s), if any, on each managed thread. If you do see an -OutOfMemoryException exception you can use the !PrintException command on it. +OutOfMemoryException exception you can use the printexception command on it. To get the full callstack use the "kb" command in the debugger for that thread. For example, to display thread 3's stack use ~3kb. @@ -1785,7 +1785,7 @@ OOM exceptions could be because of the following reasons: for example, some .NET framework code converts a native OOM exception to managed and throws it. -The !AnalyzeOOM command aims to help you with investigating 1) which is the most +The analyzeoom command aims to help you with investigating 1) which is the most difficult because it requires some internal info from GC. The only exception is we don't support allocating objects larger than 2GB on CLR v2.0 or prior. And this command will not display any managed OOM because we will throw OOM right away @@ -1807,7 +1807,7 @@ The other cases should be fairly obvious from the callstack. Sample output: -0:011> !analyzeoom +0:011> analyzeoom ---------Heap 2 --------- Managed OOM occurred after GC #28 (Requested to allocate 1234 bytes) Reason: Didn't have enough memory to commit @@ -2026,7 +2026,7 @@ Here is sample output from a very simple program. Note that the "RefCount" field only applies to RefCount Handles, and this field will contain the reference count: - 0:000> !GCHandles + 0:000> gchandles Handle Type Object Size RefCount Type 001611c0 Strong 01d00b58 84 System.IndexOutOfRangeException 001611c4 Strong 01d00b58 84 System.IndexOutOfRangeException diff --git a/src/SOS/Strike/strike.cpp b/src/SOS/Strike/strike.cpp index 166257bc2d..9950816161 100644 --- a/src/SOS/Strike/strike.cpp +++ b/src/SOS/Strike/strike.cpp @@ -162,10 +162,6 @@ WCHAR g_mdName[mdNameLen]; HMODULE g_hInstance = NULL; #endif // !FEATURE_PAL -#if !defined(FEATURE_PAL) && !defined(_TARGET_ARM64_) -extern bool g_useDesktopClrHost; -#endif - #ifdef _MSC_VER #pragma warning(disable:4244) // conversion from 'unsigned int' to 'unsigned short', possible loss of data #pragma warning(disable:4189) // local variable is initialized but not referenced @@ -173,10 +169,9 @@ extern bool g_useDesktopClrHost; #ifdef FEATURE_PAL #define SOSPrefix "" -#define SOSThreads "clrthreads" #else -#define SOSPrefix "!" -#define SOSThreads "!threads" +extern const char* g_sosPrefix; +#define SOSPrefix g_sosPrefix #endif #if defined _X86_ && !defined FEATURE_PAL @@ -951,9 +946,9 @@ DECLARE_API(DumpIL) // Now we have a local copy of the IL, and a managed array for token resolution. // Visit our IL parser with this info. ExtOut("This is dynamic IL. Exception info is not reported at this time.\n"); - ExtOut("If a token is unresolved, run \"!do \" on the addr given\n"); + ExtOut("If a token is unresolved, run \"%sdumpobj \" on the addr given\n", SOSPrefix); ExtOut("in parenthesis. You can also look at the token table yourself, by\n"); - ExtOut("running \"!DumpArray %p\".\n\n", SOS_PTR(tokenArrayAddr)); + ExtOut("running \"%sdumparray %p\".\n\n", SOSPrefix, SOS_PTR(tokenArrayAddr)); DecodeDynamicIL(pArray, (ULONG)codeArray.dwNumComponents, tokenArray); delete [] pArray; @@ -961,6 +956,7 @@ DECLARE_API(DumpIL) return Status; } + void DumpSigWorker ( DWORD_PTR dwSigAddr, DWORD_PTR dwModuleAddr, @@ -1064,7 +1060,7 @@ DECLARE_API(DumpSig) } if (nArg != 2) { - ExtOut("!DumpSig \n"); + ExtOut("%sdumpsig \n", SOSPrefix); return Status; } @@ -1112,7 +1108,7 @@ DECLARE_API(DumpSigElem) if (nArg != 2) { - ExtOut("!DumpSigElem \n"); + ExtOut("%sdumpsigelem \n", SOSPrefix); return Status; } @@ -1479,9 +1475,9 @@ void DisplayInvalidStructuresMessage() { ExtOut("The garbage collector data structures are not in a valid state for traversal.\n"); ExtOut("It is either in the \"plan phase,\" where objects are being moved around, or\n"); - ExtOut("we are at the initialization or shutdown of the gc heap. Commands related to \n"); - ExtOut("displaying, finding or traversing objects as well as gc heap segments may not \n"); - ExtOut("work properly. !dumpheap and !verifyheap may incorrectly complain of heap \n"); + ExtOut("we are at the initialization or shutdown of the gc heap. Commands related to\n"); + ExtOut("displaying, finding or traversing objects as well as gc heap segments may not\n"); + ExtOut("work properly. %sdumpheap and %sverifyheap may incorrectly complain of heap\n", SOSPrefix, SOSPrefix); ExtOut("consistency errors.\n"); } @@ -1951,7 +1947,7 @@ DECLARE_API(DumpArray) if (objData.ObjectType != OBJ_ARRAY) { - ExtOut("Not an array, please use !DumpObj instead\n"); + ExtOut("Not an array, please use %sdumpobj instead\n", SOSPrefix); return S_OK; } return PrintArray(objData, flags, FALSE); @@ -2257,7 +2253,7 @@ DECLARE_API(DumpDelegate) } if (nArg != 1) { - ExtOut("Usage: !DumpDelegate \n"); + ExtOut("Usage: %sdumpdelegate \n", SOSPrefix); return Status; } @@ -2601,7 +2597,7 @@ size_t FormatGeneratedException (DWORD_PTR dataPtr, // (It doesn't matter that it's not a valid instruction). (see /vm/excep.cpp) // // This "counterhack" is not 100% accurate - // The biggest issue is that !PrintException must work with exception objects + // The biggest issue is that PrintException must work with exception objects // that may not be currently active; as a consequence we cannot rely on the // state of some "current thread" to infer whether the IP values stored in // the exception object have been adjusted or not. If we could, we may examine @@ -2806,7 +2802,7 @@ HRESULT FormatException(CLRDATA_ADDRESS taObj, BOOL bLineNumbers = FALSE) if (IsDMLEnabled()) DMLOut("Use !PrintException %p to see more.\n", SOS_PTR(taInnerExc), SOS_PTR(taInnerExc)); else - ExtOut("Use !PrintException %p to see more.\n", SOS_PTR(taInnerExc)); + ExtOut("Use %sprintexception %p to see more.\n", SOSPrefix, SOS_PTR(taInnerExc)); } else { @@ -3144,7 +3140,7 @@ DECLARE_API(DumpVC) EnableDMLHolder dmlHolder(dml); if (nArg!=2) { - ExtOut("Usage: !DumpVC \n"); + ExtOut("Usage: %sdumpvc \n", SOSPrefix); return Status; } @@ -3568,7 +3564,7 @@ DECLARE_API(DumpPermissionSet) } if (nArg!=1) { - ExtOut("Usage: !DumpPermissionSet \n"); + ExtOut("Usage: %sdumppermissionset \n", SOSPrefix); return Status; } @@ -3836,7 +3832,7 @@ DECLARE_API(TraverseHeap) if (nArg != 1) { - ExtOut("usage: HeapTraverse [-xml] filename\n"); + ExtOut("usage: !TraverseHeap [-xml] filename\n"); return Status; } @@ -3865,7 +3861,7 @@ DECLARE_API(TraverseHeap) // tree structure to a sorted list of methodtables, and the index is the ID. // TODO: "Traversing object members" code should be generalized and shared between - // !gcroot and !traverseheap. Also !dumpheap can begin using GCHeapsTraverse. + // gcroot and traverseheap. Also dumpheap can begin using GCHeapsTraverse. if (!traverser.Initialize()) { @@ -4055,7 +4051,7 @@ class DumpHeapImpl {"-type", &type, COSTRING, TRUE}, // list objects of specified type {"-stat", &mStat, COBOOL, FALSE}, // dump a summary of types and the number of instances of each {"-strings", &mStrings, COBOOL, FALSE}, // dump a summary of string objects - {"-verify", &mVerify, COBOOL, FALSE}, // verify heap objects (!heapverify) + {"-verify", &mVerify, COBOOL, FALSE}, // verify heap objects (heapverify) {"-thinlock", &mThinlock, COBOOL, FALSE},// list only thinlocks {"-short", &mShort, COBOOL, FALSE}, // list only addresses {"-min", &mMinSize, COHEX, TRUE}, // min size of objects to display (hex) @@ -6872,7 +6868,7 @@ class Breakpoints { PendingBreakpoint *pCur = m_breakpoints; size_t iBreakpointIndex = 1; - ExtOut(SOSPrefix "bpmd pending breakpoint list\n Breakpoint index - Location, ModuleID, Method Token\n"); + ExtOut("%sbpmd pending breakpoint list\n Breakpoint index - Location, ModuleID, Method Token\n", SOSPrefix); while(pCur) { //windbg likes to format %p as always being 64 bits @@ -7652,7 +7648,7 @@ DECLARE_API(bpmd) if (IsDumpFile()) { - ExtOut(SOSPrefix "bpmd is not supported on a dump file.\n"); + ExtOut("%sbpmd is not supported on a dump file.\n", SOSPrefix); return Status; } @@ -7754,17 +7750,13 @@ DECLARE_API(bpmd) if (fBadParam || (commandsParsed != 1)) { - ExtOut("Usage: " SOSPrefix "bpmd -md \n"); - ExtOut("Usage: " SOSPrefix "bpmd [-nofuturemodule] []\n"); - ExtOut("Usage: " SOSPrefix "bpmd :\n"); - ExtOut("Usage: " SOSPrefix "bpmd -list\n"); - ExtOut("Usage: " SOSPrefix "bpmd -clear \n"); - ExtOut("Usage: " SOSPrefix "bpmd -clearall\n"); -#ifdef FEATURE_PAL - ExtOut("See \"soshelp bpmd\" for more details.\n"); -#else - ExtOut("See \"!help bpmd\" for more details.\n"); -#endif + ExtOut("Usage: %sbpmd -md \n", SOSPrefix); + ExtOut("Usage: %sbpmd [-nofuturemodule] []\n", SOSPrefix); + ExtOut("Usage: %sbpmd :\n", SOSPrefix); + ExtOut("Usage: %sbpmd -list\n", SOSPrefix); + ExtOut("Usage: %sbpmd -clear \n", SOSPrefix); + ExtOut("Usage: %sbpmd -clearall\n", SOSPrefix); + ExtOut("See \"%ssoshelp bpmd\" for more details.\n", SOSPrefix); return Status; } @@ -8697,8 +8689,8 @@ DECLARE_API(FindAppDomain) if (IsDMLEnabled()) DMLOut("!gcroot %p, and if you find a root on a\n", SOS_PTR(p_Object), SOS_PTR(p_Object)); else - ExtOut(SOSPrefix "gcroot %p, and if you find a root on a\n", SOS_PTR(p_Object)); - ExtOut("stack, check the AppDomain of that stack with " SOSThreads ".\n"); + ExtOut("%sgcroot %p, and if you find a root on a\n", SOSPrefix, SOS_PTR(p_Object)); + ExtOut("stack, check the AppDomain of that stack with %sclrthreads.\n", SOSPrefix); ExtOut("Note that the Thread could have transitioned between\n"); ExtOut("multiple AppDomains.\n"); } @@ -10735,7 +10727,7 @@ DECLARE_API(Token2EE) } if (nArg!=2) { - ExtOut("Usage: " SOSPrefix "Token2EE module_name mdToken\n"); + ExtOut("Usage: %stoken2ee module_name mdToken\n", SOSPrefix); ExtOut(" You can pass * for module_name to search all modules.\n"); return Status; } @@ -10861,11 +10853,11 @@ DECLARE_API(Name2EE) if (nArg != 2) { - ExtOut("Usage: " SOSPrefix "name2ee module_name item_name\n"); - ExtOut(" or " SOSPrefix "name2ee module_name!item_name\n"); + ExtOut("Usage: %sname2ee module_name item_name\n", SOSPrefix); + ExtOut(" or %sname2ee module_name!item_name\n", SOSPrefix); ExtOut(" use * for module_name to search all loaded modules\n"); - ExtOut("Examples: " SOSPrefix "name2ee mscorlib.dll System.String.ToString\n"); - ExtOut(" " SOSPrefix "name2ee *!System.String\n"); + ExtOut("Examples: %sname2ee mscorlib.dll System.String.ToString\n", SOSPrefix); + ExtOut(" %sname2ee *!System.String\n", SOSPrefix); return Status; } @@ -11011,7 +11003,7 @@ DECLARE_API(GCRoot) if (all) ExtOut("Found %d roots.\n", i); else - ExtOut("Found %d unique roots (run '" SOSPrefix "gcroot -all' to see all roots).\n", i); + ExtOut("Found %d unique roots (run '%sgcroot -all' to see all roots).\n", i, SOSPrefix); return Status; } @@ -11137,7 +11129,7 @@ DECLARE_API(FindRoots) if (IsDumpFile()) { - ExtOut("!FindRoots is not supported on a dump file.\n"); + ExtOut("%sfindroots is not supported on a dump file.\n", SOSPrefix); return Status; } @@ -11175,7 +11167,7 @@ DECLARE_API(FindRoots) } if ((gen < -1 || gen > 2) && (taObj == 0)) { - ExtOut("Incorrect options. Usage:\n\t!FindRoots -gen \n\t\twhere N is 0, 1, 2, or \"any\". OR\n\t!FindRoots \n"); + ExtOut("Incorrect options. Usage:\n\t%sfindroots -gen \n\t\twhere N is 0, 1, 2, or \"any\". OR\n\t%sfindroots \n", SOSPrefix, SOSPrefix); return Status; } @@ -11207,8 +11199,8 @@ DECLARE_API(FindRoots) if (!CheckCLRNotificationEvent(&dle)) { - ExtOut("The command !FindRoots can only be used after the debugger stopped on a CLRN GC notification.\n"); - ExtOut("At this time !GCRoot should be used instead.\n"); + ExtOut("The command %sfindroots can only be used after the debugger stopped on a CLRN GC notification.\n", SOSPrefix); + ExtOut("At this time %sgcroot should be used instead.\n", SOSPrefix); return Status; } // validate argument @@ -13144,7 +13136,7 @@ class ClrStackImplWithICorDebug ICorDebugProcess* pCorDebugProcess; if (FAILED(Status = g_pRuntime->GetCorDebugInterface(&pCorDebugProcess))) { - ExtOut("\n" SOSPrefix "clrstack -i is unsupported on this target.\nThe ICorDebug interface cannot be constructed.\n\n"); + ExtOut("\n%sclrstack -i is unsupported on this target.\nThe ICorDebug interface cannot be constructed.\n\n", SOSPrefix); return Status; } @@ -13764,7 +13756,7 @@ class ClrStackImpl if ((hr = g_clrData->GetTaskByOSThreadID(osID, &pTask)) != S_OK) { ExtOut("Unable to walk the managed stack. The current thread is likely not a \n"); - ExtOut("managed thread. You can run " SOSThreads " to get a list of managed threads in\n"); + ExtOut("managed thread. You can run %sclrthreads to get a list of managed threads in\n", SOSPrefix); ExtOut("the process\n"); return hr; } @@ -15578,7 +15570,7 @@ DECLARE_API(SuppressJitOptimization) } else { - ExtOut("Usage: !SuppressJitOptimization \n"); + ExtOut("Usage: %ssuppressjitoptimization \n", SOSPrefix); } return S_OK;