symbols: add a symbol installation script
This commit is contained in:
parent
93a4a581b2
commit
8caeef1819
3
.gitignore
vendored
3
.gitignore
vendored
@ -6,3 +6,6 @@
|
||||
/release
|
||||
/sanitizer
|
||||
/tidy
|
||||
|
||||
/dumps
|
||||
/symbols
|
||||
|
40
symbols.py
Executable file
40
symbols.py
Executable file
@ -0,0 +1,40 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
"""
|
||||
Installs a provided symbol file into the symbols repository at the correct
|
||||
subdirectory for `minidump_stackwalk` to automatically find.
|
||||
"""
|
||||
|
||||
if __name__ == '__main__':
|
||||
import argparse
|
||||
import os
|
||||
import shutil
|
||||
import sys
|
||||
|
||||
def main():
|
||||
default_dst = os.path.join(
|
||||
os.path.dirname(
|
||||
os.path.realpath(__file__)
|
||||
),
|
||||
"symbols"
|
||||
)
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--dst', dest='dst', type=str, required=False, default=default_dst)
|
||||
parser.add_argument('src', type=str)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
with open(args.src) as f:
|
||||
header = f.readline()
|
||||
|
||||
field, system, arch, id, name = header.strip().split(' ')
|
||||
print(f"Installing {name}: {id}", file=sys.stderr)
|
||||
|
||||
dst_dir = os.path.join(args.dst, name, id)
|
||||
os.makedirs(dst_dir, exist_ok=True)
|
||||
|
||||
dst_path = os.path.join(dst_dir, f"{name}.sym")
|
||||
shutil.copyfile(args.src, dst_path)
|
||||
|
||||
main()
|
Loading…
Reference in New Issue
Block a user