tools/symsrc/source_index.py
def WriteSourceStream(pdb_filename, data, toolchain_dir):
  """Write the contents of the source information stream to a PDB."""
  # Write out the data to a temporary filename that we can pass to pdbstr.
  (f, fname) = tempfile.mkstemp()
  f = os.fdopen(f, "wb")
  f.write(data.encode('utf-8'))
  f.close()

  srctool = subprocess.Popen([FindSrcSrvFile('pdbstr.exe', toolchain_dir),
                              '-w', '-s:srcsrv',
                              '-i:%s' % fname,
                              '-p:%s' % pdb_filename],
                             stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  data, _ = srctool.communicate()
  data = data.decode('utf-8')

  if ((srctool.returncode != 0 and srctool.returncode != -1) or
      data.startswith("pdbstr: ")):
    raise Exception("pdbstr failed: " + data)

  os.unlink(fname)
Write the contents of the source information stream to a PDB.
Write the contents of the source information stream to a PDB.
Write the contents of the source information stream to a PDB .
def WriteSourceStream(pdb_filename, data, toolchain_dir):
  (f, fname) = tempfile.mkstemp()
  f = os.fdopen(f, "wb")
  f.write(data.encode('utf-8'))
  f.close()
  srctool = subprocess.Popen([FindSrcSrvFile('pdbstr.exe', toolchain_dir),
                              '-w', '-s:srcsrv',
                              '-i:%s' % fname,
                              '-p:%s' % pdb_filename],
                             stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  data, _ = srctool.communicate()
  data = data.decode('utf-8')
  if ((srctool.returncode != 0 and srctool.returncode != -1) or
      data.startswith("pdbstr: ")):
    raise Exception("pdbstr failed: " + data)
  os.unlink(fname)
def WriteSourceStream ( pdb_filename , data , toolchain_dir ) : ( f , fname ) = tempfile . mkstemp ( ) f = os . fdopen ( f , "wb" ) f . write ( data . encode ( 'utf-8' ) ) f . close ( ) srctool = subprocess . Popen ( [ FindSrcSrvFile ( 'pdbstr.exe' , toolchain_dir ) , '-w' , '-s:srcsrv' , '-i:%s' % fname , '-p:%s' % pdb_filename ] , stdout = subprocess . PIPE , stderr = subprocess . PIPE ) data , _ = srctool . communicate ( ) data = data . decode ( 'utf-8' ) if ( ( srctool . returncode != 0 and srctool . returncode != - 1 ) or data . startswith ( "pdbstr: " ) ) : raise Exception ( "pdbstr failed: " + data ) os . unlink ( fname )
Write the contents of the source information stream to a PDB.
Write the contents of the source information stream to a PDB .
"""Write the contents of the source information stream to a PDB.""" # Write out the data to a temporary filename that we can pass to pdbstr.
pdb_filename
data
toolchain_dir