parameters: (binary_name, load_address, address_list)
return_statement: return ret
docstring: For each address, return a pair (file, line num)
docstring_summary: For each address, return a pair (file, line num)
docstring_tokens: For each address return a pair ( file line num )
function: def ResolveAddressesWithinABinary(binary_name, load_address, address_list):
    ''' For each address, return a pair (file, line num) '''
    commands = tempfile.NamedTemporaryFile()
    commands.write('add-symbol-file "%s" %s\n' % (binary_name, load_address))
    for addr in address_list:
      commands.write('info line *%s\n' % addr)
    commands.write('quit\n')
    commands.flush()
    gdb_commandline = 'gdb -batch -x %s 2>/dev/null' % commands.name
    gdb_pipe = os.popen(gdb_commandline)
    result = gdb_pipe.readlines()
  
    address_count = 0
    ret = {}
    for line in result:
      if line.startswith('Line'):
        ret[address_list[address_count]] = _GdbOutputToFileLine(line)
        address_count += 1
      if line.startswith('No line'):
        ret[address_list[address_count]] = (None, None)
        address_count += 1
    gdb_pipe.close()
    commands.close()
    return ret
function_tokens: def ResolveAddressesWithinABinary ( binary_name , load_address , address_list ) : commands = tempfile . NamedTemporaryFile ( ) commands . write ( 'add-symbol-file "%s" %s\n' % ( binary_name , load_address ) ) for addr in address_list : commands . write ( 'info line *%s\n' % addr ) commands . write ( 'quit\n' ) commands . flush ( ) gdb_commandline = 'gdb -batch -x %s 2>/dev/null' % commands . name gdb_pipe = os . popen ( gdb_commandline ) result = gdb_pipe . readlines ( ) address_count = 0 ret = { } for line in result : if line . startswith ( 'Line' ) : ret [ address_list [ address_count ] ] = _GdbOutputToFileLine ( line ) address_count += 1 if line . startswith ( 'No line' ) : ret [ address_list [ address_count ] ] = ( None , None ) address_count += 1 gdb_pipe . close ( ) commands . close ( ) return ret