Skip to content

Commit a573185

Browse files
author
Mike McLaughlin
committed
Code review feedback
1 parent 112c129 commit a573185

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

src/SOS/SOS.Extensions/MemoryRegionServiceFromDebuggerServices.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff 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.\nThis may mean symbols could not be resolved for ntdll.\nPlease run !address and make sure the output looks correct.");
192+
throw new InvalidOperationException($"{AddressCommand} did not produce a standard header.\nThis may mean symbols could not be resolved for ntdll.\nPlease run {AddressCommand} and make sure the output looks correct.");
192193
}
193194
}
194195

src/SOS/Strike/clrma/clrma.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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
}

src/SOS/Strike/clrma/exception.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff 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
{

0 commit comments

Comments
 (0)