File tree Expand file tree Collapse file tree 3 files changed +9
-7
lines changed
Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ namespace SOS.Extensions
1313{
1414 internal sealed class MemoryRegionServiceFromDebuggerServices : IMemoryRegionService
1515 {
16+ private const string AddressCommand = "!address" ;
1617 private readonly DebuggerServices _debuggerServices ;
1718
1819 public MemoryRegionServiceFromDebuggerServices ( DebuggerServices debuggerServices )
@@ -25,7 +26,7 @@ public IEnumerable<IMemoryRegion> EnumerateRegions()
2526 bool foundHeader = false ;
2627 bool skipped = false ;
2728
28- ImmutableArray < string > lines = _debuggerServices . ExecuteHostCommand ( "!address" ) ;
29+ ImmutableArray < string > lines = _debuggerServices . ExecuteHostCommand ( AddressCommand ) ;
2930 foreach ( string line in lines )
3031 {
3132 if ( line . Length == 0 )
@@ -188,7 +189,7 @@ public IEnumerable<IMemoryRegion> EnumerateRegions()
188189
189190 if ( ! foundHeader )
190191 {
191- throw new InvalidOperationException ( $ "!address did not produce a standard header.\n This may mean symbols could not be resolved for ntdll.\n Please run !address and make sure the output looks correct.") ;
192+ throw new InvalidOperationException ( $ "{ AddressCommand } did not produce a standard header.\n This may mean symbols could not be resolved for ntdll.\n Please run { AddressCommand } and make sure the output looks correct.") ;
192193 }
193194 }
194195
Original file line number Diff line number Diff line change @@ -109,9 +109,9 @@ DECLARE_API(clrmaconfig)
109109 }
110110 }
111111
112- ExtOut (" CLRMA logging: %s\n " , g_clrmaGlobalFlags & ClrmaGlobalFlags::LoggingEnabled ? " enabled (disable with '-disable -logging')" : " disabled (enable with '-enable -logging')" );
113- ExtOut (" CLRMA direct DAC support: %s\n " , g_clrmaGlobalFlags & ClrmaGlobalFlags::DacClrmaEnabled ? " enabled (disable with '-disable -dac')" : " disabled (enable with '-enable -dac')" );
114- ExtOut (" CLRMA managed support: %s\n " , g_clrmaGlobalFlags & ClrmaGlobalFlags::ManagedClrmaEnabled ? " enabled (disable with '-disable -managed')" : " disabled (enable with '-enable -managed')" );
112+ ExtOut (" CLRMA logging: %s\n " , ( g_clrmaGlobalFlags & ClrmaGlobalFlags::LoggingEnabled) ? " enabled (disable with '-disable -logging')" : " disabled (enable with '-enable -logging')" );
113+ ExtOut (" CLRMA direct DAC support: %s\n " , ( g_clrmaGlobalFlags & ClrmaGlobalFlags::DacClrmaEnabled) ? " enabled (disable with '-disable -dac')" : " disabled (enable with '-enable -dac')" );
114+ ExtOut (" CLRMA managed support: %s\n " , ( g_clrmaGlobalFlags & ClrmaGlobalFlags::ManagedClrmaEnabled) ? " enabled (disable with '-disable -managed')" : " disabled (enable with '-enable -managed')" );
115115
116116 return Status;
117117}
Original file line number Diff line number Diff line change @@ -92,8 +92,9 @@ ClrmaException::Initialize()
9292 if (m_exceptionData.Message == 0 )
9393 {
9494 // To match the built-in SOS provider that scrapes !pe output.
95- m_message = new (std::nothrow)WCHAR[8 ];
96- wcscpy (m_message, L" <none>" );
95+ const WCHAR* none = L" <none>" ;
96+ m_message = new (std::nothrow) WCHAR[wcslen (none) + 1 ];
97+ wcscpy (m_message, none);
9798 }
9899 else
99100 {
You can’t perform that action at this time.
0 commit comments