Skip to content

PSES crashing while debugging #701

Closed
@rjmholt

Description

@rjmholt

From PowerShell/vscode-powershell#1422 (comment).

Seems to be a crash in the debugger.

Possibly this one:

2018-07-11 10:27:32.478 [VERBOSE] C:\PowerShellEditorServices\src\PowerShellEditorServices\Session\PowerShellContext.cs: In method 'ExecuteCommandInDebugger', line 1224:
    Attempting to execute command(s) in the debugger:
    
        Get-Variable -Scope 2
    

2018-07-11 10:27:32.481 [ERROR] C:\PowerShellEditorServices\src\PowerShellEditorServices\Session\PowerShellContext.cs: In method 'ExecuteCommand', line 586:
    Runtime exception occurred while executing command:
    
    System.Management.Automation.CmdletInvocationException: The scope number '2' exceeds the number of active scopes.
    Parameter name: scopeID
    Actual value was 2. ---> System.Management.Automation.PSArgumentOutOfRangeException: The scope number '2' exceeds the number of active scopes.
    Parameter name: scopeID
    Actual value was 2.
       at System.Management.Automation.SessionStateInternal.GetScopeByID(Int32 scopeID)
       at System.Management.Automation.SessionStateInternal.GetScopeByID(String scopeID)
       at System.Management.Automation.SessionStateInternal.GetVariableTableAtScope(String scopeID)
       at Microsoft.PowerShell.Commands.VariableCommandBase.GetMatchingVariables(String name, String lookupScope, Boolean& wasFiltered, Boolean quiet)
       at Microsoft.PowerShell.Commands.GetVariableCommand.ProcessRecord()
       at System.Management.Automation.Cmdlet.DoProcessRecord()
       at System.Management.Automation.CommandProcessor.ProcessRecord()
       --- End of inner exception stack trace ---
       at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
       at System.Management.Automation.Runspaces.Pipeline.Invoke()
       at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
       at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
       at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
       at System.Management.Automation.PowerShell.CoreInvoke[TOutput](IEnumerable input, PSDataCollection`1 output, PSInvocationSettings settings)
       at System.Management.Automation.PowerShell.Invoke[T](IEnumerable input, IList`1 output, PSInvocationSettings settings)
       at System.Management.Automation.PowerShell.InvokeWithDebugger(IEnumerable`1 input, IList`1 output, PSInvocationSettings settings, Boolean invokeMustRun)
       at System.Management.Automation.ScriptDebugger.ProcessCommand(PSCommand command, PSDataCollection`1 output)
       at Microsoft.PowerShell.EditorServices.Session.PowerShell4Operations.ExecuteCommandInDebugger[TResult](PowerShellContext powerShellContext, Runspace currentRunspace, PSCommand psCommand, Boolean sendOutputToHost, Nullable`1& debuggerResumeAction)
       at Microsoft.PowerShell.EditorServices.PowerShellContext.ExecuteCommandInDebugger[TResult](PSCommand psCommand, Boolean sendOutputToHost)
       at Microsoft.PowerShell.EditorServices.PowerShellContext.<ExecuteCommand>d__48`1.MoveNext()

2018-07-11 10:27:32.481 [VERBOSE] C:\PowerShellEditorServices\src\PowerShellEditorServices.Protocol\MessageProtocol\MessageWriter.cs: In method 'WriteMessage', line 61:
    Writing Event 'powerShell/executionStatusChanged'

2018-07-11 10:27:32.482 [VERBOSE] C:\PowerShellEditorServices\src\PowerShellEditorServices\Session\PowerShellContext.cs: In method 'ExecuteCommandInDebugger', line 1224:
    Attempting to execute command(s) in the debugger:
    
        Get-Variable -Scope 3

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions