def source_gdb_script(script_contents, to_string=False):
 (fd, filename) = tempfile.mkstemp()
 f = os.fdopen(fd, 'w')
 f.write(script_contents)
 f.close()
 gdb.execute(('source %s' % filename), to_string=to_string)
 os.remove(filename)

def source_gdb_script ( script_contents , to_string = False ) : ( fd , filename ) = tempfile . mkstemp ( ) f = os . fdopen ( fd , 'w' ) f . write ( script_contents ) f . close ( ) gdb . execute ( ( 'source %s' % filename ) , to_string = to_string ) os . remove ( filename )
source a gdb script with script_contents passed as a string .