Use enums for LaunchType

This commit is contained in:
Charles Betros 2019-10-06 21:52:54 -05:00
parent 3e25902894
commit da3ca1fe02

View file

@ -309,13 +309,11 @@ namespace Cosmos.VS.DebugEngine.AD7.Impl
string xPortType = xParts[0].ToLower();
string xPortParam = xParts[1].ToLower();
var xLaunch = mDebugInfo[BuildPropertyNames.LaunchString];
OutputText("Starting debug connector.");
switch (xPortType)
{
case "pipe:":
if (xLaunch == "HyperV")
if (mLaunch == LaunchType.HyperV || mLaunch == LaunchType.Qemu)
{
mDbgConnector = new DebugConnectorPipeClient(xPortParam);
}
@ -325,7 +323,7 @@ namespace Cosmos.VS.DebugEngine.AD7.Impl
}
break;
case "serial:":
if (xLaunch == "IntelEdison")
if (mLaunch == LaunchType.IntelEdison)
{
mDbgConnector = new DebugConnectorEdison(xPortParam, Path.ChangeExtension(mDebugInfo["ISOFile"], ".bin"));
}
@ -336,7 +334,6 @@ namespace Cosmos.VS.DebugEngine.AD7.Impl
break;
default:
throw new Exception("No debug connector found for port type '" + xPortType + "'");
}
mDbgConnector.SetConnectionHandler(DebugConnectorConnected);
mDbgConnector.CmdBreak += new Action<uint>(DbgCmdBreak);