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; }
|
|
|
|
|
|
2023-05-24 10:14:07 -05:00
|
|
|
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;
|
2023-05-24 10:14:07 -05:00
|
|
|
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();
|
2023-05-24 10:14:07 -05:00
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
{
|
2023-05-24 16:04:09 -05:00
|
|
|
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
|
|
|
}
|
|
|
|
|
}
|