@@ -803,9 +803,13 @@ def _DetectSessionFile( self,
803803 return None
804804
805805
806- @CurrentSession ()
807- @IfConnected ()
808- def StepOver ( self , ** kwargs ):
806+ def _CurrentSteppingGranularity ( self ):
807+ if self ._disassemblyView and self ._disassemblyView .IsCurrent ():
808+ return 'instruction'
809+ return 'statement'
810+
811+
812+ def _DoStep ( self , kind , ** kwargs ):
809813 threadId = self ._stackTraceView .GetCurrentThreadId ()
810814 if threadId is None :
811815 return
@@ -818,59 +822,28 @@ def handler( *_ ):
818822 'threadId' : threadId ,
819823 'granularity' : self ._CurrentSteppingGranularity (),
820824 }
825+
821826 arguments .update ( kwargs )
822827 self ._connection .DoRequest ( handler , {
823- 'command' : 'next' ,
828+ 'command' : kind ,
824829 'arguments' : arguments ,
825830 } )
826831
832+
827833 @CurrentSession ()
828834 @IfConnected ()
829- def StepInto ( self , ** kwargs ):
830- threadId = self ._stackTraceView .GetCurrentThreadId ()
831- if threadId is None :
832- return
833-
834- def handler ( * _ ):
835- self ._stackTraceView .OnContinued ( self , { 'threadId' : threadId } )
836- self .ClearCurrentPC ()
835+ def StepOver ( self , ** kwargs ):
836+ self ._DoStep ( 'next' , ** kwargs )
837837
838- arguments = {
839- 'threadId' : threadId ,
840- 'granularity' : self ._CurrentSteppingGranularity (),
841- }
842- arguments .update ( kwargs )
843- self ._connection .DoRequest ( handler , {
844- 'command' : 'stepIn' ,
845- 'arguments' : arguments ,
846- } )
838+ @CurrentSession ()
839+ @IfConnected ()
840+ def StepInto ( self , ** kwargs ):
841+ self ._DoStep ( 'stepIn' , ** kwargs )
847842
848843 @CurrentSession ()
849844 @IfConnected ()
850845 def StepOut ( self , ** kwargs ):
851- threadId = self ._stackTraceView .GetCurrentThreadId ()
852- if threadId is None :
853- return
854-
855- def handler ( * _ ):
856- self ._stackTraceView .OnContinued ( self , { 'threadId' : threadId } )
857- self .ClearCurrentPC ()
858-
859- arguments = {
860- 'threadId' : threadId ,
861- 'granularity' : self ._CurrentSteppingGranularity (),
862- }
863- arguments .update ( kwargs )
864- self ._connection .DoRequest ( handler , {
865- 'command' : 'stepOut' ,
866- 'arguments' : arguments ,
867- } )
868-
869- def _CurrentSteppingGranularity ( self ):
870- if self ._disassemblyView and self ._disassemblyView .IsCurrent ():
871- return 'instruction'
872-
873- return 'statement'
846+ self ._DoStep ( 'stepOut' , ** kwargs )
874847
875848 @CurrentSession ()
876849 def Continue ( self ):
@@ -884,6 +857,8 @@ def Continue( self ):
884857 return
885858
886859 def handler ( msg ):
860+ # By deafult, Continue is assumed to continue all threads, unless it
861+ # specifically says otherwise
887862 self ._stackTraceView .OnContinued ( self , {
888863 'threadId' : threadId ,
889864 'allThreadsContinued' : ( msg .get ( 'body' ) or {} ).get (
0 commit comments