@@ -133,6 +133,10 @@ def __init__(self, debug_config=None):
133
133
self .scratchpad = comms .ScratchPad (self )
134
134
"""The ScratchPad object to talk to the debuggee."""
135
135
136
+ self .start_command = None
137
+ """Set to either "launch" or "attach" just before the corresponding request is sent.
138
+ """
139
+
136
140
self .start_request = None
137
141
"""The "launch" or "attach" request that started executing code in this session.
138
142
"""
@@ -494,8 +498,12 @@ def send_request(self, command, arguments=None, proceed=True):
494
498
if self .timeline .is_frozen and proceed :
495
499
self .proceed ()
496
500
501
+ if command in ("launch" , "attach" ):
502
+ self .start_command = command
503
+
497
504
message = self .channel .send_request (command , arguments )
498
505
request = self .timeline .record_request (message )
506
+
499
507
if command in ("launch" , "attach" ):
500
508
self .start_request = request
501
509
@@ -539,10 +547,7 @@ def _process_event(self, event):
539
547
sockets .remove (socket )
540
548
assert not sockets , f"Unexpected sockets reported by adapter: { sockets } "
541
549
542
- if (
543
- self .start_request is not None
544
- and self .start_request .command == "launch"
545
- ):
550
+ if self .start_command == "launch" :
546
551
if "launcher" in self .expected_adapter_sockets :
547
552
# If adapter has just reported the launcher socket, it shouldn't be
548
553
# reported thereafter.
0 commit comments