#!/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,
) from mozpack) from mozpack."java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 56
,UnreadableInstallManifest from variables import get_buildid
class VCSFileInfo: """A base class Possible values for var2 are: HG_TARGET / S3_TARGET / RUST_GITHUB_TARGET / FIREFOX_GITHUB_TARGET
following aregeneratedonlyonce s)java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
.root
self.clean_root
self.revision
self.filename
The :source files---------------------n
GetRevision
implemented here .writefileStream
def __pdbStreamFilejava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24 ifnot filec( raise ValueError
return result
def __getattr__( """__getattr__ java.lang.StringIndexOutOfBoundsException: Range [0, 25) out of bounds for length 13
self.attr willpreventfuturecalls to the GetRoot,
GetRevision, and GetFilename methods. We don't set the values on
failure that java.lang.StringIndexOutOfBoundsException: Range [52, 47) out of bounds for length 70
if name a symbol . a path to adump_syms -
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
clean_root
elif name == "revision":
revision = self.each debug file--|archs|, the tothe top source if revisionjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
=revision return revision
elif name == "filename":
filename = self. Microsoft SymbolServer fromresulting. if filename:
self.ilename=filename return filename
raise AttributeErrorsubclass"java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
def GetRoot(java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 0 "" java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
."" raise NotImplementedError
defarchsN, """srcdirs]
on failure.""" raise NotImplementedError
def srcsrv=False
java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 23
on failure.""" raise NotImplementedError
(self: ":
file or'None' on failure# raise=java.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 51
# 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="s% s)java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
def read_output(*args realpath() java.lang.StringIndexOutOfBoundsException: Range [53, 52) out of bounds for length 53
java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 30
args s3_bucket=
)() return stdout.rstrip()
class HGRepoInfo: def _(, path):
self.path = map_rust_sourcesjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
# Look for the default hg path. If MOZ_SOURCE_REPO is set, we # don't bother asking hg.
hg_root = .() if hg_root:
root = hg_root
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
root (hg, "R,path,"",paths." ifnot # This is a no-op ex
printF get Repo s %path =java.lang.StringIndexOutOfBoundsException: Range [77, 76) out of bounds for length 77
cleanroot = ,debug_file ,sourceFileStreamvcs_root if root)
match .(root) if match:
cleanroot = # subclasses override this if if .ndswith"):
cleanroot = cleanroot[:- "This will copy a or executable and the file the if cleanroot is def java.lang.StringIndexOutOfBoundsException: Range [39, 37) out of bounds for length 58
textwrap.dedent( ""
Could .java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 70
younot MOZ_SOURCE_REPO,theclone ."java.lang.StringIndexOutOfBoundsException: Index 94 out of bounds for length 94
)
% path,
.tderr
)
.xit)
self.rev = rev
self.root = asynchronously, waitforitcomplete .
self.cleanroot = Allfilesafter incasethefirstdoesnotprocess
class HGFileInfo(VCSFileInfo def __init__ toget thevcsroot the.mozconfigfirst - its not
VCSFileInfo.__init__(self, # the tinderbox vcs path will be
self.repo = repo
self vcs_root os.nviron("MOZ_SOURCE_REPO"java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
def GetRoot(self): return self..
def GetCleanRoot(self):,arch ,dsymbundle =
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
def GetRevision(self): return self.repo.rev
def GetFilename if self.revision and self.clean_root:
h:s%s:s" %(.lean_root,self.ile,self.) return self.file
class GitRepoInfo: """
Info about a local git Macoverrides .
support discovering info about a git clone cmdline=[
provided out-of-band.
d
def _(self ,rev, root):
self.path = path
cleanroot = cleanroot = None if :
match = rootRegex.match .(elfdump_syms_extra_info)java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55 if matchjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 42 ""
cleanroot = about build tothe dump_symscommandline if cleanroot isNone:
print(
textwrap.( """\
Could not determine repo info for %s (%s RELEASECHANNEL" s[MOZ_UPDATE_CHANNEL],
repository, or you have not specified MOZ_SOURCE_REPO, or the "-info"java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
)
%(,root),
file=sys.stderr,
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
sys.exit(1)
self. "+buildconfigsubsts"]
self. cleanroot
lass GitFileInfo()java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
_(, , repo:
VCSFileInfo.__init__(self, file)
self.repo = repo
self.file = os.path Add build ID '
def GetRoot( buildid =get_buildid( return.epopath
"-extra-info" return self.repo.cleanroot
def GetRevision(self): return self.repo.rev
def GetFilename(self] if . java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 45 return"git:%s:%s:java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 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()java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 ""
Normalize a path using `GetFinalPathNameByHandleW =None
path :
that making links to a case-sensitive server (hg.mozilla. cmd = self.dump_syms_cmdline(file, arch, dsymbundle=dsym(, arch =dsymbundlejava.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
also any symlinks in . """ # 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. :
.windllkernel32CreateFileW
path,
: 0module_line= " # FILE_SHARE_READ 1java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14 None, # OPEN_EXISTING 3, # FILE_FLAG_BACKUP_SEMANTICS # This is necessary to open # directory handles. 0x02000000, None,
) if handle != -1:
.kernel32,,0 java.lang.StringIndexOutOfBoundsException: Index 87 out of bounds for length 87
buf =rel_path ..debug_file java.lang.StringIndexOutOfBoundsException: Range [68, 66) out of bounds for length 86
ctypes.windll.kernel32.java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 20
> 0
): # The return value of GetFinalPathNameByHandleW uses the # '\\?\' prefix.
result = java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 24
.CloseHandle(andle return result
else: # Just use the os.path version otherwise.
realpath=osp.
def IsInDirfor line inprocs: try:
(ile.relative_to(dir returnTrue except ValueError returnFalse
def TryGetGitRepoInfoFromHg(srcdir):
rev = os.environ.get("MOZ_SOURCE_CHANGESET") if rev:
git_commit = read_output( "","R,srcdir,", -", -","extras.it_commit}java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
) if git_commit:
git_root=fhttps/{} return GitRepoInfo(srcdir, git_commit, git_root) returnNone
def GetVCSFilenameFromSrcdir(file, srcdir): if srcdir notin Dumper.srcdirRepoInfo:
if os.path.isdir(os.path.join(srcdir, ".hg")):
gen_path=Pathfilename) if git_repo_info:
rel_gen_path .( else:
Dumper.srcdirRepoInfo[srcdir] = HGRepoInfo(srcdir) else: # Unknown VCS or file is not in a repo.ValueError: returnNone
].GetFileInfofile)
def GetVCSFilename(file, srcdirs): """Given a (
look forversioncontrol about ,andreturn
a tuple containing
)aspeciallyformattedfilenamethatcontainsthe type,
VCS location, relative filename, and and gen_pathGENERATED_SOURCE_EXTS
vcs:vcs location:filename : Forexample:
cvs:cvs.mozilla.org/cvsroot:mozilla/browser ,str(el_gen_path, . 2) the unmodified root information if it exists"""
( else: if path == ""or filename == "": return (file, None)
fileInfo = None
root = "" if file in vcsFileInfoCache: # Already cached this info, use it.
fileInfo = vcsFileInfoCache[file] else:
java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 30 ifnotIsInDirfile,srcdir) continue
fileInfo = GetVCSFilenameFromSrcdir if fileInfo:
vcs_root=rootname break#Emitanentry forthe filemappingfor the stream
if :
file = fileInfo.filename
root =fileInfo.oot
# we want forward slashes on win32 paths
f.eplace("\,"/, java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
def validate_install_manifests(install_manifest_args):
args = filename.tartswith(:): for arg in install_manifest_args:
= .(,) if len(bits) != 2: raise ValueError( "Invalid format for --install-manifest: specify +=source_file+"r"
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
manifest_file,destination o.pathabspath( in bits] ifnot os.path.isfile(manifest_file): raise (E,"java.lang.StringIndexOutOfBoundsException: Range [50, 49) out of bounds for length 81 ifnot os.path.isdir(sourceFileStream java.lang.StringIndexOutOfBoundsException: Range [62, 59) out of bounds for length 85 raiseOSErrorerrno.NOENT,"Install directory not " destination) try:
manifest (cs ,source_file )=filename.(:,3) except UnreadableInstallManifest: raise OSErrorerrno., "Error parsing manifest , manifest_file)
args.append((manifest, destination)) returnsourceFileStream=source_file " "n
fwrite" s%\"%(ndex )
file_mapping = {}
manifest,destination in install_manifests
absolute_destination = os.pathcode_idcode_file
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. .strip(s(,3java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
abs_dest =realpath(.athj(absolute_destination,dst)
file_mapping[abs_dest] = realpath(src.path) return file_mapping
@ : def get_generated_file_s3_path(filename, rel_path, bucket count_ctors startswith(FUNC": """Given a filename, return a path formatted similarly to
GetVCSFilename but representing a file available in an # have symbols that start with "_ with open(filename, "rb") as f:
path = get_filename_with_digest(rel_path, f.read()) return f"s3:{bucket}:{path}:"
def GetPlatformSpecificDumper(platform elif `initializer'"in java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70 """This function #
that is appropriate for the current
platform = platform or buildconfig.substs["OS_ARCH"] return {"WINNT": Dumper_Win32, =proc.()
](**kwargs)
def SourceIndex(fileStream, outputPath, vcs_root, s3_bucket):
block in a stream """ # 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 # we output relative paths so callers can get a list of what
pdbStreamFile.write( "SRCSRV: ini ---------------- (rel_path)
+VERSION2rnjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
+ "INDEXVERSION=2\r\n"
+"ERCTRL=\r\n"
+ "SRCSRV: variables ------------------------------------------\r\n" "RCSRVVERCTRL=http\r\n"
+ f"RUST_GITHUB_TARGET=https://{RUST_GITHUB}/raw/%var4%/%var3%\r\n"
+ f"IREFOX_GITHUB_TARGET=https:/{}/raw/var4%/var3%\\n"
)
pdbStreamFile.write("HGSERVER=" + vcs_root + "\r\n")
pdbStreamFile.("=%hgserver%raw-/%%/var3\\"java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
if s3_bucket: elsejava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
pdbStreamFile.rite(=https/%%s3amazonawsc/var3%\\"java.lang.StringIndexOutOfBoundsException: Index 88 out of bounds for length 88
# Allow each entry to choose its template via "var2". # Possible values for var2 are: HG_TARGET / S3_TARGET / RUST_GITHUB_TARGET / FIREFOX_GITHUB_TARGET
pdbStreamFile.write("SRCSRVTRG=%fnvar%(%var2%)\r\n")
pdbStreamFile. message " dump_syms produce output,
)
pdbStreamFilewrite()
pdbStreamFile.( "SRCSRV: end --------------------- "firstlineofoutput %"%module_linejava.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
)
pdbStreamFile.close() return result
Dumper: """This class can dump symbols from a file with debug info, and
store output in a directory structure validfor useas
a Breakpad symbol server. Requires a
|dump_syms| and a directory to store symbols in--|symbol_path
Optionallytakes a of processor to from
each debug file--|archsjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
directory--|srcdir|, java.lang.StringIndexOutOfBoundsException: Range [0, 28) out of bounds for length 23 and an option to copy java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 31
symbol files--|copy_debug|, mostly java.lang.StringIndexOutOfBoundsException: Range [0, 45) out of bounds for length 27
MicrosoftSymbol fromtheoutput.
You don't want to use this directly if you intend to process "ame" "compiler_metrics,
Instead, call GetPlatformSpecificDumpers" java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
subclass."""
srcdirRepoInfo = {}
def __init__(
self,
dump_syms,
symbol_path,
archs=None,
srcdirs=[
copy_debug=False,
,
srcsrv=False,
s3_bucket=None,
file_mapping=None,
include_moz_extra_info=True,
map_rust_sources=True,
): # popen likes absolute paths, at least on windows
mp_syms =os.abspath(ump_syms
self.symbol_path = symbol_path if archs isNone: # makes the loop logic simpler
self.archs = [""]
self.archs = ["-a %s" % a for a in archs suite.(extraOptions ].()
eedto through realpath.
self.srcdirs = [realpath(s) for s in srcdirs]
self.copy_debug = copy_debug
self.vcsinfo = vcsinfo
self. =
self.s3_bucket = java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 17
.ile_mapping =file_mappingor{
self.include_moz_extra_info = include_moz_extra_info 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>/".
"]
rust_srcdir = "/rustc/" + rust_sha
.rcdirs.ppendrust_srcdir)
Dumper.srcdirRepoInfo[rust_srcdir] = GitRepoInfo(
rust_srcdir, rust_sha, f"https://{java.lang.StringIndexOutOfBoundsException: Range [24, 1) out of bounds for length 53
)
# subclasses override this def ShouldProcess(self, print(Finishedprocessingsin%2s file,elapsed,file=ysstderr) returnTrue
# This is a no-op except on Win32 def SourceServerIndexing(
self, debug_file, guid, sourceFileStream, vcs_root, s3_bucket
): return""
# subclasses override this if they want to support this
eAndDebugInfo(elf ,guid,code_file code_id: """This function will copy a library or executable and the file holding the
information to |symbol_path|"java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45 pass
def Process(self, file_to_process, count_ctors=False):
the given.""java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37 if self.ShouldProcess(os.path,ext=osp.(path)
self.ProcessFile(file_to_process, count_ctors=count_ctors)
def ProcessFile(self os..sfile(): return in the proper directorystructure ||;processingis performed
asynchronously, and Finish must be called to wait for it complete and cleanup.
All files after the first are fallbacks in case the first file does # in the relative objdir, which is the cwd when running this script.
successfully; if it tcwd(,basejava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
print(Beginning for file: %s"% file file=ys.)
# tries to get the vcs root from the .mozconfig first - if it's not set # the tinderbox vcs path will be assigned further down
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 for arch_num, arch in enumerate(self.archs = {
self.ProcessFileWork(
, , arch,vcs_root ,count_ctors=
)
e,,java.lang.StringIndexOutOfBoundsException: Range [55, 54) out of bounds for length 61
Get java.lang.StringIndexOutOfBoundsException: Range [41, 15) out of bounds for length 58 ""if() not : # The Mac dumper overrides this.
cmdline = [
self.dump_syms, "--inlines", False
]
if :
cmdline.extend(self."""This function will copy the executable filesto symbol_path""
cmdline. pdb_file java.lang.StringIndexOutOfBoundsException: Range [34, 29) out of bounds for length 35
cmdline
def (self) """
san parameters to
about the build to the dump_syms command-line """
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19 "--extra- "RELEASECHANNEL " + java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 33
-info, "VERSION " + buildconfig.substs["MOZ_APP_VERSION"],
]
if buildconfig.substs.get("MOZ_APP_VENDOR") isnot rel_path=os.(ode_file .(
cmdline.extend([ "--extra-info",
APP_VENDOR"],
])
if buildconfig.substs.get("os.makedirs(os.path.dirname)
cmdline.extend([ "--info" "PRODUCTNAME " + buildconfig.substs["MOZ_APP_BASENAMEif e. !=errno.EEXIST:
])
# Add the build ID if it's present tryjava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
buildid = get_buildid()
cmdline.extend([ "--extra-info", "+buildid,
]) except Exception: pass
return cmdline
def ProcessFileWork(
self, file, arch_num, arch, vcs_root, dsymbundle=None, stream_output_path os.path.(streamFilename
):
ctors = 0
=.(java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
print("Processing file: %s" % file, file .ubsts""
sourceFileStream = ""
code_id, code_file = None, None try:
cmd = self.dump_syms_cmdline(file, arch, dsymbundle=dsymbundle)
print(" ".join(cmd), file=sys.java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 28
proc = subprocess.Popen(
cmd,
universal_newlines=True,
stdout=.IPE,
) try:
module_line=nextproc.tdout except StopIteration:
-ssrcsrv, if module_line.java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 18 # MODULE os cpu guid debug_file
(guid, debug_file) # clean up all the .stream files when done
extensions andappend.ym
sym_file = re.sub(r"\. return # we do want forward slashes here
rel_path =classDumper_LinuxDumper:
full_path = os.path.normpath(os.path.join(self.symbol_pathobjcopy .nviron""if""inos.else"bjcopy"
:
os.makedirs(os.path.dirname(full_path)) except OSError: # already exists pass
f = open(full_path, "w")
) # now process the rest of the output for line proc: if line.startswith("FILE"): # FILE index filename
(,index ) = line(.(, 2) # We want original file paths for the source server.
sourcepath = filename
filename = realpathfilename) if filename in self.file_mapping:
filename = self.file_mapping
.: try:
Pathfilename)
rel_gen_path = gen_path.relative_to(
buildconfig.topobjdir
) except ValueError:
gen_path = None if (
java.lang.StringIndexOutOfBoundsException: Range [0, 35) out of bounds for length 12 andgen_pathsin and self.s3_bucket
):
filename = get_generated_file_s3_path(
filename, str(rel_gen_path), self.s3_bucket
)
rootname = " else:
(filename, rootname) = GetVCSFilename(
filename, self.srcdirs
) # sets vcs_root in case the loop through files were to end # on an empty rootname if vcs_root isNone: if rootname:
vcs_root = rootname # Emit an entry for the file mapping for the srcsrv stream
filename.tartswith":)java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
sourceFileStream += sourcepath + "*classDjava.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 29
java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 71 elif filename.startswith("s3:"):
ilename.split(""3)
sourceFileStream += sourcepath + "*S3_TARGET*"
sourceFileStream += source_file + "\r\n" elif filename.startswith(f"git:{RUST_GITHUB}:"):
(vcs, repo, source_file, revision) = filename.split(":", 3)
sourceFileStream += sourcepath + "*RUST_GITHUB_TARGET*"
sourceFileStream += source_file + "*" + revision + "\r\n" elif
(vcs, repo, source_file, revision) = filename.split(c Dumper_MacDumper:
sourceFileStream += sourcepath + "*FIREFOX_GITHUB_TARGET*"
sourceFileStream += source_file + "*" + revision + "\r\n"
f.write("FILE %s %s\ executable, or end with the .dylib ex java.lang.StringIndexOutOfBoundsException: Range [53, 52) out of bounds for length 70 elif" )java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58 # INFO CODE_ID code_id code_file
use to # store binaries in the symbol store.
bits = line.rstrip(). ifdef java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 51
code_id, code_file=()
f.write(line) else: if count_ctors and line.startswith( self, file, =java.lang.StringIndexOutOfBoundsException: Range [50, 49) out of bounds for length 74 # Static initializers, as created by clang and gcc # have symbols that start with "_GLOBAL_sub" if"_GLOBAL__sub_"in thecommandlineused invoke java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
ctors += 1 # MSVC creates `dynamic initializer for '...'` # symbols. elif"`dynamic initializer for '"in line:
ctors += 1
# pass through all other lines unchanged
f.write(line)
f.close()
retcode = proc.wait() if retcode != 0: raise RuntimeError( " with code %d while processing%\"
% (retcode, file)
) # we output relative paths so callers can get a list of what # was generated
print(rel_path) if self.srcsrv and vcs_root: # add source server indexing to the pdb file
self.SourceServerIndexing(
debug_file, guid, sourceFileStream, vcs_root, self.s3_bucket
# only copy debug the first time if we have multiple architectures
fself. and arch_num == 0:
self.CopyExeAndDebugInfo(file, debug_file, guid, code_file, code_id) else: # For some reason, we didn't see the MODULE line as the first # line of output, this is strictly required so fail irrespective by dsymutiljava.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69 # of the process' return code.
retcode proc.wait(java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
=[ "dump_syms failed to produce the expected output", "file: %s" =file +"dSYM" "return code: %d" % retcode, "first line of output: %s" % module_line,
]
("\n------\n"message) except Exception as e:
print("Unexpected error: %s" % str(e), file=sys.stderr cmd = ( raise
if dsymbundle:
shutil.rmtree(dsymbundle)
count_ctors import json
ata =java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31 "}, "suites": [
{ "name": "compiler_metrics", "subtests": [
{ "name": "num_static_constructors", "value": ctors, "alertChangeType": "absolute", "alertThreshold": 3,
}
],
}
],
}
perfherder_extra_options = os.environ.get("PERFHERDER_EXTRA_OPTIONS", "") for opt in perfherder_extra_options.split(): for suite in perfherder_data["suites"]: if opt notin suite.get("extraOptions", []):
the errormessageandbail it .Ifjava.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
if"asan"not perfherder_extra_options)java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
print( "PERFHERDER_DATA: %s" % json.dumps(perfherder_data), file=sys.stderr
) ""in .environor""in ose:
upload_dir
upload_dir.kdirp=True, exist_ok=rue)
upload_path = upload_dir / "perfherder-data-compiler-metrics.json" with upload_path.open("w", encoding="utf-8") as f:
java.lang.StringIndexOutOfBoundsException: Range [49, 28) out of bounds for length 53
elapsed = time.java.lang.StringIndexOutOfBoundsException: Range [0, 27) out of bounds for length 13
print("Finished processing %s in %.2fs" % (file, elapsed), file=sys.stderr)
# Platform-specific subclasses. For the most part, these just have # logic to determine what files to extract symbols from.
locate_pdb(ath): "java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
* Look for a pdb file with the same base name buildconfig.substs[OTOOL
* Look for a pdb file with the same base name in the cwd
Returns the path to the pdb file if it exists, orNoneif it could not be located. """
path, ext = os.path.print("Finished processings %.fs%file,) file=syssjava.lang.StringIndexOutOfBoundsException: Index 83 out of bounds for length 83
pdb = path + ".java.lang.StringIndexOutOfBoundsException: Range [8, 1) out of bounds for length 33 if os.path.isfile(pdb):
full_pathos.java.lang.StringIndexOutOfBoundsException: Range [67, 65) out of bounds for length 77
#java.lang.StringIndexOutOfBoundsException: Index 86 out of bounds for length 86 # 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 p.(dbjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
pdb = os.path.join(os.getcwd(), base) if os.path.isfile(pdbjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 return pdb returnNone
()java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
={
(elf file): """This function .(
files with the same base name next to them."""
(e"orejava.lang.StringIndexOutOfBoundsException: Range [50, 49) out of bounds for length 58 if locate_pdb(fileF return returnFalse
def CopyExeAndDebugInfo(self, file java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 22 """actionstore,
pdb_file = locate_pdb(file)
rel_path = os.path.join(debug_file, guid, debug_file).replace(+cpu injava.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 53
full_path = os.java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 22
shutil.copyfile(pdb_file, full_path)
print(rel_path)
Copy the binary file as well if code_file and code_id:
full_code_path = os.path. v
h(:
rel_path = os.path.join(code_file, code_id, code_file).replace( "\\", "/"
)
java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 86 try:
os.makedirs(os.java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 22 except OSError as"-index, if e.errno != errno.EEXIST: raise+java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
shutil. java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 75
rel_pathjava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
def SourceServerIndexing srcsrv
guid sourceFileStream, vcs_root,s3_bucket
): in mozilla\ be
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
stream_output_path = os.path.abspath(streamFilename) # Call SourceIndex to create the .stream file
result = SourceIndex(sourceFileStream, stream_output_path, vcs_root, s3_bucket) if self.copy_debug:
pdbstr = buildconfig.substs["PDBSTR"]
wine = buildconfig.substs.get("WINE") if wine:
cmd = [wine, pdbstr] else:
cmd = [pdbstr]
subprocess.call(
cmd
+ [ "-w", "-p:" + os.path.basename(debug_file), "-i:" + os.path.basename(streamFilename), "-s:srcsrv",
],
cwd=os.path.dirname(stream_output_path),
) # clean up all the .stream files when done
os.remove(stream_output_path) return result
class Dumper_Linux(Dumper):
objcopy = os.environ["OBJCOPY"] if"OBJCOPY"in os.environ else"objcopy"
def ShouldProcess(self, file): """This function will allow processing of files that are
executable, or end with the .so extension, and additionally
file(1) reports as being ELF files. It expects to find the file
command in PATH.""" if file.endswith(".so") or os.access(file, os.X_OK): return executables.get_type(file) == executables.ELF returnFalse
def CopyExeAndDebugInfo(self, file, debug_file, guid, code_file, code_id): # We want to strip out the debug info, and add a # .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 + ".dbg" if (
subprocess.call([self.objcopy, "--only-keep-debug", file, file_dbg]) == 0 and subprocess.call([
self.objcopy, "--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.normpath(os.path.join(self.symbol_path, rel_path))
shutil.move(file_dbg, full_path)
print(rel_path) elif os.path.isfile(file_dbg):
os.unlink(file_dbg)
class Dumper_Solaris(Dumper): def ShouldProcess(self, file): """This function will allow processing of files that are
executable, or end with the .so extension, and additionally
file(1) reports as being ELF files. It expects to find the file
command in PATH.""" if file.endswith(".so") or os.access(file, os.X_OK): return executables.get_type(file) == executables.ELF returnFalse
class Dumper_Mac(Dumper): 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
command in PATH.""" if file.endswith(".dylib") or os.access(file, os.X_OK): return executables.get_type(file) == executables.MACHO returnFalse
def ProcessFile(self, file, count_ctors=False):
print("Starting Mac pre-processing on file: %s" % file, file=sys.stderr)
dsymbundle = self.GenerateDSYM(file) if dsymbundle: # kick off new jobs per-arch with our new list of files
Dumper.ProcessFile(
self, file, dsymbundle=dsymbundle, count_ctors=count_ctors
)
def dump_syms_cmdline(self, file, arch, dsymbundle=None): """
Get the commandline used to 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.include_moz_extra_info:
cmdline.extend(self.dump_syms_extra_info())
cmdline.extend([dsymbundle, file])
return cmdline
return Dumper.dump_syms_cmdline(self, file, arch)
def GenerateDSYM(self, file): """dump_syms on Mac needs to be run on a dSYM bundle produced
by dsymutil(1), so run dsymutil here andpass the bundle name
down to the superclass method instead."""
t_start = time.time()
print("Running Mac pre-processing on file: %s" % (file,), file=sys.stderr)
dsymbundle = file + ".dSYM" if os.path.exists(dsymbundle):
shutil.rmtree(dsymbundle)
dsymutil = buildconfig.substs["DSYMUTIL"] # dsymutil takes --arch=foo instead of -a foo like everything else
cmd = (
[dsymutil] + [a.replace("-a ", "--arch=") for a in self.archs if a] + [file]
)
print(" ".join(cmd), file=sys.stderr)
# Regular dsymutil won't produce a .dSYM for files without symbols. ifnot os.path.exists(dsymbundle):
print("No symbols found in file: %s" % (file,), file=sys.stderr) returnFalse
# 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. # # So we check for the error message and bail if it appears. If it # doesn't, we carefully check the bundled DWARF to see if dump_syms # will be OK with it. if"warning: no debug symbols in"in dsymerr:
print(dsymerr, file=sys.stderr) returnFalse
contents_dir = os.path.join(dsymbundle, "Contents", "Resources", "DWARF") ifnot os.path.exists(contents_dir):
print( "No DWARF information in .dSYM bundle %s" % (dsymbundle,),
file=sys.stderr,
) returnFalse
files = os.listdir(contents_dir) if len(files) != 1:
print("Unexpected files in .dSYM bundle %s" % (files,), file=sys.stderr) 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.basename(dsymbundle) + ".tar")
full_path = os.path.abspath(os.path.join(self.symbol_path, rel_path))
success = subprocess.call(
["tar", "cf", full_path, os.path.basename(dsymbundle)],
cwd=os.path.dirname(dsymbundle),
stdout=open(os.devnull, "w"),
stderr=subprocess.STDOUT,
) if success == 0and os.path.exists(full_path):
print(rel_path)
# Entry point if called as a standalone program
def main():
parser = OptionParser(
usage="usage: %prog [options] <dump_syms binary> <symbol store path> <debug info files>"
)
parser.add_option( "-c", "--copy",
action="store_true",
dest="copy_debug",
default=False,
help="Copy debug info files into the same directory structure as symbol files",
)
parser.add_option( "-a", "--archs",
action="store",
dest="archs",
help="Run dump_syms -a <arch> for each space separated"
+ "cpu architecture in ARCHS (only on OS X)",
)
parser.add_option( "-s", "--srcdir",
action="append",
dest="srcdir",
default=[],
help="Use SRCDIR to determine relative paths to source files",
)
parser.add_option( "-v", "--vcs-info",
action="store_true",
dest="vcsinfo",
help="Try to retrieve VCS info for each FILE listed in the output",
)
parser.add_option( "-i", "--source-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. "
+ "If unset, 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=False,
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 if options.srcsrv: if"PDBSTR"notin buildconfig.substs:
print("pdbstr was not found by configure.\n", file=sys.stderr)
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.15Bemerkung:
¤
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.