@@ -591,6 +591,7 @@ def request_attach(
591
591
attachCommands = None ,
592
592
terminateCommands = None ,
593
593
coreFile = None ,
594
+ stopOnAttach = True ,
594
595
postRunCommands = None ,
595
596
sourceMap = None ,
596
597
gdbRemotePort = None ,
@@ -620,6 +621,8 @@ def request_attach(
620
621
args_dict ["attachCommands" ] = attachCommands
621
622
if coreFile :
622
623
args_dict ["coreFile" ] = coreFile
624
+ if stopOnAttach :
625
+ args_dict ["stopOnEntry" ] = stopOnAttach
623
626
if postRunCommands :
624
627
args_dict ["postRunCommands" ] = postRunCommands
625
628
if sourceMap :
@@ -666,10 +669,6 @@ def request_configurationDone(self):
666
669
response = self .send_recv (command_dict )
667
670
if response :
668
671
self .configuration_done_sent = True
669
- # Client requests the baseline of currently existing threads after
670
- # a successful launch or attach.
671
- # Kick off the threads request that follows
672
- self .request_threads ()
673
672
return response
674
673
675
674
def _process_stopped (self ):
@@ -1325,6 +1324,26 @@ def attach_options_specified(options):
1325
1324
1326
1325
def run_vscode (dbg , args , options ):
1327
1326
dbg .request_initialize (options .sourceInitFile )
1327
+
1328
+ if options .sourceBreakpoints :
1329
+ source_to_lines = {}
1330
+ for file_line in options .sourceBreakpoints :
1331
+ (path , line ) = file_line .split (":" )
1332
+ if len (path ) == 0 or len (line ) == 0 :
1333
+ print ('error: invalid source with line "%s"' % (file_line ))
1334
+
1335
+ else :
1336
+ if path in source_to_lines :
1337
+ source_to_lines [path ].append (int (line ))
1338
+ else :
1339
+ source_to_lines [path ] = [int (line )]
1340
+ for source in source_to_lines :
1341
+ dbg .request_setBreakpoints (source , source_to_lines [source ])
1342
+ if options .funcBreakpoints :
1343
+ dbg .request_setFunctionBreakpoints (options .funcBreakpoints )
1344
+
1345
+ dbg .request_configurationDone ()
1346
+
1328
1347
if attach_options_specified (options ):
1329
1348
response = dbg .request_attach (
1330
1349
program = options .program ,
@@ -1353,23 +1372,6 @@ def run_vscode(dbg, args, options):
1353
1372
)
1354
1373
1355
1374
if response ["success" ]:
1356
- if options .sourceBreakpoints :
1357
- source_to_lines = {}
1358
- for file_line in options .sourceBreakpoints :
1359
- (path , line ) = file_line .split (":" )
1360
- if len (path ) == 0 or len (line ) == 0 :
1361
- print ('error: invalid source with line "%s"' % (file_line ))
1362
-
1363
- else :
1364
- if path in source_to_lines :
1365
- source_to_lines [path ].append (int (line ))
1366
- else :
1367
- source_to_lines [path ] = [int (line )]
1368
- for source in source_to_lines :
1369
- dbg .request_setBreakpoints (source , source_to_lines [source ])
1370
- if options .funcBreakpoints :
1371
- dbg .request_setFunctionBreakpoints (options .funcBreakpoints )
1372
- dbg .request_configurationDone ()
1373
1375
dbg .wait_for_stopped ()
1374
1376
else :
1375
1377
if "message" in response :
0 commit comments