File tree Expand file tree Collapse file tree 3 files changed +12
-12
lines changed Expand file tree Collapse file tree 3 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -572,6 +572,11 @@ export class GDBTargetDebugSession extends GDBDebugSession {
572572 }
573573 }
574574
575+ // Send GDB commands before attaching to target
576+ await this . executeOrAbort ( this . gdb . sendCommands . bind ( this . gdb ) ) (
577+ args . initCommands
578+ ) ;
579+
575580 await this . setSessionState ( SessionState . GDB_READY ) ;
576581
577582 // Connect to remote server
@@ -620,11 +625,6 @@ export class GDBTargetDebugSession extends GDBDebugSession {
620625
621626 await this . setSessionState ( SessionState . CONNECTED ) ;
622627
623- // Initialize debug target
624- await this . executeOrAbort ( this . gdb . sendCommands . bind ( this . gdb ) ) (
625- args . initCommands
626- ) ;
627-
628628 // Initialize UART
629629 if ( target . uart !== undefined ) {
630630 this . initializeUARTConnection ( target . uart , target . host ) ;
Original file line number Diff line number Diff line change @@ -339,6 +339,8 @@ export abstract class GDBDebugSessionBase extends LoggingDebugSession {
339339 }
340340 await this . gdb . sendEnablePrettyPrint ( ) ;
341341
342+ await this . gdb . sendCommands ( args . initCommands ) ;
343+
342344 if ( request === 'attach' ) {
343345 this . isAttach = true ;
344346 const attachArgs = args as AttachRequestArguments ;
@@ -350,8 +352,6 @@ export abstract class GDBDebugSessionBase extends LoggingDebugSession {
350352 ) ;
351353 }
352354
353- await this . gdb . sendCommands ( args . initCommands ) ;
354-
355355 if ( request === 'launch' ) {
356356 const launchArgs = args as LaunchRequestArguments ;
357357 if ( launchArgs . arguments ) {
Original file line number Diff line number Diff line change @@ -421,6 +421,11 @@ export class GDBTargetDebugSession extends GDBDebugSession {
421421 }
422422 }
423423
424+ // Send GDB commands before attaching to target
425+ await this . executeOrAbort ( this . gdb . sendCommands . bind ( this . gdb ) ) (
426+ args . initCommands
427+ ) ;
428+
424429 await this . setSessionState ( SessionState . GDB_READY ) ;
425430
426431 // Connect to remote server
@@ -469,11 +474,6 @@ export class GDBTargetDebugSession extends GDBDebugSession {
469474
470475 await this . setSessionState ( SessionState . CONNECTED ) ;
471476
472- // Initialize debug target
473- await this . executeOrAbort ( this . gdb . sendCommands . bind ( this . gdb ) ) (
474- args . initCommands
475- ) ;
476-
477477 // Load additional code/symbols
478478 if ( args . imageAndSymbols ) {
479479 if ( args . imageAndSymbols . imageFileName ) {
You can’t perform that action at this time.
0 commit comments