mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-19 12:30:32 +00:00
benk Builder change - minor patch to launch debugger
This commit is contained in:
parent
61272dd6ff
commit
c3fdb104ba
5 changed files with 44 additions and 11 deletions
|
|
@ -29,8 +29,8 @@ namespace Cosmos.Compiler.Builder
|
|||
public event Action<BuildProgress> BuildProgress;
|
||||
public event Action<LogSeverityEnum, string> LogMessage;
|
||||
|
||||
private DebugWindow xDebugWindow = null; //HACK pass in event
|
||||
public DebugWindow DebugWindow { get { return xDebugWindow; } }
|
||||
private DebugWindowController xDebugWindow = null; //HACK pass in event
|
||||
public DebugWindowController DebugWindow { get { return xDebugWindow; } }
|
||||
|
||||
|
||||
private readonly BuildProgress currentProgress = new BuildProgress();
|
||||
|
|
@ -305,7 +305,7 @@ namespace Cosmos.Compiler.Builder
|
|||
}
|
||||
|
||||
|
||||
private void ProcessDebug(BuildOptions options, ref DebugWindow xDebugWindow, ref Process xQEMU)
|
||||
private void ProcessDebug(BuildOptions options, ref DebugWindowController xDebugWindow, ref Process xQEMU)
|
||||
{
|
||||
|
||||
if (options.DebugMode == DebugMode.Source)
|
||||
|
|
@ -377,9 +377,10 @@ namespace Cosmos.Compiler.Builder
|
|||
|
||||
}
|
||||
|
||||
//HACK MUST BE UI
|
||||
//xDebugWindow = new DebugWindow();
|
||||
//xDebugWindow.SetSourceInfoMap(xSourceMappings, xDebugConnector);
|
||||
//TODO handle passing to UI better
|
||||
xDebugWindow = new DebugWindowController();
|
||||
xDebugWindow.mSourceMappings = xSourceMappings;
|
||||
xDebugWindow.mDebugConnector = xDebugConnector;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ namespace Cosmos.Compiler.Builder
|
|||
|
||||
string BuildPath {get;}
|
||||
|
||||
DebugWindow DebugWindow {get;} //HACK pass in event
|
||||
DebugWindowController DebugWindow { get; } //HACK pass in event
|
||||
|
||||
|
||||
//string[] GetPlugs();
|
||||
|
|
|
|||
|
|
@ -155,6 +155,7 @@
|
|||
<DependentUpon>DebugWindow.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="UI\DebugWindowController.cs" />
|
||||
<Compile Include="UI\IBuildProgressUC.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
|
|
|
|||
23
source/Cosmos.Build.Windows/UI/DebugWindowController.cs
Normal file
23
source/Cosmos.Build.Windows/UI/DebugWindowController.cs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Cosmos.Compiler.Builder
|
||||
{
|
||||
public class DebugWindowController
|
||||
{
|
||||
private DebugWindow window;
|
||||
|
||||
public SourceInfos mSourceMappings { get; set; }
|
||||
public DebugConnector mDebugConnector {get; set; }
|
||||
|
||||
public void Show()
|
||||
{
|
||||
window = new DebugWindow();
|
||||
window.SetSourceInfoMap(mSourceMappings ,mDebugConnector);
|
||||
window.Show();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -92,24 +92,32 @@ namespace Cosmos.Compiler.Builder
|
|||
|
||||
void mBuilder_BuildCompleted()
|
||||
{
|
||||
mainWindow.Dispatcher.Invoke(new Action(PostBuildUI));
|
||||
|
||||
|
||||
mainWindow.ThreadedClose(); //HACK //TODO consider making the controller survive the window.
|
||||
}
|
||||
|
||||
|
||||
void PostBuildUI()
|
||||
{
|
||||
|
||||
new ConsoleWindow().HideWindow();
|
||||
|
||||
//HACK need to fire Debugger window in event
|
||||
|
||||
// Problems around with DebugWindow getting stuck, this seems to work
|
||||
//mMainWindow.Hide();
|
||||
if (mBuilder.DebugWindow!= null)
|
||||
if (mBuilder.DebugWindow != null)
|
||||
{
|
||||
// Beginnings of experiment to host QEMU
|
||||
//if (xQEMU != null) {
|
||||
// IntPtr xDbgHandle = new WindowInteropHelper(Application.Current.MainWindow).Handle;
|
||||
// SetParent(xQEMU.MainWindowHandle, xDbgHandle);
|
||||
//}
|
||||
mBuilder.DebugWindow.ShowDialog();
|
||||
mBuilder.DebugWindow.Show();
|
||||
}
|
||||
//mMainWindow.Close();
|
||||
|
||||
mainWindow.ThreadedClose(); //HACK //TODO consider making the controller survive the window.
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue