diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:42 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:42 +0000 |
commit | da4c7e7ed675c3bf405668739c3012d140856109 (patch) | |
tree | cdd868dba063fecba609a1d819de271f0d51b23e /toolkit/crashreporter/tools | |
parent | Adding upstream version 125.0.3. (diff) | |
download | firefox-da4c7e7ed675c3bf405668739c3012d140856109.tar.xz firefox-da4c7e7ed675c3bf405668739c3012d140856109.zip |
Adding upstream version 126.0.upstream/126.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/crashreporter/tools')
-rwxr-xr-x | toolkit/crashreporter/tools/symbolstore.py | 86 |
1 files changed, 74 insertions, 12 deletions
diff --git a/toolkit/crashreporter/tools/symbolstore.py b/toolkit/crashreporter/tools/symbolstore.py index 8bc7a7120a..b7ad7752a8 100755 --- a/toolkit/crashreporter/tools/symbolstore.py +++ b/toolkit/crashreporter/tools/symbolstore.py @@ -23,6 +23,7 @@ import ctypes import errno +import io import os import platform import re @@ -390,13 +391,13 @@ def validate_install_manifests(install_manifest_args): def make_file_mapping(install_manifests): file_mapping = {} for manifest, destination in install_manifests: - destination = os.path.abspath(destination) + 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(destination, dst)) + abs_dest = realpath(os.path.join(absolute_destination, dst)) file_mapping[abs_dest] = realpath(src.path) return file_mapping @@ -551,7 +552,58 @@ class Dumper: Get the commandline used to invoke dump_syms. """ # The Mac dumper overrides this. - return [self.dump_syms, "--inlines", file] + cmdline = [ + self.dump_syms, + "--inlines", + ] + + cmdline.extend(self.dump_syms_extra_info()) + cmdline.append(file) + + return cmdline + + def dump_syms_extra_info(self): + """ + Returns an array with the additional parameters to add information + about the build to the dump_syms command-line + """ + cmdline = [ + "--extra-info", + "RELEASECHANNEL " + buildconfig.substs["MOZ_UPDATE_CHANNEL"], + "--extra-info", + "VERSION " + buildconfig.substs["MOZ_APP_VERSION"], + ] + + if buildconfig.substs.get("MOZ_APP_VENDOR") is not None: + cmdline.extend( + [ + "--extra-info", + "VENDOR " + buildconfig.substs["MOZ_APP_VENDOR"], + ] + ) + + if buildconfig.substs.get("MOZ_APP_BASENAME") is not None: + cmdline.extend( + [ + "--extra-info", + "PRODUCTNAME " + buildconfig.substs["MOZ_APP_BASENAME"], + ] + ) + + # Add the build ID if it's present + path = os.path.join(buildconfig.topobjdir, "buildid.h") + try: + buildid = io.open(path, "r", encoding="utf-8").read().split()[2] + cmdline.extend( + [ + "--extra-info", + "BUILDID " + buildid, + ] + ) + except Exception: + pass + + return cmdline def ProcessFileWork( self, file, arch_num, arch, vcs_root, dsymbundle=None, count_ctors=False @@ -859,9 +911,8 @@ class Dumper_Linux(Dumper): full_path = os.path.normpath(os.path.join(self.symbol_path, rel_path)) shutil.move(file_dbg, full_path) print(rel_path) - else: - if os.path.isfile(file_dbg): - os.unlink(file_dbg) + elif os.path.isfile(file_dbg): + os.unlink(file_dbg) class Dumper_Solaris(Dumper): @@ -902,11 +953,22 @@ class Dumper_Mac(Dumper): # in order to dump all the symbols. if dsymbundle: # This is the .dSYM bundle. - return ( - [self.dump_syms] - + arch.split() - + ["--inlines", "-j", "2", dsymbundle, file] + cmdline = [self.dump_syms] + + cmdline.extend(arch.split()) + cmdline.extend( + [ + "--inlines", + "-j", + "2", + ] ) + + 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): @@ -1066,13 +1128,13 @@ to canonical locations in the source repository. Specify if len(args) < 3: parser.error("not enough arguments") - exit(1) + sys.exit(1) try: manifests = validate_install_manifests(options.install_manifests) except (IOError, ValueError) as e: parser.error(str(e)) - exit(1) + sys.exit(1) file_mapping = make_file_mapping(manifests) _, bucket = get_s3_region_and_bucket() dumper = GetPlatformSpecificDumper( |