/// </summary>
/// <param name="commandLine">command line text</param>
/// <param name="services">services for the command</param>
- /// <returns>true - found command, false - command not found</returns>
/// <exception cref="ArgumentException">empty command line</exception>
- /// <exception cref="DiagnosticsException">other errors</exception>
+ /// <exception cref="CommandNotFoundException">command not found</exception>
/// <exception cref="CommandParsingException ">parsing error</exception>
- public bool Execute(string commandLine, IServiceProvider services)
+ /// <exception cref="DiagnosticsException">other errors</exception>
+ public void Execute(string commandLine, IServiceProvider services)
{
string[] commandLineArray = CommandLineStringSplitter.Instance.Split(commandLine).ToArray();
if (commandLineArray.Length <= 0)
throw new ArgumentException("Empty command line", nameof(commandLine));
}
string commandName = commandLineArray[0].Trim();
- return Execute(commandName, commandLineArray, services);
+ Execute(commandName, commandLineArray, services);
}
/// <summary>
/// <param name="commandName">command name</param>
/// <param name="commandArguments">command arguments/options</param>
/// <param name="services">services for the command</param>
- /// <returns>true - found command, false - command not found</returns>
/// <exception cref="ArgumentException">empty command name or arguments</exception>
- /// <exception cref="DiagnosticsException">other errors</exception>
+ /// <exception cref="CommandNotFoundException">command not found</exception>
/// <exception cref="CommandParsingException ">parsing error</exception>
- public bool Execute(string commandName, string commandArguments, IServiceProvider services)
+ /// <exception cref="DiagnosticsException">other errors</exception>
+ public void Execute(string commandName, string commandArguments, IServiceProvider services)
{
commandName = commandName.Trim();
string[] commandLineArray = CommandLineStringSplitter.Instance.Split(commandName + " " + (commandArguments ?? "")).ToArray();
{
throw new ArgumentException("Empty command name or arguments", nameof(commandArguments));
}
- return Execute(commandName, commandLineArray, services);
+ Execute(commandName, commandLineArray, services);
}
/// <summary>
/// <param name="commandName">command name</param>
/// <param name="commandLineArray">command line</param>
/// <param name="services">services for the command</param>
- /// <returns>true - found command, false - command not found</returns>
/// <exception cref="ArgumentException">empty command name</exception>
- /// <exception cref="DiagnosticsException">other errors</exception>
+ /// <exception cref="CommandNotFoundException">command not found</exception>
/// <exception cref="CommandParsingException ">parsing error</exception>
- private bool Execute(string commandName, string[] commandLineArray, IServiceProvider services)
+ /// <exception cref="DiagnosticsException">other errors</exception>
+ private void Execute(string commandName, string[] commandLineArray, IServiceProvider services)
{
if (string.IsNullOrEmpty(commandName))
{
{
if (group.Execute(commandLineArray, services))
{
- return true;
+ return;
}
}
if (handler.FilterInvokeMessage != null)
}
if (messages.Count > 0)
{
- throw new CommandNotFoundException(string.Concat(messages.Select(s => s + Environment.NewLine)));
+ throw new CommandNotFoundException(messages);
+ }
+ else
+ {
+ throw new CommandNotFoundException(commandName);
}
- return false;
}
/// <summary>
// The .NET Foundation licenses this file to you under the MIT license.
using System;
+using System.Collections.Generic;
+using System.Linq;
namespace Microsoft.Diagnostics.DebugServices
{
/// </summary>
public class CommandNotFoundException : DiagnosticsException
{
- public const string NotFoundMessage = $"Unrecognized SOS command";
-
- public CommandNotFoundException(string message)
- : base(message)
+ public CommandNotFoundException(string command)
+ : base($"Unrecognized SOS command '{command}'")
{
}
- public CommandNotFoundException(string message, Exception innerException)
- : base(message, innerException)
+ public CommandNotFoundException(IEnumerable<string> messages)
+ : base(string.Join(Environment.NewLine, messages))
{
}
}
[ServiceExport(Scope = ServiceScope.Runtime)]
public static ClrMDHelper TryCreate([ServiceImport(Optional = true)] ClrRuntime clrRuntime)
{
- return clrRuntime != null ? new ClrMDHelper(clrRuntime) : null;
+ try
+ {
+ if (clrRuntime != null)
+ {
+ return new ClrMDHelper(clrRuntime);
+ }
+ }
+ catch (NotSupportedException ex)
+ {
+ Trace.TraceError(ex.ToString());
+ }
+ return null;
}
private ClrMDHelper(ClrRuntime clr)
private int DispatchCommand(
IntPtr self,
string commandName,
- string commandArguments)
+ string commandArguments,
+ bool displayCommandNotFound)
{
if (string.IsNullOrWhiteSpace(commandName))
{
}
try
{
- if (_commandService.Execute(commandName, commandArguments, commandName == "help" ? _contextService.Services : _servicesWithManagedOnlyFilter))
- {
- return HResult.S_OK;
- }
- else
- {
- // The command was not found or supported
- return HResult.E_NOTIMPL;
- }
+ _commandService.Execute(commandName, commandArguments, string.Equals(commandName, "help", StringComparison.OrdinalIgnoreCase) ? _contextService.Services : _servicesWithManagedOnlyFilter);
}
catch (Exception ex)
{
+ if (!displayCommandNotFound && ex is CommandNotFoundException)
+ {
+ // Returning E_NOTIMPL means no managed command or it filtered away so execute the C++ version if one
+ return HResult.E_NOTIMPL;
+ }
Trace.TraceError(ex.ToString());
IConsoleService consoleService = Services.GetService<IConsoleService>();
// TODO: when we can figure out how to deal with error messages in the scripts that are displayed on STDERROR under lldb
//consoleService.WriteLineError(ex.Message);
consoleService.WriteLine(ex.Message);
+ return HResult.E_FAIL;
}
- return HResult.E_FAIL;
+ return HResult.S_OK;
}
private void Uninitialize(
private delegate int DispatchCommandDelegate(
[In] IntPtr self,
[In, MarshalAs(UnmanagedType.LPStr)] string commandName,
- [In, MarshalAs(UnmanagedType.LPStr)] string commandArguments);
+ [In, MarshalAs(UnmanagedType.LPStr)] string commandArguments,
+ bool displayCommandNotFound);
[UnmanagedFunctionPointer(CallingConvention.Winapi)]
private delegate void UninitializeDelegate(
SOSCommandDelegate commandFunc = SOSHost.GetDelegateFunction<SOSCommandDelegate>(_sosLibrary, command);
if (commandFunc == null)
{
- throw new CommandNotFoundException($"{CommandNotFoundException.NotFoundMessage} '{command}'");
+ throw new CommandNotFoundException(command);
}
int result = commandFunc(client, arguments ?? "");
if (result == HResult.E_NOTIMPL)
{
- throw new CommandNotFoundException($"{CommandNotFoundException.NotFoundMessage} '{command}'");
+ throw new CommandNotFoundException(command);
}
if (result != HResult.S_OK)
{
IHostServices* hostServices = GetHostServices();
if (hostServices != nullptr)
{
- return hostServices->DispatchCommand(commandName, args);
+ return hostServices->DispatchCommand(commandName, args, /* displayCommandNotFound */ false);
}
}
return E_NOTIMPL;
DACMessage(HRESULT Status)
{
ExtOut("Failed to load data access module, 0x%08x\n", Status);
- if (GetHost()->GetHostType() == IHost::HostType::DbgEng)
+ if (g_pRuntime->GetRuntimeConfiguration() >= IRuntime::ConfigurationEnd)
{
- ExtOut("Verify that 1) you have a recent build of the debugger (10.0.18317.1001 or newer)\n");
- ExtOut(" 2) the file %s that matches your version of %s is\n", GetDacDllName(), GetRuntimeDllName());
- ExtOut(" in the version directory or on the symbol path\n");
- ExtOut(" 3) or, if you are debugging a dump file, verify that the file\n");
- ExtOut(" %s_<arch>_<arch>_<version>.dll is on your symbol path.\n", GetDacModuleName());
- ExtOut(" 4) you are debugging on a platform and architecture that supports this\n");
- ExtOut(" the dump file. For example, an ARM dump file must be debugged\n");
- ExtOut(" on an X86 or an ARM machine; an AMD64 dump file must be\n");
- ExtOut(" debugged on an AMD64 machine.\n");
- ExtOut("\n");
- ExtOut("You can run the command '!setclrpath <directory>' to control the load path of %s.\n", GetDacDllName());
- ExtOut("\n");
- ExtOut("Or you can also run the debugger command .cordll to control the debugger's\n");
- ExtOut("load of %s. .cordll -ve -u -l will do a verbose reload.\n", GetDacDllName());
- ExtOut("If that succeeds, the SOS command should work on retry.\n");
- ExtOut("\n");
- ExtOut("If you are debugging a minidump, you need to make sure that your executable\n");
- ExtOut("path is pointing to %s as well.\n", GetRuntimeDllName());
+ ExtOut("Unknown runtime type. Command not supported.\n");
}
else
{
- if (Status == CORDBG_E_MISSING_DEBUGGER_EXPORTS)
+ if (GetHost()->GetHostType() == IHost::HostType::DbgEng)
{
- ExtOut("You can run the debugger command 'setclrpath <directory>' to control the load of %s.\n", GetDacDllName());
+ ExtOut("Verify that 1) you have a recent build of the debugger (10.0.18317.1001 or newer)\n");
+ ExtOut(" 2) the file %s that matches your version of %s is\n", GetDacDllName(), GetRuntimeDllName());
+ ExtOut(" in the version directory or on the symbol path\n");
+ ExtOut(" 3) or, if you are debugging a dump file, verify that the file\n");
+ ExtOut(" %s_<arch>_<arch>_<version>.dll is on your symbol path.\n", GetDacModuleName());
+ ExtOut(" 4) you are debugging on a platform and architecture that supports this\n");
+ ExtOut(" the dump file. For example, an ARM dump file must be debugged\n");
+ ExtOut(" on an X86 or an ARM machine; an AMD64 dump file must be\n");
+ ExtOut(" debugged on an AMD64 machine.\n");
+ ExtOut("\n");
+ ExtOut("You can run the command '!setclrpath <directory>' to control the load path of %s.\n", GetDacDllName());
+ ExtOut("\n");
+ ExtOut("Or you can also run the debugger command .cordll to control the debugger's\n");
+ ExtOut("load of %s. .cordll -ve -u -l will do a verbose reload.\n", GetDacDllName());
ExtOut("If that succeeds, the SOS command should work on retry.\n");
+ ExtOut("\n");
+ ExtOut("If you are debugging a minidump, you need to make sure that your executable\n");
+ ExtOut("path is pointing to %s as well.\n", GetRuntimeDllName());
}
else
{
- ExtOut("Can not load or initialize %s. The target runtime may not be initialized.\n", GetDacDllName());
+ if (Status == CORDBG_E_MISSING_DEBUGGER_EXPORTS)
+ {
+ ExtOut("You can run the debugger command 'setclrpath <directory>' to control the load of %s.\n", GetDacDllName());
+ ExtOut("If that succeeds, the SOS command should work on retry.\n");
+ }
+ else
+ {
+ ExtOut("Can not load or initialize %s. The target runtime may not be initialized.\n", GetDacDllName());
+ }
}
}
ExtOut("\n");
HRESULT ExecuteManagedOnlyCommand(PCSTR commandName, PCSTR args)
{
- HRESULT hr = ExecuteCommand(commandName, args);
- if (hr == E_NOTIMPL)
+ IHostServices* hostServices = GetHostServices();
+ if (hostServices != nullptr)
{
- ExtErr("Unrecognized command '%s'\n", commandName);
+ return hostServices->DispatchCommand(commandName, args, /* displayCommandNotFound */ true);
}
- return hr;
+ ExtErr("Unrecognized command '%s' because managed hosting failed or was disabled. See !sethostruntime command for details.\n", commandName);
+ return E_NOTIMPL;
}
DECLARE_API(DumpStackObjects)
void AssemblyInfo(DacpAssemblyData *pAssembly)
{
- ExtOut("ClassLoader: %p\n", SOS_PTR(pAssembly->ClassLoader));
if ((ULONG64)pAssembly->AssemblySecDesc != NULL)
ExtOut("SecurityDescriptor: %p\n", SOS_PTR(pAssembly->AssemblySecDesc));
ExtOut(" Module\n");
if (getline(&line, &lineLen, locationFile) == -1)
{
- TraceError("Unable to read .NET installation marker at %s\n", markerName);
+ TraceError("SOS_HOSTING: Unable to read .NET installation marker at %s\n", markerName);
free(line);
return E_FAIL;
}
if (g_hostRuntimeDirectory == nullptr)
{
#if defined(HOST_FREEBSD)
- TraceError("Hosting on NetBSD not supported\n");
+ TraceError("SOS_HOSTING: FreeBSD not supported\n");
return E_FAIL;
#else
ArrayHolder<CHAR> programFiles = new CHAR[MAX_LONGPATH];
if (GetEnvironmentVariableA("PROGRAMFILES", programFiles, MAX_LONGPATH) == 0)
{
- TraceError("PROGRAMFILES environment variable not found\n");
+ TraceError("SOS_HOSTING: PROGRAMFILES environment variable not found\n");
return E_FAIL;
}
std::string windowsInstallPath(programFiles);
if (Status != S_OK)
{
- TraceError("Error: Failed to find runtime directory\n");
+ TraceError("SOS_HOSTING: Failed to find runtime directory\n");
return E_FAIL;
}
if (hostRuntimeVersion.Major == 0)
{
- TraceError("Error: Failed to find a supported runtime within %s\n", hostRuntimeDirectory.c_str());
+ TraceError("SOS_HOSTING: Failed to find a supported runtime within %s\n", hostRuntimeDirectory.c_str());
return E_FAIL;
}
Dl_info info;
if (dladdr((PVOID)&InitializeNetCoreHost, &info) == 0)
{
- TraceError("Error: dladdr() failed getting current module directory\n");
+ TraceError("SOS_HOSTING: Failed to get SOS module directory with dladdr()\n");
return E_FAIL;
}
sosModulePath = info.dli_fname;
ArrayHolder<char> szSOSModulePath = new char[MAX_LONGPATH + 1];
if (GetModuleFileNameA(g_hInstance, szSOSModulePath, MAX_LONGPATH) == 0)
{
- TraceError("Error: Failed to get SOS module directory\n");
+ TraceError("SOS_HOSTING: Failed to get SOS module directory\n");
return HRESULT_FROM_WIN32(GetLastError());
}
sosModulePath = szSOSModulePath;
void* coreclrLib = dlopen(coreClrPath.c_str(), RTLD_NOW | RTLD_LOCAL);
if (coreclrLib == nullptr)
{
- TraceError("Error: Failed to load %s\n", coreClrPath.c_str());
+ TraceError("SOS_HOSTING: Failed to load runtime module %s\n", coreClrPath.c_str());
return E_FAIL;
}
initializeCoreCLR = (coreclr_initialize_ptr)dlsym(coreclrLib, "coreclr_initialize");
HMODULE coreclrLib = LoadLibraryA(coreClrPath.c_str());
if (coreclrLib == nullptr)
{
- TraceError("Error: Failed to load %s\n", coreClrPath.c_str());
+ TraceError("SOS_HOSTING: Failed to load runtime module %s\n", coreClrPath.c_str());
return E_FAIL;
}
initializeCoreCLR = (coreclr_initialize_ptr)GetProcAddress(coreclrLib, "coreclr_initialize");
if (initializeCoreCLR == nullptr || createDelegate == nullptr)
{
- TraceError("Error: coreclr_initialize or coreclr_create_delegate not found\n");
+ TraceError("SOS_HOSTING: coreclr_initialize or coreclr_create_delegate not found in %s\n", coreClrPath.c_str());
return E_FAIL;
}
size_t lastSlash = sosModuleDirectory.rfind(DIRECTORY_SEPARATOR_CHAR_A);
if (lastSlash == std::string::npos)
{
- TraceError("Error: Failed to parse sos module name\n");
+ TraceError("SOS_HOSTING: Failed to parse SOS module name\n");
return E_FAIL;
}
sosModuleDirectory.erase(lastSlash);
char* exePath = minipal_getexepath();
if (!exePath)
{
- TraceError("Could not get full path to current executable\n");
+ TraceError("SOS_HOSTING: Could not get full path to current executable\n");
return E_FAIL;
}
void* hostHandle;
unsigned int domainId;
hr = initializeCoreCLR(exePath, "sos", ARRAY_SIZE(propertyKeys), propertyKeys, propertyValues, &hostHandle, &domainId);
-
free(exePath);
if (FAILED(hr))
{
- TraceError("Error: Fail to initialize coreclr %08x\n", hr);
+ TraceError("SOS_HOSTING: Fail to initialize hosting runtime '%s' %08x\n", coreClrPath.c_str(), hr);
return hr;
}
hr = createDelegate(hostHandle, domainId, ExtensionsDllName, ExtensionsClassName, ExtensionsInitializeFunctionName, (void**)&g_extensionsInitializeFunc);
if (FAILED(hr))
{
- TraceError("Error: Fail to create host ldelegate %08x\n", hr);
+ TraceError("SOS_HOSTING: Fail to create hosting delegate %08x\n", hr);
return hr;
}
}
}
if (FAILED(hr))
{
- TraceError("Extension host initialization FAILED %08x\n", hr);
+ TraceError("SOS_HOSTING: Extension host initialization FAILED %08x\n", hr);
return hr;
}
return hr;
ArrayHolder<WCHAR> wszSOSModulePath = new WCHAR[MAX_LONGPATH + 1];
if (GetModuleFileNameW(g_hInstance, wszSOSModulePath, MAX_LONGPATH) == 0)
{
- TraceError("Error: Failed to get SOS module directory\n");
+ TraceError("SOS_HOSTING: Failed to get SOS module directory\n");
return HRESULT_FROM_WIN32(GetLastError());
}
ArrayHolder<WCHAR> wszManagedModulePath = new WCHAR[MAX_LONGPATH + 1];
if (wcscpy_s(wszManagedModulePath.GetPtr(), MAX_LONGPATH, wszSOSModulePath.GetPtr()) != 0)
{
- TraceError("Error: Failed to copy module name\n");
+ TraceError("SOS_HOSTING: Failed to copy module name\n");
return E_FAIL;
}
WCHAR* lastSlash = wcsrchr(wszManagedModulePath.GetPtr(), DIRECTORY_SEPARATOR_CHAR_W);
}
if (wcscat_s(wszManagedModulePath.GetPtr(), MAX_LONGPATH, ExtensionsDllNameW) != 0)
{
- TraceError("Error: Failed to append SOS module name\n");
+ TraceError("SOS_HOSTING: Failed to append SOS module name\n");
return E_FAIL;
}
if (g_clrHost == nullptr)
hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
if (FAILED(hr) && hr != RPC_E_CHANGED_MODE)
{
- TraceError("Error: CoInitializeEx failed. %08x\n", hr);
+ TraceError("SOS_HOSTING: CoInitializeEx failed. %08x\n", hr);
return hr;
}
// Loads the CLR and then initializes the managed debugger extensions.
hr = CLRCreateInstance(CLSID_CLRMetaHost, IID_ICLRMetaHost, (PVOID*)&metaHost);
if (FAILED(hr) || metaHost == nullptr)
{
- TraceError("Error: CLRCreateInstance failed %08x\n", hr);
+ TraceError("SOS_HOSTING: CLRCreateInstance failed %08x\n", hr);
return hr;
}
ReleaseHolder<ICLRRuntimeInfo> runtimeInfo;
hr = metaHost->GetRuntime(CLR_VERSION, IID_ICLRRuntimeInfo, (PVOID*)&runtimeInfo);
if (FAILED(hr) || runtimeInfo == nullptr)
{
- TraceError("Error: ICLRMetaHost::GetRuntime failed %08x\n", hr);
+ TraceError("SOS_HOSTING: ICLRMetaHost::GetRuntime failed %08x\n", hr);
return hr;
}
hr = runtimeInfo->GetInterface(CLSID_CLRRuntimeHost, IID_ICLRRuntimeHost, (PVOID*)&g_clrHost);
if (FAILED(hr) || g_clrHost == nullptr)
{
- TraceError("Error: ICLRRuntimeInfo::GetInterface failed %08x\n", hr);
+ TraceError("SOS_HOSTING: ICLRRuntimeInfo::GetInterface failed %08x\n", hr);
return hr;
}
hr = g_clrHost->Start();
if (FAILED(hr))
{
- TraceError("Error: ICLRRuntimeHost::Start failed %08x\n", hr);
+ TraceError("SOS_HOSTING: ICLRRuntimeHost::Start failed %08x\n", hr);
g_clrHost->Release();
g_clrHost = nullptr;
return hr;
hr = g_clrHost->ExecuteInDefaultAppDomain(wszManagedModulePath.GetPtr(), ExtensionsClassNameW, ExtensionsInitializeFunctionNameW, wszSOSModulePath.GetPtr(), (DWORD *)&ret);
if (FAILED(hr))
{
- TraceError("Error: ICLRRuntimeHost::ExecuteInDefaultAppDomain failed %08x\n", hr);
+ TraceError("SOS_HOSTING: ICLRRuntimeHost::ExecuteInDefaultAppDomain failed %08x\n", hr);
g_clrHost->Release();
g_clrHost = nullptr;
return hr;
}
if (ret != 0)
{
- TraceError("Error: InitializeSymbolReader failed %08x\n", ret);
+ TraceError("SOS_HOSTING: Extension initialization failed %08x\n", ret);
g_clrHost->Release();
g_clrHost = nullptr;
return ret;
/// </summary>
/// <param name="commandName">command name</param>
/// <param name="arguments">command arguments</param>
+ /// <param name="displayCommandNotFound">if true, display command not found error message; if false, return E_NOTIMPL</param>
/// <returns>error code</returns>
virtual HRESULT STDMETHODCALLTYPE DispatchCommand(
PCSTR commandName,
- PCSTR arguments) = 0;
+ PCSTR arguments,
+ bool displayCommandNotFound) = 0;
/// <summary>
/// Uninitialize the extension infrastructure
IHostServices* hostservices = GetHostServices();
if (hostservices == nullptr)
{
+ g_services->Output(DEBUG_OUTPUT_ERROR, "Unrecognized command '%s' because managed hosting failed or was disabled. See sethostruntime command for details.\n", m_commandName);
result.SetStatus(lldb::eReturnStatusFailed);
return false;
}
}
}
g_services->FlushCheck();
- HRESULT hr = hostservices->DispatchCommand(m_commandName, commandArguments.c_str());
+ HRESULT hr = hostservices->DispatchCommand(m_commandName, commandArguments.c_str(), /* displayCommandNotFound */ true);
if (hr != S_OK)
{
result.SetStatus(lldb::eReturnStatusFailed);
if (hostservices != nullptr)
{
g_services->FlushCheck();
- HRESULT hr = hostservices->DispatchCommand(commandName, commandArguments.c_str());
+ HRESULT hr = hostservices->DispatchCommand(commandName, commandArguments.c_str(), /* displayCommandNotFound */ false);
if (hr != E_NOTIMPL)
{
result.SetStatus(hr == S_OK ? lldb::eReturnStatusSuccessFinishResult : lldb::eReturnStatusFailed);
{
foreach (string commandLine in command)
{
- if (!_commandService.Execute(commandLine, contextService.Services))
- {
- throw new CommandNotFoundException($"{CommandNotFoundException.NotFoundMessage} '{commandLine}'");
- }
+ _commandService.Execute(commandLine, contextService.Services);
if (_consoleService.Shutdown)
{
break;
_consoleService.Start((string prompt, string commandLine, CancellationToken cancellation) => {
_fileLoggingConsoleService.WriteLine("{0}{1}", prompt, commandLine);
- if (!_commandService.Execute(commandLine, contextService.Services))
- {
- throw new CommandNotFoundException($"{CommandNotFoundException.NotFoundMessage} '{commandLine}'");
- }
+ _commandService.Execute(commandLine, contextService.Services);
});
}
}
command = "help";
arguments = null;
}
- if (CommandService.Execute(command, arguments, Services))
+ try
{
- return;
+ CommandService.Execute(command, arguments, Services);
}
- if (SOSHost is null)
+ catch (CommandNotFoundException)
{
- throw new CommandNotFoundException($"{CommandNotFoundException.NotFoundMessage} '{command}'");
+ if (SOSHost is null)
+ {
+ throw;
+ }
+ SOSHost.ExecuteCommand(command, arguments);
}
- SOSHost.ExecuteCommand(command, arguments);
}
}
}
TestCommand2.Invoked = false;
TestCommand3.FilterValue = false;
TestCommand3.Invoked = false;
- Assert.True(commandService.Execute("testcommand", testDump.Target.Services));
+ commandService.Execute("testcommand", testDump.Target.Services);
Assert.True(TestCommand1.Invoked);
Assert.False(TestCommand2.Invoked);
Assert.False(TestCommand3.Invoked);
TestCommand2.Invoked = false;
TestCommand3.FilterValue = false;
TestCommand3.Invoked = false;
- Assert.True(commandService.Execute("testcommand", testDump.Target.Services));
+ commandService.Execute("testcommand", testDump.Target.Services);
Assert.False(TestCommand1.Invoked);
Assert.True(TestCommand2.Invoked);
Assert.False(TestCommand3.Invoked);
TestCommand2.Invoked = false;
TestCommand3.FilterValue = true;
TestCommand3.Invoked = false;
- Assert.True(commandService.Execute("testcommand", "--foo 23", testDump.Target.Services));
+ commandService.Execute("testcommand", "--foo 23", testDump.Target.Services);
Assert.False(TestCommand1.Invoked);
Assert.False(TestCommand2.Invoked);
Assert.True(TestCommand3.Invoked);
TestCommand3.Invoked = false;
try
{
- Assert.False(commandService.Execute("testcommand", testDump.Target.Services));
+ commandService.Execute("testcommand", testDump.Target.Services);
}
catch (DiagnosticsException ex)
{