Skip to content
Open
Show file tree
Hide file tree
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
10 changes: 5 additions & 5 deletions src/desktop/GDBTargetDebugSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,11 @@ export class GDBTargetDebugSession extends GDBDebugSession {
}
}

// Send GDB commands before attaching to target
await this.executeOrAbort(this.gdb.sendCommands.bind(this.gdb))(
args.initCommands
);

await this.setSessionState(SessionState.GDB_READY);

// Connect to remote server
Expand Down Expand Up @@ -620,11 +625,6 @@ export class GDBTargetDebugSession extends GDBDebugSession {

await this.setSessionState(SessionState.CONNECTED);

// Initialize debug target
await this.executeOrAbort(this.gdb.sendCommands.bind(this.gdb))(
args.initCommands
);

// Initialize UART
if (target.uart !== undefined) {
this.initializeUARTConnection(target.uart, target.host);
Expand Down
4 changes: 2 additions & 2 deletions src/gdb/GDBDebugSessionBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,8 @@ export abstract class GDBDebugSessionBase extends LoggingDebugSession {
}
await this.gdb.sendEnablePrettyPrint();

await this.gdb.sendCommands(args.initCommands);

if (request === 'attach') {
this.isAttach = true;
const attachArgs = args as AttachRequestArguments;
Expand All @@ -350,8 +352,6 @@ export abstract class GDBDebugSessionBase extends LoggingDebugSession {
);
}

await this.gdb.sendCommands(args.initCommands);

if (request === 'launch') {
const launchArgs = args as LaunchRequestArguments;
if (launchArgs.arguments) {
Expand Down
10 changes: 5 additions & 5 deletions src/web/GDBTargetDebugSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,11 @@ export class GDBTargetDebugSession extends GDBDebugSession {
}
}

// Send GDB commands before attaching to target
await this.executeOrAbort(this.gdb.sendCommands.bind(this.gdb))(
args.initCommands
);

await this.setSessionState(SessionState.GDB_READY);

// Connect to remote server
Expand Down Expand Up @@ -469,11 +474,6 @@ export class GDBTargetDebugSession extends GDBDebugSession {

await this.setSessionState(SessionState.CONNECTED);

// Initialize debug target
await this.executeOrAbort(this.gdb.sendCommands.bind(this.gdb))(
args.initCommands
);

// Load additional code/symbols
if (args.imageAndSymbols) {
if (args.imageAndSymbols.imageFileName) {
Expand Down