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
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ protected override void ProcessRecord()
else
{
WriteObject(
Context.Debugger.SetCommandBreakpoint(Command[i], Action));
Context.Debugger.SetCommandBreakpoint(Command[i], Action, path: null));
}
}
}
Expand All @@ -103,7 +103,7 @@ protected override void ProcessRecord()
else
{
WriteObject(
Context.Debugger.SetVariableBreakpoint(Variable[i], Mode, Action));
Context.Debugger.SetVariableBreakpoint(Variable[i], Mode, Action, path: null));
}
}
}
Expand Down
226 changes: 151 additions & 75 deletions src/System.Management.Automation/engine/debugger/debugger.cs

Large diffs are not rendered by default.

52 changes: 26 additions & 26 deletions src/System.Management.Automation/engine/hostifaces/PSTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1091,8 +1091,8 @@ public override DebuggerCommandResults ProcessCommand(
/// Adds the provided set of breakpoints to the debugger.
/// </summary>
/// <param name="breakpoints">List of breakpoints.</param>
/// <param name="runspaceId">The runspace id of the runspace you want to interact with. Defaults to null (current runspace).</param>
public override void SetBreakpoints(IEnumerable<Breakpoint> breakpoints, int? runspaceId = null) =>
/// <param name="runspaceId">The runspace id of the runspace you want to interact with. A null value will use the current runspace.</param>
public override void SetBreakpoints(IEnumerable<Breakpoint> breakpoints, int? runspaceId) =>
_wrappedDebugger.SetBreakpoints(breakpoints, runspaceId);

/// <summary>
Expand All @@ -1108,79 +1108,79 @@ public override void SetDebuggerAction(DebuggerResumeAction resumeAction)
/// Get a breakpoint by id, primarily for Enable/Disable/Remove-PSBreakpoint cmdlets.
/// </summary>
/// <param name="id">Id of the breakpoint you want.</param>
/// <param name="runspaceId">The runspace id of the runspace you want to interact with. Defaults to null (current runspace).</param>
/// <param name="runspaceId">The runspace id of the runspace you want to interact with. A null value will use the current runspace.</param>
/// <returns>The breakpoint with the specified id.</returns>
public override Breakpoint GetBreakpoint(int id, int? runspaceId = null) =>
public override Breakpoint GetBreakpoint(int id, int? runspaceId) =>
_wrappedDebugger.GetBreakpoint(id, runspaceId);

/// <summary>
/// Returns breakpoints on a runspace.
/// </summary>
/// <param name="runspaceId">The runspace id of the runspace you want to interact with. Defaults to null (current runspace).</param>
/// <param name="runspaceId">The runspace id of the runspace you want to interact with. A null value will use the current runspace.</param>
/// <returns>A list of breakpoints in a runspace.</returns>
public override List<Breakpoint> GetBreakpoints(int? runspaceId = null) =>
public override List<Breakpoint> GetBreakpoints(int? runspaceId) =>
_wrappedDebugger.GetBreakpoints(runspaceId);

/// <summary>
/// Sets a command breakpoint in the debugger.
/// </summary>
/// <param name="command">The name of the command that will trigger the breakpoint. This value is required and may not be null.</param>
/// <param name="command">The name of the command that will trigger the breakpoint. This value may not be null.</param>
/// <param name="action">The action to take when the breakpoint is hit. If null, PowerShell will break into the debugger when the breakpoint is hit.</param>
/// <param name="path">The path to the script file where the breakpoint may be hit. If null, the breakpoint may be hit anywhere the command is invoked.</param>
/// <param name="runspaceId">The runspace id of the runspace you want to interact with. Defaults to null (current runspace).</param>
/// <param name="runspaceId">The runspace id of the runspace you want to interact with. A null value will use the current runspace.</param>
/// <returns>The command breakpoint that was set.</returns>
public override CommandBreakpoint SetCommandBreakpoint(string command, ScriptBlock action = null, string path = null, int? runspaceId = null) =>
public override CommandBreakpoint SetCommandBreakpoint(string command, ScriptBlock action, string path, int? runspaceId) =>
_wrappedDebugger.SetCommandBreakpoint(command, action, path, runspaceId);

/// <summary>
/// Sets a variable breakpoint in the debugger.
/// </summary>
/// <param name="variableName">The name of the variable that will trigger the breakpoint. This value is required and may not be null.</param>
/// <param name="accessMode">The variable access mode that will trigger the breakpoint. By default variable breakpoints will trigger only when the variable is updated.</param>
/// <param name="variableName">The name of the variable that will trigger the breakpoint. This value may not be null.</param>
/// <param name="accessMode">The variable access mode that will trigger the breakpoint.</param>
/// <param name="action">The action to take when the breakpoint is hit. If null, PowerShell will break into the debugger when the breakpoint is hit.</param>
/// <param name="path">The path to the script file where the breakpoint may be hit. If null, the breakpoint may be hit anywhere the variable is accessed using the specified access mode.</param>
/// <param name="runspaceId">The runspace id of the runspace you want to interact with. Defaults to null (current runspace).</param>
/// <param name="runspaceId">The runspace id of the runspace you want to interact with. A null value will use the current runspace.</param>
/// <returns>The variable breakpoint that was set.</returns>
public override VariableBreakpoint SetVariableBreakpoint(string variableName, VariableAccessMode accessMode = VariableAccessMode.Write, ScriptBlock action = null, string path = null, int? runspaceId = null) =>
public override VariableBreakpoint SetVariableBreakpoint(string variableName, VariableAccessMode accessMode, ScriptBlock action, string path, int? runspaceId) =>
_wrappedDebugger.SetVariableBreakpoint(variableName, accessMode, action, path, runspaceId);

/// <summary>
/// Sets a line breakpoint in the debugger.
/// </summary>
/// <param name="path">The path to the script file where the breakpoint may be hit. This value is required and may not be null.</param>
/// <param name="line">The line in the script file where the breakpoint may be hit. This value is required and must be greater than or equal to 1.</param>
/// <param name="path">The path to the script file where the breakpoint may be hit. This value may not be null.</param>
/// <param name="line">The line in the script file where the breakpoint may be hit. This value must be greater than or equal to 1.</param>
/// <param name="column">The column in the script file where the breakpoint may be hit. If 0, the breakpoint will trigger on any statement on the line.</param>
/// <param name="action">The action to take when the breakpoint is hit. If null, PowerShell will break into the debugger when the breakpoint is hit.</param>
/// <param name="runspaceId">The runspace id of the runspace you want to interact with. Defaults to null (current runspace).</param>
/// <param name="runspaceId">The runspace id of the runspace you want to interact with. A null value will use the current runspace.</param>
/// <returns>The line breakpoint that was set.</returns>
public override LineBreakpoint SetLineBreakpoint(string path, int line, int column = 0, ScriptBlock action = null, int? runspaceId = null) =>
public override LineBreakpoint SetLineBreakpoint(string path, int line, int column, ScriptBlock action, int? runspaceId) =>
_wrappedDebugger.SetLineBreakpoint(path, line, column, action, runspaceId);

/// <summary>
/// Enables a breakpoint in the debugger.
/// </summary>
/// <param name="breakpoint">The breakpoint to enable in the debugger. This value is required and may not be null.</param>
/// <param name="runspaceId">The runspace id of the runspace you want to interact with. Defaults to null (current runspace).</param>
/// <param name="breakpoint">The breakpoint to enable in the debugger. This value may not be null.</param>
/// <param name="runspaceId">The runspace id of the runspace you want to interact with. A null value will use the current runspace.</param>
/// <returns>The updated breakpoint if it was found; null if the breakpoint was not found in the debugger.</returns>
public override Breakpoint EnableBreakpoint(Breakpoint breakpoint, int? runspaceId = null) =>
public override Breakpoint EnableBreakpoint(Breakpoint breakpoint, int? runspaceId) =>
_wrappedDebugger.EnableBreakpoint(breakpoint, runspaceId);

/// <summary>
/// Disables a breakpoint in the debugger.
/// </summary>
/// <param name="breakpoint">The breakpoint to enable in the debugger. This value is required and may not be null.</param>
/// <param name="runspaceId">The runspace id of the runspace you want to interact with. Defaults to null (current runspace).</param>
/// <param name="breakpoint">The breakpoint to enable in the debugger. This value may not be null.</param>
/// <param name="runspaceId">The runspace id of the runspace you want to interact with. A null value will use the current runspace.</param>
/// <returns>The updated breakpoint if it was found; null if the breakpoint was not found in the debugger.</returns>
public override Breakpoint DisableBreakpoint(Breakpoint breakpoint, int? runspaceId = null) =>
public override Breakpoint DisableBreakpoint(Breakpoint breakpoint, int? runspaceId) =>
_wrappedDebugger.DisableBreakpoint(breakpoint, runspaceId);

/// <summary>
/// Removes a breakpoint from the debugger.
/// </summary>
/// <param name="breakpoint">The breakpoint to remove from the debugger. This value is required and may not be null.</param>
/// <param name="runspaceId">The runspace id of the runspace you want to interact with. Defaults to null (current runspace).</param>
/// <param name="breakpoint">The breakpoint to remove from the debugger. This value may not be null.</param>
/// <param name="runspaceId">The runspace id of the runspace you want to interact with. A null value will use the current runspace.</param>
/// <returns>True if the breakpoint was removed from the debugger; false otherwise.</returns>
public override bool RemoveBreakpoint(Breakpoint breakpoint, int? runspaceId = null) =>
public override bool RemoveBreakpoint(Breakpoint breakpoint, int? runspaceId) =>
_wrappedDebugger.RemoveBreakpoint(breakpoint, runspaceId);

/// <summary>
Expand Down
Loading