Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 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
43 changes: 41 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,46 @@ 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> SetSelectedThread(int threadId)
{
GetLastProcess().MICommandFactory.DefineCurrentThread(threadId);
return await Task.FromResult<Results>(new Results(ResultClass.done));
}

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

command = command.Trim();

if (command[0] == '-')
{
return await GetLastProcess().CmdAsync(command, ResultClass.None);
}
else
{
return null;
}
}

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