Skip to content

Commit 4925cd7

Browse files
authored
Always stop the debug target process when attaching (#1415)
1 parent bc2c136 commit 4925cd7

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

package.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1706,12 +1706,7 @@
17061706
"number",
17071707
"string"
17081708
],
1709-
"description": "The CSP debug ID to use to identify the target process. If provided, 'processId' and 'stopOnEntry' are ignored."
1710-
},
1711-
"stopOnEntry": {
1712-
"type": "boolean",
1713-
"description": "Automatically stop target after attach. If not specified, target does not stop.",
1714-
"default": false
1709+
"description": "The CSP debug ID to use to identify the target process. If provided, 'processId' is ignored."
17151710
}
17161711
}
17171712
}

src/debug/debugSession.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,6 @@ export class ObjectScriptDebugSession extends LoggingDebugSession {
106106
/** If we're stopped at a breakpoint. */
107107
private _break = false;
108108

109-
/** If we should automatically stop target */
110-
private _stopOnEntry: boolean;
111-
112109
/** If this is a `launch` session */
113110
private _isLaunch = false;
114111

@@ -228,7 +225,7 @@ export class ObjectScriptDebugSession extends LoggingDebugSession {
228225

229226
protected async launchRequest(response: DebugProtocol.LaunchResponse, args: LaunchRequestArguments): Promise<void> {
230227
try {
231-
this._debugTargetSet = this._stopOnEntry = false;
228+
this._debugTargetSet = false;
232229
this._isLaunch = true;
233230
const debugTarget = `${this._namespace}:${args.program}`;
234231
await this._connection.sendFeatureSetCommand("debug_target", debugTarget, true);
@@ -243,7 +240,6 @@ export class ObjectScriptDebugSession extends LoggingDebugSession {
243240
protected async attachRequest(response: DebugProtocol.AttachResponse, args: AttachRequestArguments): Promise<void> {
244241
try {
245242
this._debugTargetSet = this._isLaunch = false;
246-
this._stopOnEntry = args.stopOnEntry;
247243
const debugTarget = args.cspDebugId != undefined ? `CSPDEBUG:${args.cspDebugId}` : `PID:${args.processId}`;
248244
await this._connection.sendFeatureSetCommand("debug_target", debugTarget);
249245
if (args.cspDebugId != undefined) {
@@ -258,7 +254,6 @@ export class ObjectScriptDebugSession extends LoggingDebugSession {
258254
await this._connection.sendBreakpointSetCommand(new xdebug.Watchpoint("ok", this._cspWatchpointCondition));
259255
this._isCsp = true;
260256
}
261-
this._stopOnEntry = false;
262257
this.sendResponse(response);
263258
} else {
264259
this._isCsp = false;
@@ -291,11 +286,9 @@ export class ObjectScriptDebugSession extends LoggingDebugSession {
291286
args: DebugProtocol.ConfigurationDoneArguments
292287
): Promise<void> {
293288
if (!this._isLaunch && !this._isCsp) {
294-
// The debug agent ignores the first run command for non-CSP attaches,
295-
// so send one right away, regardless of the stopOnEntry value
289+
// The debug agent ignores the first run command
290+
// for non-CSP attaches, so send one right away
296291
await this._connection.sendRunCommand();
297-
}
298-
if (this._stopOnEntry && !this._isLaunch && !this._isCsp) {
299292
// Tell VS Code that we're stopped
300293
this.sendResponse(response);
301294
const event: DebugProtocol.StoppedEvent = new StoppedEvent("entry", this._connection.id);

0 commit comments

Comments
 (0)