#NEWLINE# def resume( self , data ) : #NEWLINE# #INDENT# addr = self . _get_resume_step_addr ( data ) #NEWLINE# self . target . resume ( ) #NEWLINE# logging . debug ( 'target resumed' ) #NEWLINE# val = '' #NEWLINE# while True : #NEWLINE# #INDENT# if self . shutdown_event . isSet ( ) : #NEWLINE# #INDENT# self . packet_io . interrupt_event . clear ( ) #NEWLINE# return self . createRSPPacket ( val ) #NEWLINE# #UNINDENT# if self . packet_io . interrupt_event . wait ( 0.01 ) : #NEWLINE# #INDENT# logging . debug ( 'receive CTRL-C' ) #NEWLINE# self . packet_io . interrupt_event . clear ( ) #NEWLINE# self . target . halt ( ) #NEWLINE# val = self . target . getTResponse ( forceSignal = signals . SIGINT ) #NEWLINE# break #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# if ( self . target . getState ( ) == Target . TARGET_HALTED ) : #NEWLINE# #INDENT# if val . enable_semihosting : #NEWLINE# #INDENT# was_semihost = self . semihost . check_and_handle_semihost_request ( ) #NEWLINE# if was_semihost : #NEWLINE# #INDENT# self . target . resume ( ) #NEWLINE# continue #NEWLINE# #UNINDENT# #UNINDENT# logging . debug ( 'state halted' ) #NEWLINE# val = self . target . getTResponse ( ) #NEWLINE# break #NEWLINE# #UNINDENT# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# self . target . halt ( ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# traceback . print_exc ( ) #NEWLINE# logging . debug ( 'Target is unavailable temporarily.' ) #NEWLINE# val = ( 'S%02x' % self . target . getSignalValue ( ) ) #NEWLINE# break #NEWLINE# #UNINDENT# #UNINDENT# return self . createRSPPacket ( val )