benk Builder change - minor patch to launch debugger

This commit is contained in:
bklooste_cp 2009-05-16 14:23:00 +00:00
parent 61272dd6ff
commit c3fdb104ba
5 changed files with 44 additions and 11 deletions

View file

@ -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
{

View file

@ -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();

View file

@ -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>

View 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();
}
}
}

View file

@ -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.
}