PowerShell / PowerShell/vscode-powershell

Multi-file debugging with breakpoints

Open
#1,898 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-Debugging Issue-Bug
Dominant language
TypeScript
Stars
1.9k
Forks
547
PR merge metrics
No merged PRs in 30d

Description

Issue Type: Bug

Script1.ps1:
.\script2
#what is going on?
#I'm not sure any more
#please just stop!
#how 'bout now?

Script2.ps1:
.\script2
Param(
$param1,
$param2.
$param3,
$param4=(get-date))
$param4

Breakpoints on first line of both scripts, start debugging script1. When you step into the call to script2, the cursor jumps down to line 5 of script1. If you do "list" in the debug console, PowerShell tells you it's currently on line 5 of script2. I have reproduced this with the latest PowerShell and PowerShell preview extensions.
VSCodeDebugging

Extension version: 1.12.1
VS Code version: Code 1.33.1 (51b0b28134d51361cf996d2f0a1c698247aeabd8, 2019-04-11T08:27:14.102Z)
OS version: Windows_NT x64 10.0.17134

System Info
Item Value
CPUs Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz (4 x 2808)
GPU Status 2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: enabled
surface_synchronization: enabled_on
video_decode: enabled
webgl: enabled
webgl2: enabled
Memory (System) 15.88GB (8.14GB free)
Process Argv --file-uri file:///c%3A/temp/JHB_Account_Review/jhbaccountReview.code-workspace
Screen Reader no
VM 0%

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the report with Script1.ps1 and Script2.ps1, placing breakpoints on the first line of both scripts and stepping into the call from the VS Code debugger. Compare the editor cursor with the line reported by the debug console; done means both identify the same current file and line when execution enters Script2.ps1.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell, typescript, vscode
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.