#NEWLINE# def _trim_disassembly( stdout ) : #NEWLINE# #INDENT# if ( not stdout ) : #NEWLINE# #INDENT# return stdout #NEWLINE# #UNINDENT# start_loc = stdout . find ( 'Dump of assembler code' ) #NEWLINE# end_loc = stdout . find ( 'End of assembler dump.' , start_loc ) #NEWLINE# if ( ( start_loc == ( - 1 ) ) or ( end_loc == ( - 1 ) ) ) : #NEWLINE# #INDENT# return ( '%s\nError trimming assembler dump. start_loc = %d, end_loc = %d' % ( stdout , start_loc , end_loc ) ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# ( a , b ) = stdout [ start_loc : end_loc ] . split ( '\n=>' ) #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# return ( "%s\nError trimming assembler dump. Could not find '=>'" % stdout ) #NEWLINE# #UNINDENT# a = a . splitlines ( ) #NEWLINE# start_loc += len ( a . pop ( 0 ) ) #NEWLINE# return ( '%s\n%s\n=>%s\n%s' % ( stdout [ : a ] , '\n' . join ( a [ ( - 15 ) : ] ) , '\n' . join ( b . splitlines ( ) [ : 15 ] ) , stdout [ end_loc : ] ) )