Exemplo n.º 1
0
        private static void ExecuteCommand(IntPtr client, string command, [MarshalAs(UnmanagedType.LPStr)] string args)
        {
            ICommandHandler handler;

            if (!commandHandlers.TryGetValue(command, out handler))
            {
                return;
            }

            DebuggerContext?context = DebuggerContext.GetDebuggerContext(client);

            if (context == null)
            {
                return;
            }

            try
            {
                handler.Execute(context, args);
            }
            catch (Exception ex)
            {
                context.Output.WriteLine($"Encountered an unhandled exception running '{command}':");
                context.Output.WriteLine(ex.ToString());
            }
        }
Exemplo n.º 2
0
        private static void ExecuteCommand(IntPtr client, string command, [MarshalAs(UnmanagedType.LPStr)] string args)
        {
            ICommandHandler handler;

            if (!CommandHandlers.TryGetValue(command, out handler))
            {
                return;
            }

            DebuggerContext?context = DebuggerContext.GetDebuggerContext(client);

            if (context is null)
            {
                return;
            }

            try
            {
                handler.Execute(context, args);
            }
#pragma warning disable CA1031 // Do not catch general exception types
            catch (Exception ex)
#pragma warning restore CA1031 // Do not catch general exception types
            {
                context.Output.WriteLine($"Encountered an unhandled exception running '{command}':");
                context.Output.WriteLine(ex.ToString());
            }
        }
Exemplo n.º 3
0
        private static void ExecuteCommand(IntPtr client, string command, [MarshalAs(UnmanagedType.LPStr)] string args)
        {
            ICommandHandler handler;

            if (!commandHandlers.TryGetValue(command, out handler))
            {
                return;
            }

            DebuggerContext?context = DebuggerContext.GetDebuggerContext(client);

            if (context == null)
            {
                return;
            }

            handler.Execute(context, args);
        }