Skip to content

Commit

Permalink
Merge pull request #37 from brave/dump_syms
Browse files Browse the repository at this point in the history
Build and use dump_syms on Windows and Mac
  • Loading branch information
bbondy authored Feb 11, 2018
2 parents dbe71c0 + 00a8d69 commit ec2328a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/mac/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,6 @@ action("generate_breakpad_symbols") {
"//chrome:chrome_helper_app",
"//chrome:chrome_dump_syms",
"//third_party/crashpad/crashpad/handler:crashpad_handler",
"//third_party/breakpad:dump_syms",
]
}
5 changes: 5 additions & 0 deletions app/win/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,15 @@ action("generate_breakpad_symbols") {
args = [
"--symbols-dir=" + rebase_path(symbols_dir),
"--jobs=16",
"--build-dir=" + rebase_path(root_out_dir),
rebase_path(root_out_dir)
]

script = "//brave/tools/win/generate_breakpad_symbols.py"

deps = [
"//third_party/breakpad:dump_syms",
]
}

group("symbol_dist_resources") {
Expand Down
Binary file removed tools/win/dump_syms.exe
Binary file not shown.
10 changes: 8 additions & 2 deletions tools/win/generate_breakpad_symbols.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

CONCURRENT_TASKS=4
BRAVE_ROOT=os.path.abspath(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
DUMP_SYMS=os.path.join(BRAVE_ROOT, 'tools', 'win', 'dump_syms.exe')


def GetCommandOutput(command):
Expand Down Expand Up @@ -61,7 +60,8 @@ def _Worker():
with print_lock:
print "Generating symbols for %s" % binary

syms = GetCommandOutput([DUMP_SYMS, binary])
dump_syms = os.path.join(options.build_dir, 'dump_syms.exe')
syms = GetCommandOutput([dump_syms, binary])
module_line = re.match("MODULE [^ ]+ [^ ]+ ([0-9A-Fa-f]+) (.*)\r\n", syms)
if module_line == None:
with print_lock:
Expand Down Expand Up @@ -92,6 +92,8 @@ def _Worker():

def main():
parser = optparse.OptionParser()
parser.add_option('', '--build-dir', default='',
help='The build output directory.')
parser.add_option('', '--symbols-dir', default='',
help='The directory where to write the symbols file.')
parser.add_option('', '--clear', default=False, action='store_true',
Expand All @@ -104,6 +106,10 @@ def main():

(options, directories) = parser.parse_args()

if not options.build_dir:
print "Required option --build-dir missing."
return 1

if not options.symbols_dir:
print "Required option --symbols-dir missing."
return 1
Expand Down

0 comments on commit ec2328a

Please sign in to comment.