File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -181,6 +181,9 @@ def cb_exited_handler(event):
181181
182182def cb_new_thread_handler (event ):
183183 thread = event .inferior_thread
184+ if thread is None :
185+ return
186+
184187 if isinstance (thread , gdb .Inferior ):
185188 cb_notify_event ({
186189 'inferior' : thread .num ,
@@ -197,7 +200,9 @@ def cb_new_thread_handler(event):
197200
198201def cb_stop_handler (event ):
199202 thread = event .inferior_thread
200- gdb .write ('stop_handler: %s' % type (thread ))
203+ if thread is None :
204+ return
205+
201206 if hasattr (event , 'breakpoints' ):
202207 reason = [(bp .thread , bp .number , bp .type , bp .location )
203208 for bp in event .breakpoints ]
@@ -224,11 +229,20 @@ def cb_stop_handler(event):
224229
225230def cb_cont_handler (event ):
226231 thread = event .inferior_thread
227- cb_notify_event ({
228- 'inferior' : thread .inferior .num ,
229- 'thread' : thread .num ,
230- 'state' : 'running' ,
231- })
232+ if thread is None :
233+ return
234+
235+ if isinstance (thread , gdb .Inferior ):
236+ cb_notify_event ({
237+ 'inferior' : thread .num ,
238+ 'state' : 'running'
239+ })
240+ else :
241+ cb_notify_event ({
242+ 'inferior' : thread .inferior .num ,
243+ 'thread' : thread .num ,
244+ 'state' : 'running' ,
245+ })
232246
233247
234248def cb_notify_event (args ):
You can’t perform that action at this time.
0 commit comments