tools/symsrc/source_index.py
def ReadSourceStream(pdb_filename, toolchain_dir):
  """Read the contents of the source information stream from a PDB."""
  pdbstr = subprocess.Popen([FindSrcSrvFile('pdbstr.exe', toolchain_dir),
                              '-r', '-s:srcsrv',
                              '-p:%s' % pdb_filename],
                             stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  data, _ = pdbstr.communicate()
  data = data.decode('utf-8')

  # Old version of pdbstr.exe return -1 when the source requested stream is
  # missing, while more recent ones return 1, use |abs| to workaround this.
  if (((pdbstr.returncode != 0 and abs(pdbstr.returncode) != 1) or
      data.startswith("pdbstr: "))):
    raise Exception("pdbstr failed: " + data)
  return data
Read the contents of the source information stream from a PDB.
Read the contents of the source information stream from a PDB.
Read the contents of the source information stream from a PDB .
def ReadSourceStream(pdb_filename, toolchain_dir):
  pdbstr = subprocess.Popen([FindSrcSrvFile('pdbstr.exe', toolchain_dir),
                              '-r', '-s:srcsrv',
                              '-p:%s' % pdb_filename],
                             stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  data, _ = pdbstr.communicate()
  data = data.decode('utf-8')
  if (((pdbstr.returncode != 0 and abs(pdbstr.returncode) != 1) or
      data.startswith("pdbstr: "))):
    raise Exception("pdbstr failed: " + data)
  return data
def ReadSourceStream ( pdb_filename , toolchain_dir ) : pdbstr = subprocess . Popen ( [ FindSrcSrvFile ( 'pdbstr.exe' , toolchain_dir ) , '-r' , '-s:srcsrv' , '-p:%s' % pdb_filename ] , stdout = subprocess . PIPE , stderr = subprocess . PIPE ) data , _ = pdbstr . communicate ( ) data = data . decode ( 'utf-8' ) if ( ( ( pdbstr . returncode != 0 and abs ( pdbstr . returncode ) != 1 ) or data . startswith ( "pdbstr: " ) ) ) : raise Exception ( "pdbstr failed: " + data ) return data
Read the contents of the source information stream from a PDB.
Read the contents of the source information stream from a PDB .
"""Read the contents of the source information stream from a PDB.""" # Old version of pdbstr.exe return -1 when the source requested stream is # missing, while more recent ones return 1, use |abs| to workaround this.
pdb_filename
toolchain_dir