mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-24 12:35:31 +00:00
This commit is contained in:
parent
7a25468505
commit
dc7d0dc66b
3 changed files with 13 additions and 6 deletions
|
|
@ -10,13 +10,13 @@ namespace Cosmos.Debug.VSDebugEngine {
|
||||||
public class DebugWindows {
|
public class DebugWindows {
|
||||||
|
|
||||||
public static void Test(string aData) {
|
public static void Test(string aData) {
|
||||||
using (var xPipe = new NamedPipeClientStream(".", "CosmosDebug", PipeDirection.Out)) {
|
using (var xPipe = new NamedPipeClientStream(".", "CosmosDebugWindows", PipeDirection.Out)) {
|
||||||
// The connect function will indefinately wait for the pipe to become available
|
|
||||||
// If that is not acceptable specify a maximum waiting time (in ms)
|
|
||||||
xPipe.Connect();
|
xPipe.Connect();
|
||||||
using (var xWriter = new StreamWriter(xPipe)) {
|
using (var xWriter = new StreamWriter(xPipe)) {
|
||||||
xWriter.WriteLine(aData);
|
xWriter.WriteLine(aData);
|
||||||
}
|
}
|
||||||
|
xPipe.Flush();
|
||||||
|
xPipe.WaitForPipeDrain();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -139,6 +139,9 @@ namespace Cosmos.Debug.VSDebugEngine
|
||||||
var eventObject = new AD7BreakpointEvent(boundBreakpointsEnum);
|
var eventObject = new AD7BreakpointEvent(boundBreakpointsEnum);
|
||||||
var ad7Thread = (AD7Thread)thread;
|
var ad7Thread = (AD7Thread)thread;
|
||||||
Send(eventObject, AD7BreakpointEvent.IID, ad7Thread);
|
Send(eventObject, AD7BreakpointEvent.IID, ad7Thread);
|
||||||
|
// We catch and resend data rather than using a second serial port because
|
||||||
|
// while this would work fine in a VM, it puts extra requirements on the setup
|
||||||
|
// when real hardware is used.
|
||||||
DebugWindows.Test("Test");
|
DebugWindows.Test("Test");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,12 +18,16 @@ using System.Windows.Threading;
|
||||||
|
|
||||||
namespace Cosmos.VS.Debug {
|
namespace Cosmos.VS.Debug {
|
||||||
public partial class MainWindow : Window {
|
public partial class MainWindow : Window {
|
||||||
|
|
||||||
public MainWindow() {
|
public MainWindow() {
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
|
var xServerThread = new Thread(ThreadStartServer);
|
||||||
|
xServerThread.Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ThreadStartClient(object obj) {
|
public void ThreadStartServer() {
|
||||||
using (var xPipe = new NamedPipeServerStream("CosmosDebug", PipeDirection.In)) {
|
using (var xPipe = new NamedPipeServerStream("CosmosDebugWindows", PipeDirection.In)) {
|
||||||
xPipe.WaitForConnection();
|
xPipe.WaitForConnection();
|
||||||
using (var xReader = new StreamReader(xPipe)) {
|
using (var xReader = new StreamReader(xPipe)) {
|
||||||
string xLine = xReader.ReadLine();
|
string xLine = xReader.ReadLine();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue