mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 10:55:32 +08:00
Write breakpad symbols into a flat directory structure
Symbol files were never copied one to one to a break server. Therefore setting up the required directory structure is not necessary. In contrast, backtrace.io wants a tarball without any subdirs.
This commit is contained in:
committed by
Mat Sutcliffe
parent
4c99ac4fa9
commit
db8285868b
@@ -93,9 +93,9 @@ class JobPool(object):
|
|||||||
|
|
||||||
class Dumper:
|
class Dumper:
|
||||||
"""This class can dump symbols from a file with debug info, and
|
"""This class can dump symbols from a file with debug info, and
|
||||||
store the output in a directory structure that is valid for use as
|
store the output in a flat directory structure.
|
||||||
a Breakpad symbol server. Requires a path to a dump_syms binary--
|
Requires a path to a dump_syms binary--|dump_syms| and a directory
|
||||||
|dump_syms| and a directory to store symbols in--|symbol_path|.
|
to store symbols in--|symbol_path|.
|
||||||
|
|
||||||
You don't want to use this directly if you intend to process files.
|
You don't want to use this directly if you intend to process files.
|
||||||
Instead, call GetPlatformSpecificDumper to get an instance of a
|
Instead, call GetPlatformSpecificDumper to get an instance of a
|
||||||
@@ -203,7 +203,7 @@ class Dumper:
|
|||||||
symbol_full_path = os.path.normpath(os.path.join(self.symbol_path, ".."))
|
symbol_full_path = os.path.normpath(os.path.join(self.symbol_path, ".."))
|
||||||
tar_path = os.path.join(symbol_full_path, 'symbols.tar.gz')
|
tar_path = os.path.join(symbol_full_path, 'symbols.tar.gz')
|
||||||
tar = tarfile.open(tar_path, "w:gz")
|
tar = tarfile.open(tar_path, "w:gz")
|
||||||
tar.add(self.symbol_path, arcname="symbols")
|
tar.add(self.symbol_path, arcname='.')
|
||||||
|
|
||||||
def process(self, *args):
|
def process(self, *args):
|
||||||
"""Process files recursively in args."""
|
"""Process files recursively in args."""
|
||||||
@@ -256,8 +256,8 @@ class Dumper:
|
|||||||
|
|
||||||
def process_files(self, files, after=None, after_arg=None):
|
def process_files(self, files, after=None, after_arg=None):
|
||||||
"""Dump symbols from these files into a symbol file, stored
|
"""Dump symbols from these files into a symbol file, stored
|
||||||
in the proper directory structure in |symbol_path|; processing is performed
|
|symbol_path|; processing is performed asynchronously, and Finish must be
|
||||||
asynchronously, and Finish must be called to wait for it complete and cleanup.
|
called to wait for it complete and cleanup.
|
||||||
All files after the first are fallbacks in case the first file does not process
|
All files after the first are fallbacks in case the first file does not process
|
||||||
successfully; if it does, no other files will be touched."""
|
successfully; if it does, no other files will be touched."""
|
||||||
self.output_pid(sys.stderr, "Submitting jobs for files: %s" % str(files))
|
self.output_pid(sys.stderr, "Submitting jobs for files: %s" % str(files))
|
||||||
@@ -294,12 +294,8 @@ class Dumper:
|
|||||||
(guid, debug_file) = (module_line.split())[3:5]
|
(guid, debug_file) = (module_line.split())[3:5]
|
||||||
# strip off .pdb extensions, and append .sym
|
# strip off .pdb extensions, and append .sym
|
||||||
sym_file = re.sub("\.pdb$", "", debug_file) + ".sym"
|
sym_file = re.sub("\.pdb$", "", debug_file) + ".sym"
|
||||||
# we do want forward slashes here
|
|
||||||
rel_path = os.path.join(debug_file,
|
|
||||||
guid,
|
|
||||||
sym_file).replace("\\", "/")
|
|
||||||
full_path = os.path.normpath(os.path.join(self.symbol_path,
|
full_path = os.path.normpath(os.path.join(self.symbol_path,
|
||||||
rel_path))
|
sym_file))
|
||||||
try:
|
try:
|
||||||
os.makedirs(os.path.dirname(full_path))
|
os.makedirs(os.path.dirname(full_path))
|
||||||
except OSError: # already exists
|
except OSError: # already exists
|
||||||
|
|||||||
Reference in New Issue
Block a user