Commit 0fcb641
committed
Fix debugging script blocks that aren't in files
The code relied on running `list 1 <MaxInt>` but that wasn't being run
in the debug context because we allow-list commands to prevent pollution
of the history, and missed it. Like the `prompt` and interactive
commands (which `list` could be but is not when we run it) we need to
check for this exact `list` command and run it under the debugger.
Moreover, we also weren't locking the `debugInfoHandle`, nor were we
correctly checking if `scriptListingLines` was empty (it was never
null), and our shortcut to skip allocation was broken. Actually we can't
skip allocation, but we can at least skip superfluous conversions.1 parent 9e19755 commit 0fcb641
File tree
2 files changed
+27
-13
lines changed- src/PowerShellEditorServices/Services
- DebugAdapter
- PowerShell/Execution
2 files changed
+27
-13
lines changedLines changed: 16 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
930 | 930 | | |
931 | 931 | | |
932 | 932 | | |
933 | | - | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
934 | 939 | | |
935 | | - | |
936 | | - | |
937 | | - | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
938 | 949 | | |
939 | | - | |
| 950 | + | |
940 | 951 | | |
941 | 952 | | |
942 | 953 | | |
| |||
Lines changed: 11 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
77 | 80 | | |
78 | | - | |
| 81 | + | |
79 | 82 | | |
80 | 83 | | |
81 | 84 | | |
| |||
87 | 90 | | |
88 | 91 | | |
89 | 92 | | |
90 | | - | |
| 93 | + | |
91 | 94 | | |
92 | 95 | | |
93 | 96 | | |
| |||
96 | 99 | | |
97 | 100 | | |
98 | 101 | | |
99 | | - | |
| 102 | + | |
| 103 | + | |
100 | 104 | | |
101 | 105 | | |
102 | 106 | | |
| |||
301 | 305 | | |
302 | 306 | | |
303 | 307 | | |
304 | | - | |
305 | | - | |
306 | | - | |
| 308 | + | |
| 309 | + | |
307 | 310 | | |
308 | | - | |
| 311 | + | |
309 | 312 | | |
310 | 313 | | |
311 | 314 | | |
| |||
0 commit comments