Files
MicrosoftIris/Tests/SimpleDebugClient/Program.cs
T

43 lines
1.1 KiB
C#
Raw Normal View History

2022-06-07 01:00:15 -05:00
using Microsoft.Iris.Debug;
2023-05-23 20:12:35 -05:00
using Microsoft.Iris.Debug.Data;
using System;
2022-06-07 01:00:15 -05:00
2023-05-23 20:12:35 -05:00
namespace SimpleDebugClient;
internal class Program
2022-06-07 01:00:15 -05:00
{
2023-05-23 20:12:35 -05:00
static IDebuggerClient? Debugger { get; set; }
static int Main(string[] args)
2022-06-07 01:00:15 -05:00
{
2023-05-23 20:12:35 -05:00
string connectionString = args.Length >= 2
? args[1] : "tcp://127.0.0.1:5556";
2022-10-07 09:34:08 -05:00
2023-05-23 20:12:35 -05:00
Console.CancelKeyPress += Console_CancelKeyPress;
2022-06-12 21:21:29 -05:00
2023-05-23 20:12:35 -05:00
Debugger = new ZmqDebuggerClient(connectionString);
Debugger.DispatcherStep += Debugger_DispatcherStep;
Debugger.InterpreterStep += Debugger_InterpreterStep;
2022-06-12 21:21:29 -05:00
2023-05-23 20:12:35 -05:00
Console.WriteLine("Listening for debug messages. Press Ctrl-C to exit.");
Console.ReadLine();
return 0;
2023-05-23 20:12:35 -05:00
}
private static void Console_CancelKeyPress(object sender, ConsoleCancelEventArgs e)
{
if (Debugger is IDisposable debugger)
debugger.Dispose();
}
private static void Debugger_DispatcherStep(string obj)
{
Console.WriteLine($"[Dispatcher] {obj}");
2023-05-23 20:12:35 -05:00
}
private static void Debugger_InterpreterStep(object? sender, InterpreterEntry e)
{
2023-05-23 21:35:58 -05:00
2022-06-07 01:00:15 -05:00
}
}