mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-20 12:58:39 +00:00
This commit is contained in:
parent
93ad7db51f
commit
ed2abdb9a2
4 changed files with 21 additions and 1 deletions
|
|
@ -8,7 +8,7 @@ using System.Windows.Forms;
|
|||
|
||||
namespace Cosmos.Debug.Common.CDebugger
|
||||
{
|
||||
public abstract class DebugConnector {
|
||||
public abstract class DebugConnector: IDisposable {
|
||||
//TODO: These should not be this way and should in fact
|
||||
// be checked or better yet done by constructor arguments
|
||||
// but that puts a restriction on where the sub classes
|
||||
|
|
@ -103,6 +103,11 @@ namespace Cosmos.Debug.Common.CDebugger
|
|||
}
|
||||
}
|
||||
|
||||
public virtual void Dispose()
|
||||
{
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
protected void PacketTextSize(byte[] aPacket) {
|
||||
Next(GetUInt16(aPacket, 0), PacketText);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,6 +45,16 @@ namespace Cosmos.Debug.Common.CDebugger {
|
|||
// Request first command
|
||||
Next(1, PacketCommand);
|
||||
}
|
||||
|
||||
public override void Dispose()
|
||||
{
|
||||
if (mStream != null)
|
||||
{
|
||||
mStream.Close();
|
||||
mStream = null;
|
||||
}
|
||||
base.Dispose();
|
||||
}
|
||||
|
||||
protected override void PacketTracePoint(byte[] aPacket) {
|
||||
CmdTrace(mCurrentMsgType, GetUInt32(aPacket, 0));
|
||||
|
|
|
|||
|
|
@ -369,6 +369,8 @@ namespace Cosmos.Debug.VSDebugEngine {
|
|||
{
|
||||
mProcess.Kill();
|
||||
mProcess.Exited -= mProcess_Exited;
|
||||
mDbgConnector.Dispose();
|
||||
mDbgConnector = null;
|
||||
return VSConstants.S_OK;
|
||||
}
|
||||
|
||||
|
|
@ -394,6 +396,8 @@ namespace Cosmos.Debug.VSDebugEngine {
|
|||
Trace.WriteLine(String.Format("Process Exit Code: {0}", mProcess.ExitCode));
|
||||
//AD7ThreadDestroyEvent.Send(mEngine, mThread, (uint)mProcess.ExitCode);
|
||||
//mCallback.OnProgramDestroy((uint)mProcess.ExitCode);
|
||||
mDbgConnector.Dispose();
|
||||
mDbgConnector = null;
|
||||
mCallback.OnProcessExit((uint)mProcess.ExitCode);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ namespace Cosmos.VS.Package
|
|||
xValues.Add("DebugMode", this.GetConfigurationProperty("DebugMode", true));
|
||||
xValues.Add("TraceAssemblies", this.GetConfigurationProperty("TraceAssemblies", true));
|
||||
xValues.Add("BuildTarget", this.GetConfigurationProperty("BuildTarget", true));
|
||||
xValues.Add("ProjectFile", Path.Combine(ProjectMgr.ProjectFolder, ProjectMgr.ProjectFile));
|
||||
|
||||
xInfo.bstrExe = NameValueCollectionHelper.DumpToString(xValues);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue