Skip to content
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
39 changes: 39 additions & 0 deletions src/System.Management.Automation/engine/debugger/debugger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,13 @@ public virtual IEnumerable<CallStackFrame> GetCallStack()
public virtual Breakpoint GetBreakpoint(int id) =>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rjmholt, your last commit had 1 failures in PowerShell-CI-static-analysis
Verify Markdown Links.Verify links in /home/vsts/work/1/s/docs/building/internals.md.https://cmake.org/download/ should work

retry of URL failed with error: Response status code does not indicate success: 500 (Internal Server Error).
at <ScriptBlock>, /home/vsts/work/1/s/test/common/markdown/markdown-link.tests.ps1: line 117
117:                                     throw "retry of URL failed with error: $($_.Exception.Message)"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rjmholt, your last commit had 1 failures in PowerShell-CI-windows
TestAppDomainProcessExitEvenHandlerNotLeaking

Assert.DoesNotContain() Failure
Found:    (filter expression)
In value: Delegate[] [EventHandler { Method = Void DisposeOnShutdown(System.Object, System.EventArgs), Target = null }, EventHandler { Method = Void CurrentDomain_ProcessExit(System.Object, System.EventArgs), Target = null }]
   at PSTests.Sequential.RunspaceTests.TestAppDomainProcessExitEvenHandlerNotLeaking() in D:\a\1\s\test\xUnit\csharp\test_Runspace.cs:line 127

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rjmholt, your last commit had 1 failures in PowerShell-CI-windows
TestAppDomainProcessExitEvenHandlerNotLeaking

Assert.DoesNotContain() Failure
Found:    (filter expression)
In value: Delegate[] [EventHandler { Method = Void DisposeOnShutdown(System.Object, System.EventArgs), Target = null }, EventHandler { Method = Void CurrentDomain_ProcessExit(System.Object, System.EventArgs), Target = null }]
   at PSTests.Sequential.RunspaceTests.TestAppDomainProcessExitEvenHandlerNotLeaking() in D:\a\1\s\test\xUnit\csharp\test_Runspace.cs:line 127

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rjmholt, your last commit had 1 failures in PowerShell-CI-windows
TestAppDomainProcessExitEvenHandlerNotLeaking

Assert.DoesNotContain() Failure
Found:    (filter expression)
In value: Delegate[] [EventHandler { Method = Void DisposeOnShutdown(System.Object, System.EventArgs), Target = null }, EventHandler { Method = Void CurrentDomain_ProcessExit(System.Object, System.EventArgs), Target = null }]
   at PSTests.Sequential.RunspaceTests.TestAppDomainProcessExitEvenHandlerNotLeaking() in D:\a\1\s\test\xUnit\csharp\test_Runspace.cs:line 127

throw new PSNotImplementedException();

/// <summary>
/// Adds the provided set of breakpoints to the debugger.
/// </summary>
/// <param name="breakpoints">Breakpoints.</param>
public virtual void SetBreakpoints(IEnumerable<Breakpoint> breakpoints) =>
throw new PSNotImplementedException();

/// <summary>
/// Returns breakpoints primarily for the Get-PSBreakpoint cmdlet.
/// </summary>
Expand Down Expand Up @@ -2580,6 +2587,31 @@ internal override UnhandledBreakpointProcessingMode UnhandledBreakpointMode

#region Breakpoints

/// <summary>
/// Adds the provided set of breakpoints to the debugger.
/// </summary>
/// <param name="breakpoints"></param>
public override void SetBreakpoints(IEnumerable<Breakpoint> breakpoints)
{
foreach (Breakpoint bp in breakpoints)
{
switch (bp)
{
case CommandBreakpoint commandBreakpoint:
AddCommandBreakpoint(commandBreakpoint);
continue;

case LineBreakpoint lineBreakpoint:
AddLineBreakpoint(lineBreakpoint);
continue;

case VariableBreakpoint variableBreakpoint:
AddVariableBreakpoint(variableBreakpoint);
continue;
}
}
}

/// <summary>
/// Get a breakpoint by id, primarily for Enable/Disable/Remove-PSBreakpoint cmdlets.
/// </summary>
Expand Down Expand Up @@ -4048,6 +4080,13 @@ public NestedRunspaceDebugger(

#region Overrides

/// <summary>
/// Adds the provided set of breakpoints to the debugger.
/// </summary>
/// <param name="breakpoints">Breakpoints.</param>
public override void SetBreakpoints(IEnumerable<Breakpoint> breakpoints) =>
_wrappedDebugger.SetBreakpoints(breakpoints);

/// <summary>
/// Process debugger or PowerShell command/script.
/// </summary>
Expand Down
7 changes: 7 additions & 0 deletions src/System.Management.Automation/engine/hostifaces/PSTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1087,6 +1087,13 @@ public override DebuggerCommandResults ProcessCommand(
return _wrappedDebugger.ProcessCommand(command, output);
}

/// <summary>
/// Adds the provided set of breakpoints to the debugger.
/// </summary>
/// <param name="breakpoints">List of breakpoints.</param>
public override void SetBreakpoints(IEnumerable<Breakpoint> breakpoints) =>
_wrappedDebugger.SetBreakpoints(breakpoints);

/// <summary>
/// Sets the debugger resume action.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3909,6 +3909,13 @@ public override DebuggerCommandResults ProcessCommand(PSCommand command, PSDataC
return _wrappedDebugger.ProcessCommand(command, output);
}

/// <summary>
/// Adds the provided set of breakpoints to the debugger.
/// </summary>
/// <param name="breakpoints">Breakpoints.</param>
public override void SetBreakpoints(IEnumerable<Breakpoint> breakpoints) =>
_wrappedDebugger.SetBreakpoints(breakpoints);

public override Breakpoint GetBreakpoint(int id) =>
_wrappedDebugger.GetBreakpoint(id);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2006,6 +2006,13 @@ public override void StopProcessCommand()
}
}

/// <summary>
/// Adds the provided set of breakpoints to the debugger.
/// </summary>
/// <param name="breakpoints">Breakpoints.</param>
public override void SetBreakpoints(IEnumerable<Breakpoint> breakpoints) =>
_runspace.Debugger?.SetBreakpoints(breakpoints);

/// <summary>
/// Get a breakpoint by id, primarily for Enable/Disable/Remove-PSBreakpoint cmdlets.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1842,6 +1842,13 @@ public override bool InBreakpoint
get { return _inDebugMode; }
}

/// <summary>
/// Adds the provided set of breakpoints to the debugger.
/// </summary>
/// <param name="breakpoints">List of breakpoints.</param>
public override void SetBreakpoints(IEnumerable<Breakpoint> breakpoints) =>
_wrappedDebugger.Value.SetBreakpoints(breakpoints);

public override Breakpoint GetBreakpoint(int id) =>
_wrappedDebugger.Value.GetBreakpoint(id);

Expand Down