PowerShell / PowerShell/vscode-powershell
PowerShell attach removes existing breakpoints in attached session
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- TypeScript
- Estrellas
- 1.9k
- Forks
- 548
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
Prerequisites
- I have written a descriptive issue title.
- I have searched all open and closed issues to ensure it has not already been reported.
- I have read the troubleshooting guide.
- I am sure this issue is with the extension itself and does not reproduce in a standalone PowerShell instance.
- I have verified that I am using the latest version of Visual Studio Code and the PowerShell extension.
- If this is a security issue, I have read the security issue reporting guidance.
Summary
I use VSCode PowerShell debugger by attaching to a process hosting PowerShell.
Attaching removes breakpoints that I have already set in my session.
PowerShell Version
Name Value
---- -----
PSVersion 7.3.3
PSEdition Core
GitCommitId 7.3.3
OS Microsoft Windows 10.0.19045
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Visual Studio Code Version
1.73.1
6261075646f055b99068d3688932416f2346dd3b
x64
Extension Version
ms-vscode.powershell@2023.3.3
Steps to Reproduce
(1) Invoke the below script test1.ps1 in some PowerShell session. E.g. I used and saw the problem in powershell and pwsh consoles and in my application hosting PowerShell as well.
function global:test1 {
'hi'
}
Set-PSBreakpoint -Command test1
Set-PSBreakpoint -Script $PSScriptRoot\test1.ps1 -Line 2
(2) Run Get-PSBreakpoint -- see 2 breakpoints
(3) In VSCode, launch/attach PowerShell debugger configured as below.
Select the target process where we have set 2 breakpoints.
{
"type": "PowerShell",
"request": "attach",
"name": "PowerShell attach",
"processId": "${command:PickPSHostProcess}",
"runspaceId": 1
},
(4) With the debugger attached, run Get-PSBreakpoint again -- see that breakpoints are gone.
Visuals
No response
Logs
No response
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Reproduce el problema con el script proporcionado test1.ps1, dos llamadas a Set-PSBreakpoint y la configuración de attach de PowerShell mediante PickPSHostProcess. Empieza rastreando el flujo de attach del depurador y compara Get-PSBreakpoint antes y después del attach. Se considera terminado cuando el attach conserva ambos breakpoints existentes; en el issue no se indica ningún archivo de prueba ni ningún punto de entrada del código fuente.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- powershell, typescript, vscode
- Área
- developer-experience, devtools
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 32/100