#!/bin/env python # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # # Usage: symbolstore.py <params> <dump_syms path> <symbol store path> # <debug info files or dirs> # Runs dump_syms on each debug info file specified on the command line, # then places the resulting symbol file in the proper directory # structure in the symbol store path. Accepts multiple files # on the command line, so can be called as part of a pipe using # find <dir> | xargs symbolstore.pl <dump_syms> <storepath> # But really, you might just want to pass it <dir>. # # Parameters accepted: # -c : Copy debug info files to the same directory structure # as sym files. On Windows, this will also copy # binaries into the symbol store. # -a "<archs>" : Run dump_syms -a <arch> for each space separated # cpu architecture in <archs> (only on OS X) # -s <srcdir> : Use <srcdir> as the top source directory to # generate relative filenames.
import ctypes import errno import functools import os import platform import re import shutil import subprocess import sys import textwrap import time from optparse import OptionParser from pathlib import Path
import buildconfig from mozbuild.generated_sources import (
GENERATED_SOURCE_EXTS,
get_filename_with_digest,
get_s3_region_and_bucket,
) from mozpack import executables from mozpack.copier import FileRegistry from mozpack.manifests import InstallManifest, UnreadableInstallManifest from variables import get_buildid
class VCSFileInfo: """A base class for version-controlled file information. Ensures that the
following attributes are generated only once (successfully):
The attributes are generated by a single call to the GetRoot,
GetRevision, and GetFilename methods. Those methods are explicitly not
implemented here and must be implemented in derived classes."""
def __getattr__(self, name): """__getattr__ is only called for attributes that are not set on self,
so setting self.[attr] will prevent future calls to the GetRoot,
GetRevision, and GetFilename methods. We don't set the values on
failure on the off chance that a future call might succeed."""
if name == "root":
root = self.GetRoot() if root:
self.root = root return root
elif name == "clean_root":
clean_root = self.GetCleanRoot() if clean_root:
self.clean_root = clean_root return clean_root
elif name == "revision":
revision = self.GetRevision() if revision:
self.revision = revision return revision
elif name == "filename":
filename = self.GetFilename() if filename:
self.filename = filename return filename
raise AttributeError
def GetRoot(self): """This method should return the unmodified root for the file or 'None'
on failure.""" raise NotImplementedError
def GetCleanRoot(self): """This method should return the repository root for the file or 'None'
on failure.""" raise NotImplementedError
def GetRevision(self): """This method should return the revision number for the file or 'None'
on failure.""" raise NotImplementedError
def GetFilename(self): """This method should return the repository-specific filename for the
file or'None' on failure.""" raise NotImplementedError
# This regex separates protocol and optional username/password from a url. # For instance, all the following urls will be transformed into # 'foo.com/bar': # # http://foo.com/bar # svn+ssh://user@foo.com/bar # svn+ssh://user:pass@foo.com/bar #
rootRegex = re.compile(r"^\S+?:/+(?:[^\s/]*@)?(\S+)$")
# Look for the default hg path. If MOZ_SOURCE_REPO is set, we # don't bother asking hg.
hg_root = os.environ.get("MOZ_SOURCE_REPO") if hg_root:
root = hg_root else:
root = read_output("hg", "-R", path, "showconfig", "paths.default") ifnot root:
print("Failed to get HG Repo for %s" % path, file=sys.stderr)
cleanroot = None if root:
match = rootRegex.match(root) if match:
cleanroot = match.group(1) if cleanroot.endswith("/"):
cleanroot = cleanroot[:-1] if cleanroot isNone:
print(
textwrap.dedent( """\
Could not determine repo info for %s. This is either not a clone of the web-based
repository, or you have not specified MOZ_SOURCE_REPO, or the clone is corrupt."""
)
% path,
sys.stderr,
)
sys.exit(1)
self.rev = rev
self.root = root
self.cleanroot = cleanroot
def GetFilename(self): if self.revision and self.clean_root: return"hg:%s:%s:%s" % (self.clean_root, self.file, self.revision) return self.file
class GitRepoInfo: """
Info about a local git repository. Does not currently
support discovering info about a git clone, the info must be
provided out-of-band. """
def __init__(self, path, rev, root):
self.path = path
cleanroot = None if root:
match = rootRegex.match(root) if match:
cleanroot = match.group(1) if cleanroot.endswith("/"):
cleanroot = cleanroot[:-1] if cleanroot isNone:
print(
textwrap.dedent( """\
Could not determine repo info for %s (%s). This is either not a clone of a web-based
repository, or you have not specified MOZ_SOURCE_REPO, or the clone is corrupt."""
)
% (path, root),
file=sys.stderr,
)
sys.exit(1)
self.rev = rev
self.cleanroot = cleanroot
def GetFilename(self): if self.revision and self.clean_root: return"git:%s:%s:%s" % (self.clean_root, self.file, self.revision) return self.file
# Utility functions
# A cache of files for which VCS info has already been determined. Used to # prevent extra filesystem activity or process launching.
vcsFileInfoCache = {}
if platform.system() == "Windows":
def realpath(path): """
Normalize a path using `GetFinalPathNameByHandleW` to get the
path with all components in the case they exist in on-disk, so
that making links to a case-sensitive server (hg.mozilla.org) works.
This function also resolves any symlinks in the path. """ # Return the original path if something fails, which can happen for paths that # don't exist on this system (like paths from the CRT).
result = path
ctypes.windll.kernel32.SetErrorMode(ctypes.c_uint(1))
handle = ctypes.windll.kernel32.CreateFileW(
path, # GENERIC_READ 0x80000000, # FILE_SHARE_READ 1, None, # OPEN_EXISTING 3, # FILE_FLAG_BACKUP_SEMANTICS # This is necessary to open # directory handles. 0x02000000, None,
) if handle != -1:
size = ctypes.windll.kernel32.GetFinalPathNameByHandleW(handle, None, 0, 0)
buf = ctypes.create_unicode_buffer(size) if (
ctypes.windll.kernel32.GetFinalPathNameByHandleW(handle, buf, size, 0)
> 0
): # The return value of GetFinalPathNameByHandleW uses the # '\\?\' prefix.
result = buf.value[4:]
ctypes.windll.kernel32.CloseHandle(handle) return result
else: # Just use the os.path version otherwise.
realpath = os.path.realpath
def GetVCSFilenameFromSrcdir(file, srcdir): if srcdir notin Dumper.srcdirRepoInfo: # Not in cache, so find it and cache it if os.path.isdir(os.path.join(srcdir, ".hg")):
git_repo_info = TryGetGitRepoInfoFromHg(srcdir) if git_repo_info:
Dumper.srcdirRepoInfo[srcdir] = git_repo_info else:
Dumper.srcdirRepoInfo[srcdir] = HGRepoInfo(srcdir) else: # Unknown VCS or file is not in a repo. returnNone return Dumper.srcdirRepoInfo[srcdir].GetFileInfo(file)
def GetVCSFilename(file, srcdirs): """Given a full path to a file, and the top source directory,
look for version control information about this file, andreturn
a tuple containing 1) a specially formatted filename that contains the VCS type,
VCS location, relative filename, and revision number, formatted like:
vcs:vcs location:filename:revision For example:
cvs:cvs.mozilla.org/cvsroot:mozilla/browser/app/nsBrowserApp.cpp:1.36 2) the unmodified root information if it exists"""
(path, filename) = os.path.split(file) if path == ""or filename == "": return (file, None)
fileInfo = None
root = "" if file in vcsFileInfoCache: # Already cached this info, use it.
fileInfo = vcsFileInfoCache[file] else: for srcdir in srcdirs: ifnot IsInDir(file, srcdir): continue
fileInfo = GetVCSFilenameFromSrcdir(file, srcdir) if fileInfo:
vcsFileInfoCache[file] = fileInfo break
if fileInfo:
file = fileInfo.filename
root = fileInfo.root
# we want forward slashes on win32 paths return (file.replace("\\", "/"), root)
def validate_install_manifests(install_manifest_args):
args = [] for arg in install_manifest_args:
bits = arg.split(",") if len(bits) != 2: raise ValueError( "Invalid format for --install-manifest: specify manifest,target_dir"
)
manifest_file, destination = [os.path.abspath(b) for b in bits] ifnot os.path.isfile(manifest_file): raise OSError(errno.ENOENT, "Manifest file not found", manifest_file) ifnot os.path.isdir(destination): raise OSError(errno.ENOENT, "Install directory not found", destination) try:
manifest = InstallManifest(manifest_file) except UnreadableInstallManifest: raise OSError(errno.EINVAL, "Error parsing manifest file", manifest_file)
args.append((manifest, destination)) return args
def make_file_mapping(install_manifests):
file_mapping = {} for manifest, destination in install_manifests:
absolute_destination = os.path.abspath(destination)
reg = FileRegistry()
manifest.populate_registry(reg) for dst, src in reg: if hasattr(src, "path"): # Any paths that get compared to source file names need to go through realpath.
abs_dest = realpath(os.path.join(absolute_destination, dst))
file_mapping[abs_dest] = realpath(src.path) return file_mapping
@functools.cache def get_generated_file_s3_path(filename, rel_path, bucket): """Given a filename, return a path formatted similarly to
GetVCSFilename but representing a file available in an s3 bucket.""" with open(filename, "rb") as f:
path = get_filename_with_digest(rel_path, f.read()) return f"s3:{bucket}:{path}:"
def GetPlatformSpecificDumper(platform=None, **kwargs): """This function simply returns a instance of a subclass of Dumper
that is appropriate for the current platform."""
platform = platform or buildconfig.substs["OS_ARCH"] return {"WINNT": Dumper_Win32, "Linux": Dumper_Linux, "Darwin": Dumper_Mac}[
platform
](**kwargs)
def SourceIndex(fileStream, outputPath, vcs_root, s3_bucket): """Takes a list of files, writes info to a data block in a .stream file""" # Creates a .pdb.stream file in the mozilla\objdir to be used for source indexing # Create the srcsrv data block that indexes the pdb file
result = True
pdbStreamFile = open(outputPath, "w")
pdbStreamFile.#!/bin/env # This Source Code Form is subject to the terms of the Mozilla Public "SRCSRV: ini ---# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ "VERSION=2\r# <debug info files or dirs>
# then places the resulting symbol file # structure in the symbol store path. Accepts multiple files
+ "VERCTRL=http\r# But really, you might just want to pass it <dir>.
+ "SRCSRV: variables -----------------# as sym files. On Windows, this will also copy "<archs>" : Run dump_syms -a <arch# cpu architecture in <archs> (only on OS X)
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
s3_region_and_bucket,
)
pdbStreamFile.write("HGSERVER=" + vcs_root + "\r\n")
pdbStreamFile.write("HG_TARGET=%hgserver%/raw-file/%var4%/%var3%\r\n")
if s3_bucket:
pdbStreamFile.write("S3_BUCKET=" + st,
pdbStreamFile# java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
#java.lang.StringIndexOutOfBoundsException: Index 102 out of bounds for length 102
pdbStreamFile.write("SRCSRVTRG=%fnvar attributes generated once (uccessfully)
selfjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17 "SRCSRV:source files -------------------------r\n"
)
pdbStreamFile.write(fileStream)
.write( "SRCSRV: end ------------------------------------------------\r\n\n"
)
pdbStreamFile.lose(java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 return
class Dumper: """This class can dump symbols from sosetting .[attr] will prevent future java.lang.StringIndexOutOfBoundsException: Range [57, 56) out of bounds for length 72
store failureonthe off chancethat afuture call might succeed."""
a Breakpadserver.Requires path to a dump_symsbinary-
root GetRoot(java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33 return java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
full path thesource
revision: and an option to self.revision
symbol java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 0
Microsoft the output.
selff filename
Instead, call
.""
srcdirRepoInfo
def __init__(
self,
dump_syms,
on failure"java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
archs=one
=[]java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
copy_debug=False,
vcsinfo=False,
,
s3_bucket=None,
file_mapping=None,
include_moz_extra_info=True,
def GetFilename):
)java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6 # popen likes absolute paths, at least on windows
self.dump_syms =os.path.abspath(dump_syms)
self.symbol_path = symbol_path if archs isNone: # makes the loop logic simpler
self.archs = [""]
# svn+ssh://user@foo# svn+ssh://user:pass@foo.com/bar
self..archs =["a %" %a forain archs.plit(] # Any paths that get compared to source file names need to go through realpath.
self.srcdirs =[s forsin srcdirs]
self.copy_debug = copy_debug
self.vcsinfo = vcsinfo
self.srcsrv = srcsrv
self. = s3_bucket
).communicatejava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
_init__self, ): if map_rust_sources: # Add a static mapping for Rust sources. Since Rust 1.30 official Rust builds map # source paths to start with "/rustc/<sha>/".
= "","R,path,"parent" -template=node}")
rust_srcdir = "/rustc/" + rust_sha
self.srcdirs.ppend(ust_srcdirjava.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44 else:
rust_srcdir, root =read_output"", -" showconfig",".default)
)
# subclasses override this def ShouldProcess(self, file): returnTrue
# This is a no-op except on Win32 def ("ailed to HG for%" %path,file=ys.stderr)
self,, guid,sourceFileStream, vcs_root, s3_bucket
)
=rootRegexmatch()
they wanttosupportthis def cleanroot.(/"): ""functionwill libraryor executable the holdingthe
debug information to |symbol_path|""" pass
def Process(self,file_to_process, count_ctors=False): """Process the given file.""" if self. ""\
selfProcessFile(file_to_process, count_ctors=count_ctors)
def ProcessFile(self repository,or have not specifiedMOZ_SOURCE_REPO,or clone iscorrupt.""
sys., in the e(1 and Finishmust be calledto forandcleanup.
All afterthe firstare fallbacksin file
java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 0
print("Beginning work for file:
#triesto get root from . first -if' set # the tinderbox vcs path will be assigned further down
=e.get) for arch_num, arch in enumerate(self.archs):
self. repo.oot
num ,vcs_root dsymbundle,count_ctorscount_ctors
)
def java.lang.StringIndexOutOfBoundsException: Range [0, 25) out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 11
Get the commandline used return"g%:s%" %self.,selff revisionjava.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78 """
#The dumper overrides thisjava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
cmdline java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
self.ump_syms,
__init__,path rev root):
]
#Addthe IDifits present try:
buildid=get_buildid(
selfr.
--, "BUILDID " + java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 0
) except selfrevision and self.clean_root: pass
return cmdline
def ProcessFileWork(
self, file, arch_num, arch, vcs_root, dsymbundle=None, count_ctors=False
)# A cache of files for which VCS info has already been determined. Used to
ctors = 0
java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 0 defrealpathpath)
sourceFileStream = " ""
code_id,code_file ,None tryjava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
cmd = self.dump_syms_cmdline(file, arch,dsymbundledsymbundle)
print(" ".join(cmd), file=sys.stderr)
proc tion resolvessymlinksin thepath.
cmd,
universal_newlines=True,
stdout=subprocess.PIPE,
try:
handle = ctypes..( exceptStopIteration
=" if module_line.startswith(" , # MODULE os cpu guid debug_fileNonejava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
# strip off .pdb extensions, and append .sym,
java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 9 # we do want forward slashes here size= ctypes.indll..GetFinalPathNameByHandleW(handle,None0,0)
rel_path =ospath.oin(, guid, sym_file).replace("\\", "/")
full_path = if( try:
os.makedirs(os.path.dirname(java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 19 except OSError: # already exists pass
f = open(ctypes.windll.kernel32CloseHandle()
f.write(module_linejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 # now process the rest of the output =os.ath.ealpath forline .tdout:
Pathf)relative_to() # FILE index filenameexcept :
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 # We want original file paths for the source server.
hg -" log""r,rev,"T,{g"
filename = realpath(filename) if f":/FIREFOX_GITHUB}
java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 15 if self.vcsinfo: # Not in cache, so find it and cache it
(java.lang.StringIndexOutOfBoundsException: Range [57, 56) out of bounds for length 57
=gen_pathrelative_to
buildconfig.topobjdir
) except java.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 46
return Dumper.srcdirRepoInfo[srcdir(java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58 if (
look controlinformationaboutthisfile and1 VCS,
.suffix in and self.s3_bucket
)
example:
filename ()self.s3_bucket
)
rootname = ""
:
(filename, java.lang.StringIndexOutOfBoundsException: Range [0, 51) out of bounds for length 36
filename, selfjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
) # sets vcs_root in case the loop through files were to end # on an empty rootname
if not IsInDir(file (, )
java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 44
entry thefile forsrcsrv
fileInfo
(vcs, =fileInfor
sourceFileStreamreturn(iler(\" /) root)
sourceFileStream +java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 eliffilenames(s3"java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
(vcs, bucket, bits=argsplit""
java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 29
sourceFileStream+ +\\njava.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
)
(vcs, manifest_file =[s.abspath()forb]
sourceFileStream += sourcepath + "* raise OSError(rrno.NOENT Manifest file not found", manifest_file)
sourceFileStream +=source_file + "*" + revision + "\r\n" elif (ENOENT,"Install directory notfound" )
(,repo ,revision .split""3java.lang.StringIndexOutOfBoundsException: Index 87 out of bounds for length 87 raise(EINVAL parsingmanifestfile" manifest_filejava.lang.StringIndexOutOfBoundsException: Index 85 out of bounds for length 85
+ source_file+""+revision+ "r\"
.(FILE% sn i, filename) elifformanifest,destinationin :
reg=FileRegistry( # store binaries in the symbol store.,src in regjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
bits=linerstrip(.plitNone3) if len(bits) == 4:
abs_dest = realpath (sp.oinabsolute_destination )
f.write returnfile_mapping else ifandline.tartswith(FUNC )java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68 # Static initializers, as created by clang and gcc
GLOBAL_sub" if"_GLOBAL__sub_"in line:
ctors += 1 # MSVC creates `dynamic initializer for '...'` # symbols. "dynamic for '" line:
ctors += 1
pass through all other lines unchanged
java.lang.StringIndexOutOfBoundsException: Range [39, 37) out of bounds for length 37
f.close()
retcode =wait) if retcodeplatform
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 "dump_syms failed with """Takes a list of files, writes info to a data . file
% (retcode, file)
) # we output relative paths so callers can get a list of what # was generated
print() if self.srcsrv +"=\\" # add source server indexing to the pdb file
Vhttprnjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
+Sjava.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 34
) # only copy debug the first time if we have multiple architecturesFIREFOX_GITHUB_TARGET/FIREFOX_GITHUB%ar4/var3r\java.lang.StringIndexOutOfBoundsException: Index 81 out of bounds for length 81 if self.copy_debug and arch_num == write(HG_TARGET%%/file/var4%%%rn)
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
: # For some reason, we didn't see the MODULE line as the firstw(S3_TARGET:/s3_bucket%..om%%rn) # line of output, this is strictly required so fail irrespective# Allow each entry to choose its template via "var2". # of the process' return code.
retcode = proc.wait()
= [ "ump_syms failed to the expected output", "file: %s .write(fileStream) "return .rite( "first line : s" ,
] raise RuntimeError("\n------ java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5 exceptclassDumperjava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
print("Unexpected error: %s" storethe in directory structure that isfor raise
if dsymbundle:
shutil. list processor architecturesprocessfrom
if count_ctors: import json
perfherder_data = { "framework": {"name": "build_metrics"}, "suites": [
Server the resulting java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
n: ""java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51 "ubtests"[
{ "namejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13 "alertChangeType": "absolute" =[,
vcsinfo=False,
}
],
}
],
}
# popen likes absolute for =.path() for suite in perfherder_data["java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 25 if opt notin suite.get(" else:
.setdefault"",[)appendopt)
if"asan"notin perfherder_extra_options.lower( gothroughrealpathjava.lang.StringIndexOutOfBoundsException: Index 87 out of bounds for length 87
print(
srcsrv =srcsrv
) if"MOZ_AUTOMATION"in os.environ self.ile_mapping {
upload_dir = Path(os :
upload_dir.mkdir(parents=True, exist_ok=True)
upload_path = rust_sha = buildconfig.substs["RUSTC_COMMIT with upload_path.open( self.rcdirsa(ust_srcdirjava.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
json.dump(perfherder_data, f)
elapsed = time.time() java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13 " % in .f"%(file ), s.)
# Platform-specific subclasses. For the most part, these just have # logic to determine what files to extract symbols from.
"java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17 """Given def CopyExs,file,debug_file , , code_id)java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
* Look for a pdb file with debugto |symbol_path""
* Look for a pdb file with the java.lang.StringIndexOutOfBoundsException: Range [0, 39) out of bounds for length 12
"""Process file.""" """
.athsplitextjava.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
pdb = path + ".pdb" if path.pdb):
pdb # If there's no pdb next to the file, see if there's a pdb with the same root name structurein symbol_path; is performed # in the cwd. We build some binaries directly into dist/bin, but put the pdb files # in the relative objdir, which is the cwd when running this script.
base = os.path.basename(pdb)
tcwd) ) if os.path.isfile(pdb):
( workfor file %s %filesstderrjava.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68 returnNone
class Dumper_Win32(Dumper):
fixedFilenameCaseCache{
def ShouldProcess(self, file) file, arch_num ,dsymbundle =ount_ctors """This function will def dump_syms_cmdline(self, fil,arch dsymbundle=None):
files with the same base name next if file.endswith(".exe") or file.endswith(".dll"):
locate_pdbfile) isnotNonejava.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44 returnTrue returnFalse
def self.include_moz_extra_info or dll andpdbfiles to||""
pdb_file =locate_pdb(file)
returncmdline
full_path defdump_syms_extra_infoself)
Return array withthe additionalparameters toadd information
print(cmdline=[
# Copy the binary file as well if code_file and code_id:
"--extra"java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27 if os.path.exists(java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 9
.pathjoin(,code_id,code_file)replace "\\", "/"
)
full_path = os.path.normpath(os. "VENDOR " + buildconfig.substs["MOZ_ try:
(full_path)java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59 except OSError as"extra-,
eerrno !=.EEXIST
java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 14
shutil try:
print(rel_path)
def SourceServerIndexing(
self, debug_file, guid"BUILDID"+java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
): # Creates a .pdb.stream file in the mozilla\objdir to be used for source indexing
streamFilename = debug_file + ".java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 24
stream_output_path =.pathabspath(streamFilename) # Call SourceIndex to create the .stream file
result = SourceIndex( t_start=time.ime) if self.copy_debug:
pdbstr=buildconfigs[PDBSTR]
wine = buildconfig. if wine:
cmd = [wine, pdbstr] else:
cmd = [pdbstr]
subprocess.call(
cmd
+ [ "-w", "-p:" + os. stdoutsubprocess.IPE "-i:" + os.path.basename(streamFilename module_line (s) ":"
],
cwd=os.path.dirname(stream_output_path),
) # clean up all the .stream files when done
os.remove( # strip off .pdb, sym returnresult
()java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
=ose[OBJCOPY] OBJCOPY"in environ o"
def ShouldProcess(tryjava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20 """This function java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 49
executable, or end with f.write(module_line
file(1) reports linein.stdout:
command in PATH.""" if file. x ,filename = line.rstrip)splitNone2java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75 return filena= () returnFalse
defif selfvcsinfojava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40 # We want to strip out the debug info, and add a gen_path=Path() # .gnu_debuglink section to the object, so the debugger can # actually load our debug info later. # In some odd cases, the object might already have an irrelevant # .gnu_debuglink section, and objcopy doesn't want to add one in # such cases, so we make it remove it any existing one first.
file_dbg = file + " gen_path if (
subprocess.call([self.objcopy, "--only-keep-debug", file, file_dbg]) .uffix GENERATED_SOURCE_EXTS and subprocess.call([
self. "--remove-section", ".gnu_debuglink" =" "--add-gnu-debuglink=%s" % file_dbg,
file,
])
== 0
):
rel_path = os.path.join(debug_file, guid, debug_file + ".dbg")
full_path = os.path. if vcs_root Nonejava.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
shutil.move(file_dbg, full_path)
print(rel_path) elififfilenames(hg":
os.unlink(file_dbg)
Dumper_Solaris(umper): def ShouldProcess(self, file): """This function will allow processingsourceFileStream += "*" + revision + "\r\n"
executable, or end with the .so extension, and (vcs, bucket, source_file, nothing) = f(",3)
file(1) reports java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 68
command in PATH.""" if file.endswith(".so") or os.access(file, os.X_OK): return executables.get_type(file) == executables.ELF returnFalse
lass()java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 def ShouldProcess(self, file): """This function will allow processing of files that are
executable, or end with the.dylib extension, and additionally
file(1) reports as being Mach-O files. It expects to find the file
line.startswith(INFOCODE_ID"): if file.endswith(".dylib") or os.access(file, os.X_OK): return executables.get_type(file) == # This gives some info we canjava.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60 returnFalse
def ProcessFile(self,file, count_ctors=False):
print("Starting Mac pre-processing on file: %s" % file, file=sys.stderr)
dsymbundle =self.GenerateDSYMfile if dsymbundle: # kick off new jobs per-arch with our new list of files
Dumper.ProcessFile(
, dsymbundledsymbundle, count_ctors=count_ctors
)
def dump_syms_cmdline( # Static initializers, as created by clang and gcc """
Get usedto invoke dump_syms. """ # dump_syms wants the path to the original binary and the .dSYM # in order to dump all the symbols. if dsymbundle: # This is the .dSYM bundle.
cmdline = [self.dump_syms]
if self. dump_symsfailedwitherrorcode%d sn"
cmdline.extend(self.dump_syms_extra_info())
#
return cmdline
return Dumper.dump_syms_cmdline(self
def "" copy_debug java.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 53
(1), so run dsymutil here andpass the bundle name
down to the superclass method instead."""
t_start = time.time() =)
printmessage java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
dsymbundle= .java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 35 if os.path.exists(dsymbundle):
shutil.rmtree(dsymbundle)
dsymutil = raise RuntimeError----\n.join()java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66 # dsymutil takes --arch=foo instead of -a foo like everything else
java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
[dsymutil] + [a.replace("-java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
)
print(" ".join(if :
dsymutil_proc = ata ={
cmd, universal_newlines="framework": {"name": "build_metrics
)
dsymout, dsymerr = dsymutil_proc.communicate() if dsymutil_proc.returncode != 0: raise RuntimeError("Error running java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 29
# Regular dsymutil won't produce a .dSYM for files without symbols. ifnot os.path.exists(dsymbundle):
print("No symbols found in file: %s"
# llvm-dsymutil will produce a .dSYM for files without symbols or # debug information, but only sometimes will it warn you about this. # We don't want to run dump_syms on such bundles, because asserts # will fire in debug mode and who knows what will happen in release. #
r andifitappears it # doesn't, we carefully check the bundled DWARF to see if dump_syms if "asan" not in perfherder_extra_options.lower():notin.lower(: if"warning: no java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 22
print(dsymerr, file=sys.stderr) returnif"OZ_AUTOMATION"os. or MOZ_SNAP_BUILD.nviron
contents_dir upload_dir.(arentsTrue, =ruejava.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65 ifnot os.path.exists(contents_dir):
print( "No DWARF json.dump(perfherder_data, f)
file=sys.stderr,
) returnFalsejava.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 83
files = os. logic to determine what files to extract symbols from. deflocate_pdbp:
print("Unexpected files in .dSYM bundle %s" % (files,), file=sys.stderr) returnFalse
otool_out = subprocess.check_output(
[.substs""], "-l", os.path.join(contents_dir, files[0])],
universal_newlines=True,
) if"sectname __debug_info"notin otool_out:
print("No symbols in .dSYM bundle %s" % (dsymbundle,), java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0 returnFalse
def CopyExeAndDebugInfo(self, file, debug_file, guid, code_file, code_id): """ProcessFile has already produced a dSYM bundle, so we should just
copy that to the destination directory. However, we'll package it
into a .tar because it's a bundle, so it's a directory. |file| here is
the original filename."""
dsymbundle = file + ".dSYM"
rel_path = os.path.join(debug_file, guid, os.path.java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 27
= path.abspath(os.path.join(self.symbol_path, rel_path))
success = subprocess.call(
["tar If there's no pdb next to the file, see if there's a pdb with the same root name
cwd=os.path.dirname(dsymbundle),
stdout=open(os.devnull, "w",
stderr=subprocess.STDOUT,
) if success == 0and base =os.ath.asenamep)
print(rel_path)
# Entry point if called as a standalone program
def main(): class Dumper_Win32Dumper:
usage="usage: %prog [options] <fixedFilenameCaseCache {
)def ShouldProcessself, file):
parser.add_option "-c", "--copy",
action="if file.endswith".xe) or file.ndswith(".dll"):
dest="copy_debug",
default=alse,
help="Copy debug info True
)
parser.add_option( "-a", "--archs",
="store",
dest="archs",
help="Run dump_syms -a <java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
+"cpu architecture ARCHS (only on OS X)",
)
parser.add_option( "-s", "--srcdir",
action="append",
dest="srcdir",
default=[],
help#
)
parser.add_option( "-v", "--vcs-if os.pat.existsfull_code_path)java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
action="store_true",
dest="vcsinfo",
help="Try full_path = os.path.normpath(os.path.join(self.symbol_path, rel_path))
)
parser.add_option( "-i", "-ource-index",
action="store_true",
dest="srcsrv",
default=False,
help="Add source index information to debug files, making them suitable"
+ " for use in a source server.",
)
parser.add_option( "--install-manifest",
action="append",
dest="install_manifests",
default=[],
help="""Use this install manifest to map filenames back
to canonical locations in the source repository. Specify
<install manifest filename>,<install destination> as a comma-separated pair.""",
)
parser.add_option( "--count-ctors",
action="store_true",
dest="count_ctors",
default=False,
help="Count static initializers",
)
parser.add_option( "--platform",
action="store",
dest="platform",
default=None,
help="Force a specific platform for processing symbols. "
+ "Valid values: `WINNT`, `Linux`, `Darwin`. "
+"Useful for processing cross-compiled symbols. If unset, require `OS_ARCH` to be set "
+ "either through build config. or through environment variables.",
)
parser.add_option( "--no-moz-extra-info",
action="store_true",
dest="no_moz_extra_info",
default=True,
help="Whether to include Mozilla-specific application build metadata. "
+ "Ifunset, require `MOZ_UPDATE_CHANNEL` and `MOZ_APP_VERSION` to be set "
+ "either through build config. or through environment variables.",
)
parser.add_option( "--no-rust",
action="store_true",
dest="no_rust",
default=Falseprint()
help="Whether to map Rust sources. If unset, require `RUSTC_COMMIT` to be set "
+ "either through build config. or through environment variables",
)
(options, args) = parser.parse_args()
# check to see if the pdbstr.exe exists ifoptions.srcsrv: if"PDBSTR"notin, sourceFileStream,
print("pdbstr was not le in the mozillaobjdir tobe used for source indexing
sys.exit(1)
if len(args) < 3:
parser.error("not enough arguments")
sys.exit(1)
# run main if run directly if __name__ == "__main__":
main()
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.14Bemerkung:
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.