Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MIEngine: New methods and framework update #1437

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/MIDebugEngine/Engine.Impl/DebuggedThread.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ internal async Task<List<ThreadContext>> StackFrames(DebuggedThread thread)

internal async Task<ThreadContext> GetThreadContext(DebuggedThread thread)
{
if (thread == null)
return null;

lock (_threadList)
{
if (_topContext.ContainsKey(thread.Id))
Expand Down
37 changes: 35 additions & 2 deletions src/MIDebugEngine/MIDebugCommandDispatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static class MIDebugCommandDispatcher
{
private readonly static List<DebuggedProcess> s_processes = new List<DebuggedProcess>();

public static Task<string> ExecuteCommand(string command)
private static DebuggedProcess GetLastProcess()
{
DebuggedProcess lastProcess;
lock (s_processes)
Expand All @@ -27,7 +27,40 @@ public static Task<string> ExecuteCommand(string command)

lastProcess = s_processes[s_processes.Count - 1];
}
return ExecuteCommand(command, lastProcess);

if (lastProcess == null)
{
throw new InvalidOperationException(MICoreResources.Error_NoMIDebuggerProcess);
}

return lastProcess;
}

public static MICore.ProcessState GetProcessState()
{
return GetLastProcess().ProcessState;
}

public static async Task<Results> ExecuteMICommandWithResultsObject(string command)
{
if (string.IsNullOrWhiteSpace(command))
throw new ArgumentNullException(nameof(command));

command = command.Trim();

if (command[0] == '-')
intel-rganesh marked this conversation as resolved.
Show resolved Hide resolved
{
return await GetLastProcess().CmdAsync(command, ResultClass.None);
}
else
{
throw new ArgumentOutOfRangeException(nameof(command));
}
}

public static Task<string> ExecuteCommand(string command)
{
return ExecuteCommand(command, GetLastProcess());
}

internal static Task<string> ExecuteCommand(string command, DebuggedProcess process, bool ignoreFailures = false)
Expand Down
2 changes: 1 addition & 1 deletion src/MIDebugPackage/source.extension.vsixmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<DisplayName>Microsoft MI-based Debugger</DisplayName>
<Description xml:space="preserve">Provides support for connecting Visual Studio to MI compatible debuggers</Description>
</Metadata>
<Installation InstalledByMsi="false">
<Installation InstalledByMsi="false" AllUsers="true">
<InstallationTarget Id="Microsoft.VisualStudio.Pro" Version="[15.0, 17.0)" />
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[15.0, 17.0)" />
</Installation>
Expand Down
2 changes: 1 addition & 1 deletion src/WindowsDebugLauncher/WindowsDebugLauncher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<StartAction>Program</StartAction>
<OutputPath>$(MIDefaultOutputPath)\vscode</OutputPath>
<DropSubDir>vscode</DropSubDir>
<TargetFramework>net462</TargetFramework>
<TargetFramework>net472</TargetFramework>
<OutputType>Exe</OutputType>
<Externalconsole>true</Externalconsole>
</PropertyGroup>
Expand Down
Loading