Skip to content

Commit

Permalink
Merge pull request #40 from brave/x86_linux_package_sym_deps
Browse files Browse the repository at this point in the history
X86 linux package sym deps
  • Loading branch information
bbondy committed Feb 26, 2018
2 parents 85cb8f2 + f6ecfbf commit 91bc123
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 22 deletions.
5 changes: 4 additions & 1 deletion app/linux/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ action("generate_breakpad_symbols") {
"--clear",
]

deps = [ "//third_party/breakpad:dump_syms" ]
deps = [
"//chrome", # To be sure brave executable is ready now
"//third_party/breakpad:dump_syms",
]
}

group("symbol_dist_resources") {
Expand Down
48 changes: 27 additions & 21 deletions tools/posix/generate_breakpad_symbols.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,27 +191,33 @@ def _Worker():
while True:
binary = queue.get()

if options.verbose:
with print_lock:
print "Generating symbols for %s" % binary

if sys.platform == 'darwin':
binary = GetDSYMBundle(options, binary)
elif sys.platform == 'linux2':
binary = GetSymbolPath(options, binary)

syms = GetCommandOutput([GetDumpSymsBinary(options.build_dir), '-r', '-c',
binary])
module_line = re.match("MODULE [^ ]+ [^ ]+ ([0-9A-F]+) (.*)\n", syms)
output_path = os.path.join(options.symbols_dir, module_line.group(2),
module_line.group(1))
mkdir_p(output_path)
symbol_file = "%s.sym" % module_line.group(2)
f = open(os.path.join(output_path, symbol_file), 'w')
f.write(syms)
f.close()

queue.task_done()
try:
if options.verbose:
with print_lock:
print "Generating symbols for %s" % binary

if sys.platform == 'darwin':
binary = GetDSYMBundle(options, binary)
elif sys.platform == 'linux2':
binary = GetSymbolPath(options, binary)

syms = GetCommandOutput([GetDumpSymsBinary(options.build_dir), '-r', '-c',
binary])
module_line = re.match("MODULE [^ ]+ [^ ]+ ([0-9A-F]+) (.*)\n", syms)
output_path = os.path.join(options.symbols_dir, module_line.group(2),
module_line.group(1))
mkdir_p(output_path)
symbol_file = "%s.sym" % module_line.group(2)
f = open(os.path.join(output_path, symbol_file), 'w')
f.write(syms)
f.close()
except Exception as inst:
if options.verbose:
with print_lock:
print type(inst)
print inst
finally:
queue.task_done()

for binary in binaries:
queue.put(binary)
Expand Down

0 comments on commit 91bc123

Please sign in to comment.