@@ -359,7 +359,6 @@ def fini_enclave_debug(self):
359359 # Delete the dumped enclave if any
360360 global DUMPED_ENCLAVE
361361 if self .enclave_path in DUMPED_ENCLAVE :
362- print ("Free-ing pointer {0}" .format (DUMPED_ENCLAVE [self .enclave_path ]))
363362 gdb .execute ("call (void)free({0})" .format (DUMPED_ENCLAVE [self .enclave_path ]))
364363 os .remove (self .enclave_path )
365364 del DUMPED_ENCLAVE [self .enclave_path ]
@@ -396,7 +395,7 @@ def retrieve_enclave_info(info_addr = 0):
396395 if name_str == None :
397396 return None
398397 fmt = str (info_tuple [4 ]) + 's'
399- enclave_path = struct .unpack_from (fmt , name_str )[0 ].decode (encoding = 'UTF-8' )
398+ enclave_path = struct .unpack_from (fmt , name_str )[0 ].decode (encoding = 'UTF-8' )
400399 # get the stack addr list
401400 stack_addr_list = []
402401 tcs_addr_list = []
@@ -706,12 +705,11 @@ def __init__(self):
706705 def stop (self ):
707706 bp_in_urts = is_bp_in_urts ()
708707 if bp_in_urts == True :
709- print ("_create_enclave_from_buffer_ex" )
710708 # Get se_file_t pointer (4th parameter)
711709 file_addr = gdb .parse_and_eval ("$rcx" )
712710 file_str = read_from_memory (file_addr , 8 + 2 * 4 )
713711 file_tuple = struct .unpack_from ("QII" , file_str )
714- print ( "File: " + str ( file_tuple [ 1 ]))
712+
715713 if file_tuple [1 ] == 0 :
716714 # If it is null, then it does not have a file. So we dump the buffer
717715
@@ -723,24 +721,20 @@ def stop(self):
723721 f = open (dump_name , "wb" )
724722 f .write (bytearray (enclave_bin ))
725723 f .close ()
726- print ("Done dumping" )
727724
728725 # patch the file to malloc'ed buffer
729726 str_filepath_buf = gdb .execute ("call (void*)malloc({0})" .format (len (dump_name ) + 1 ), False , True )
730727 str_filepath_buf = int (re .search (r"0x[0-9a-f]+" , str_filepath_buf ).group (), 16 )
731- print ("Got malloc {0}" .format (str_filepath_buf ))
732728 filepath_bytes = bytearray ()
733729 filepath_bytes .extend (map (ord , dump_name ))
734730 filepath_bytes .extend (bytes (0 ))
735731 write_to_memory (str_filepath_buf , filepath_bytes )
736- print ("Done writing filename" )
737732 write_to_memory (file_addr , struct .pack ('QII' , str_filepath_buf , len (dump_name ), 0 ))
738733
739734 # Store the malloc-ed pointer
740735 global DUMPED_ENCLAVE
741736 DUMPED_ENCLAVE [dump_name ] = str_filepath_buf
742737
743- print ("Done patching" )
744738 return False
745739
746740def sgx_debugger_init ():
0 commit comments