Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions src/desktop/GDBTargetDebugSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,15 @@ export class GDBTargetDebugSession extends GDBDebugSession {
await this.setupCommonLoggerAndBackends(args);
this.initializeSessionArguments(args);

this.isAttach = true;
if (request === 'launch') {
const launchArgs = args as TargetLaunchRequestArguments;
await this.startGDBServer(launchArgs);
if (args.target?.type !== 'extended-remote') {
const launchArgs = args as TargetLaunchRequestArguments;
await this.startGDBServer(launchArgs);
} else
this.isAttach = false;
}
await this.startGDBAndAttachToTarget(response, args);
await this.startGDBAndConnectToGDBSERVER(response, args);
}

protected async launchRequest(
Expand Down Expand Up @@ -632,7 +636,7 @@ export class GDBTargetDebugSession extends GDBDebugSession {
}
}

protected async startGDBAndAttachToTarget(
protected async startGDBAndConnectToGDBSERVER(
response: DebugProtocol.AttachResponse | DebugProtocol.LaunchResponse,
args: TargetAttachRequestArguments
): Promise<void> {
Expand All @@ -641,7 +645,6 @@ export class GDBTargetDebugSession extends GDBDebugSession {
}
const target = args.target;
try {
this.isAttach = true;
// Start GDB process
this.logGDBRemote(`spawn GDB\n`);
await this.spawn(args);
Expand Down