Correctly handle the 'continue' response when continuing a specific thread

This commit is contained in:
Ben Jackson 2020-11-21 18:12:34 +00:00
commit 82307ff1ba
2 changed files with 17 additions and 7 deletions

View file

@ -477,8 +477,13 @@ class DebugSession( object ):
utils.UserMessage( 'No current thread', persist = True )
return
def handler( *_ ):
self._stackTraceView.OnContinued( { 'threadId': threadId } )
def handler( msg ):
self._stackTraceView.OnContinued( {
'threadId': threadId,
'allThreadsContinued': ( msg.get( 'body' ) or {} ).get(
'allThreadsContinued',
True )
} )
self._codeView.SetCurrentFrame( None )
self._connection.DoRequest( handler, {

View file

@ -192,14 +192,15 @@ class StackTraceView( object ):
self.LoadThreads( *self._pending_thread_request )
return
self._requesting_threads = StackTraceView.ThreadRequestState.NO
self._pending_thread_request = None
if not ( message.get( 'body' ) or {} ).get( 'threads' ):
# This is a protocol error. It is required to return at least one!
utils.UserMessage( 'Protocol error: Server returned no threads',
persist = False,
error = True )
self._requesting_threads = StackTraceView.ThreadRequestState.NO
self._pending_thread_request = None
return
existing_threads = self._threads[ : ]
self._threads.clear()
@ -367,14 +368,18 @@ class StackTraceView( object ):
return do_jump()
def PauseContinueThread( self ):
thread = self._GetSelectedThread()
if thread is None:
utils.UserMessage( 'No thread selected' )
elif thread.state == Thread.PAUSED:
self._session._connection.DoRequest(
lambda *_: self.OnContinued( { 'threadId': thread.id } ),
lambda msg: self.OnContinued( {
'threadId': thread.id,
'allThreadsContinued': ( msg.get( 'body' ) or {} ).get(
'allThreadsContinued',
True )
} ),
{
'command': 'continue',
'arguments': {