Title: Updating breakpoints in a nested debugger or in a job debugger results in breakpoints with the same id in the parent being overwritten · Issue #10167 · PowerShell/PowerShell · GitHub
Open Graph Title: Updating breakpoints in a nested debugger or in a job debugger results in breakpoints with the same id in the parent being overwritten · Issue #10167 · PowerShell/PowerShell
X Title: Updating breakpoints in a nested debugger or in a job debugger results in breakpoints with the same id in the parent being overwritten · Issue #10167 · PowerShell/PowerShell
Description: This issue is reproducible in PS 5.1 and 6.2.1 (and presumably 7 preview since the buggy code is still there, although I didn't test that version specifically yet). If you debug a job, you enter a nested debugging session. From within th...
Open Graph Description: This issue is reproducible in PS 5.1 and 6.2.1 (and presumably 7 preview since the buggy code is still there, although I didn't test that version specifically yet). If you debug a job, you enter a ...
X Description: This issue is reproducible in PS 5.1 and 6.2.1 (and presumably 7 preview since the buggy code is still there, although I didn't test that version specifically yet). If you debug a job, you ente...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/10167
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Updating breakpoints in a nested debugger or in a job debugger results in breakpoints with the same id in the parent being overwritten","articleBody":"This issue is reproducible in PS 5.1 and 6.2.1 (and presumably 7 preview since the buggy code is still there, although I didn't test that version specifically yet).\r\n\r\nIf you debug a job, you enter a nested debugging session. From within that session, you can set, enable, disable, or remove breakpoints in the job debugger. Setting or removing breakpoints will result in the same changes made to any breakpoints with the corresponding IDs that were set in the parent debugger.\r\n\r\n# Steps to reproduce\r\n\r\n```powershell\r\n# Create a job that does some stuff\r\n$job = Start-Job -ScriptBlock {\r\n 1..1000 | ForEach-Object {\r\n Start-Sleep -Seconds 1\r\n $_\r\n Write-Error 'boo'\r\n Write-Verbose 'Verbose' -Verbose\r\n $DebugPreference = 'Continue'\r\n Write-Debug 'Debug'\r\n Write-Warning 'Warning'\r\n }\r\n}\r\n\r\n# Set some local breakpoints, and remove one\r\n$bp1 = Set-PSBreakpoint -Command Write-Verbose\r\n$bp2 = Set-PSBreakpoint -Command Get-Date\r\n$bp3 = Set-PSBreakpoint -Variable Home -Mode Read -Action {Write-Host 'Read var'}\r\nRemove-PSBreakpoint -Breakpoint $bp2\r\n\r\n# Have a look at your local breakpoints (these do not impact the running job).\r\nGet-PSBreakpoint\r\n\r\n# Wait for the job and its child job to enter a running state\r\nwhile ($job.State -ne 'Running' -or $job.ChildJobs[0].State -ne 'Running') {\r\n Start-Sleep -Milliseconds 250\r\n}\r\n\r\n# Debug the job\r\nDebug-Job -Job $job\r\n```\r\n\r\nAt this point you will be in the job debugger. From here, run the following commands:\r\n\r\n```powershell\r\n# Create a bunch of breakpoints\r\n$jbp1 = Set-PSBreakpoint -Variable DebugPreference\r\n$jbp2 = Set-PSBreakpoint -Command Write-Debug\r\n$jbp3 = Set-PSBreakpoint -Command Start-Sleep\r\n\r\n# Have a look at your job breakpoints\r\nGet-PSBreakpoint\r\n\r\n# Disable the second breakpoint\r\nDisable-PSBreakpoint -Breakpoint $jbp2\r\n\r\n# Remove the last breakpoint\r\nRemove-PSBreakpoint -Breakpoint $jbp3\r\n\r\n# Detach your debugger\r\nd\r\n```\r\n\r\nNow you're back in your main runspace, outside of the job. Have a look at your breakpoints by invoking the following command:\r\n\r\n```powershell\r\nGet-PSBreakpoint\r\n```\r\n\r\nThis output shows that:\r\n- breakpoint 0 was overwritten with a completely different breakpoint (the first one that was set in the job)\r\n- breakpoint 1 was re-created (remember that it was removed before debugging the job), and it's not the same as it was before (note that it is not disabled in the parent even though we disabled it in the job debugger because the code behind that simply disables the breakpoint object again, which is already disabled).\r\n- breakpoint 2 was deleted (remember that it was removed from within the job debugging session)\r\n\r\n# Expected behavior\r\n\r\n```none\r\n ID Script Line Command Variable Action\r\n -- ------ ---- ------- -------- ------\r\n 0 Write-Verbose\r\n 2 Home Write-Host 'Read var'\r\n```\r\n\r\n# Actual behavior\r\n\r\n```none\r\n ID Script Line Command Variable Action\r\n -- ------ ---- ------- -------- ------\r\n 0 DebugPreference\r\n 1 Write-Debug\r\n```\r\n\r\n# Environment data\r\n\r\n```none\r\nName Value\r\n---- -----\r\nPSVersion 6.2.1\r\nPSEdition Core\r\nGitCommitId 6.2.1\r\nOS Microsoft Windows 10.0.17763\r\nPlatform Win32NT\r\nPSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}\r\nPSRemotingProtocolVersion 2.3\r\nSerializationVersion 1.1.0.1\r\nWSManStackVersion 3.0\r\n```\r\n","author":{"url":"https://github.com/KirkMunro","@type":"Person","name":"KirkMunro"},"datePublished":"2019-07-16T00:48:24Z","url":"https://github.com/PowerShell/PowerShell/issues/10167"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:ba13d1c6-2ca8-109c-2ccc-a8bce7351897 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D3BE:1F8AF4:633AD:85C18:6AFD48D5 |
| html-safe-nonce | 0868053cf15adb02a4ef46f1c890b8d4dc3845b1a2b68dd571fa70ad1a6de2dc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEM0JFOjFGOEFGNDo2MzNBRDo4NUMxODo2QUZENDhENSIsInZpc2l0b3JfaWQiOiI1NjUxMjE3MDU0Mjk1MTg1NDkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 7f934287101e7374bf73cbe489f88049e253e500be1bfdd4bfb7eeb74d50d245 |
| hovercard-subject-tag | issue:468394750 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/10167/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f80f6d5895c3d67dddf23115fa2811922a60d2f1faad8c9f07b1ffb0929d542b/PowerShell/PowerShell/issues/10167 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f80f6d5895c3d67dddf23115fa2811922a60d2f1faad8c9f07b1ffb0929d542b/PowerShell/PowerShell/issues/10167 |
| og:image:alt | This issue is reproducible in PS 5.1 and 6.2.1 (and presumably 7 preview since the buggy code is still there, although I didn't test that version specifically yet). If you debug a job, you enter a ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | KirkMunro |
| hostname | github.com |
| expected-hostname | github.com |
| None | bdbacc25b921224ff0befcb9e629560a1255be51aec9991d6e3f95b5e9151474 |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 556dd37bb0aceffb25724e151b5d858b3265b40b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width