forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Terminate child processes launched and attached to in multi proc debu…
…gging (#2954) * Multi proc debugging * Terminate child procs when terminating multiproc debugging * Change default flask debug configs * Fix typo * None of the debugger tests are allowed to fail * Fix typos * Incremental changes * Added tests * Telemetry * Allow release PTVSD tests to fail * Add --client flag
- Loading branch information
1 parent
901609b
commit 68f8423
Showing
28 changed files
with
1,240 additions
and
247 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Add support for automatic reloading of flask in the debugger. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Add support for multi process debugging. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
src/client/debugger/extension/hooks/childProcessAttachHandler.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
'use strict'; | ||
|
||
import { inject, injectable } from 'inversify'; | ||
import { DebugSessionCustomEvent } from 'vscode'; | ||
import { swallowExceptions } from '../../../common/utils/decorators'; | ||
import { PTVSDEvents } from './constants'; | ||
import { ChildProcessLaunchData, IChildProcessAttachService, IDebugSessionEventHandlers } from './types'; | ||
|
||
/** | ||
* This class is responsible for automatically attaching the debugger to any | ||
* child processes launched. I.e. this is the classs responsible for multi-proc debugging. | ||
* @export | ||
* @class ChildProcessAttachEventHandler | ||
* @implements {IDebugSessionEventHandlers} | ||
*/ | ||
@injectable() | ||
export class ChildProcessAttachEventHandler implements IDebugSessionEventHandlers { | ||
constructor(@inject(IChildProcessAttachService) private readonly childProcessAttachService: IChildProcessAttachService) { } | ||
|
||
@swallowExceptions('Handle child process launch') | ||
public async handleCustomEvent(event: DebugSessionCustomEvent): Promise<void> { | ||
if (!event || event.event !== PTVSDEvents.ChildProcessLaunched) { | ||
return; | ||
} | ||
const data = event.body! as ChildProcessLaunchData; | ||
await this.childProcessAttachService.attach(data); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
'use strict'; | ||
|
||
export enum PTVSDEvents { | ||
// Event sent by PTVSD when a child process is launched and ready to be attached to for multi-proc debugging. | ||
ChildProcessLaunched = 'ptvsd_subprocess', | ||
|
||
// Event sent by PTVSD when a process is started (identital to the `process` event in debugger protocol). | ||
ProcessLaunched = 'ptvsd_process' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.