1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
7 'breakpad_sender.gypi',
8 'breakpad_handler.gypi',
11 # minidump_stackwalk and minidump_dump are tool-type executables that do
13 ['OS!="ios" and OS!="win"', {
16 'target_name': 'minidump_stackwalk',
18 'includes': ['breakpad_tools.gypi'],
20 'src/processor/basic_code_module.h',
21 'src/processor/basic_code_modules.cc',
22 'src/processor/basic_code_modules.h',
23 'src/processor/basic_source_line_resolver.cc',
24 'src/processor/binarystream.cc',
25 'src/processor/binarystream.h',
26 'src/processor/call_stack.cc',
27 'src/processor/cfi_frame_info.cc',
28 'src/processor/cfi_frame_info.h',
29 'src/processor/disassembler_x86.cc',
30 'src/processor/disassembler_x86.h',
31 'src/processor/exploitability.cc',
32 'src/processor/exploitability_win.cc',
33 'src/processor/exploitability_win.h',
34 'src/processor/logging.cc',
35 'src/processor/logging.h',
36 'src/processor/minidump.cc',
37 'src/processor/minidump_processor.cc',
38 'src/processor/minidump_stackwalk.cc',
39 'src/processor/pathname_stripper.cc',
40 'src/processor/pathname_stripper.h',
41 'src/processor/process_state.cc',
42 'src/processor/simple_symbol_supplier.cc',
43 'src/processor/simple_symbol_supplier.h',
44 'src/processor/source_line_resolver_base.cc',
45 'src/processor/stack_frame_symbolizer.cc',
46 'src/processor/stackwalker.cc',
47 'src/processor/stackwalker_amd64.cc',
48 'src/processor/stackwalker_amd64.h',
49 'src/processor/stackwalker_arm.cc',
50 'src/processor/stackwalker_arm.h',
51 'src/processor/stackwalker_ppc.cc',
52 'src/processor/stackwalker_ppc.h',
53 'src/processor/stackwalker_ppc64.cc',
54 'src/processor/stackwalker_ppc64.h',
55 'src/processor/stackwalker_sparc.cc',
56 'src/processor/stackwalker_sparc.h',
57 'src/processor/stackwalker_x86.cc',
58 'src/processor/stackwalker_x86.h',
59 'src/processor/tokenize.cc',
60 'src/processor/tokenize.h',
62 'src/third_party/libdisasm/ia32_implicit.c',
63 'src/third_party/libdisasm/ia32_implicit.h',
64 'src/third_party/libdisasm/ia32_insn.c',
65 'src/third_party/libdisasm/ia32_insn.h',
66 'src/third_party/libdisasm/ia32_invariant.c',
67 'src/third_party/libdisasm/ia32_invariant.h',
68 'src/third_party/libdisasm/ia32_modrm.c',
69 'src/third_party/libdisasm/ia32_modrm.h',
70 'src/third_party/libdisasm/ia32_opcode_tables.c',
71 'src/third_party/libdisasm/ia32_opcode_tables.h',
72 'src/third_party/libdisasm/ia32_operand.c',
73 'src/third_party/libdisasm/ia32_operand.h',
74 'src/third_party/libdisasm/ia32_reg.c',
75 'src/third_party/libdisasm/ia32_reg.h',
76 'src/third_party/libdisasm/ia32_settings.c',
77 'src/third_party/libdisasm/ia32_settings.h',
78 'src/third_party/libdisasm/libdis.h',
79 'src/third_party/libdisasm/qword.h',
80 'src/third_party/libdisasm/x86_disasm.c',
81 'src/third_party/libdisasm/x86_format.c',
82 'src/third_party/libdisasm/x86_imm.c',
83 'src/third_party/libdisasm/x86_imm.h',
84 'src/third_party/libdisasm/x86_insn.c',
85 'src/third_party/libdisasm/x86_misc.c',
86 'src/third_party/libdisasm/x86_operand_list.c',
87 'src/third_party/libdisasm/x86_operand_list.h',
91 'target_name': 'minidump_dump',
93 'includes': ['breakpad_tools.gypi'],
95 'src/processor/basic_code_module.h',
96 'src/processor/basic_code_modules.cc',
97 'src/processor/basic_code_modules.h',
98 'src/processor/logging.cc',
99 'src/processor/logging.h',
100 'src/processor/minidump.cc',
101 'src/processor/minidump_dump.cc',
102 'src/processor/pathname_stripper.cc',
103 'src/processor/pathname_stripper.h',
108 ['OS=="mac" or (OS=="ios" and "<(GENERATOR)"=="ninja")', {
116 # This is needed for GTMLogger to work correctly.
124 'target_name': 'dump_syms',
125 'type': 'executable',
126 'toolsets': ['host'],
131 'src/common/dwarf/bytereader.cc',
132 'src/common/dwarf_cfi_to_module.cc',
133 'src/common/dwarf_cu_to_module.cc',
134 'src/common/dwarf/dwarf2diehandler.cc',
135 'src/common/dwarf/dwarf2reader.cc',
136 'src/common/dwarf_line_to_module.cc',
137 'src/common/language.cc',
138 'src/common/mac/arch_utilities.cc',
139 'src/common/mac/arch_utilities.h',
140 'src/common/mac/dump_syms.mm',
141 'src/common/mac/file_id.cc',
142 'src/common/mac/macho_id.cc',
143 'src/common/mac/macho_reader.cc',
144 'src/common/mac/macho_utilities.cc',
145 'src/common/mac/macho_walker.cc',
147 'src/common/module.cc',
148 'src/common/stabs_reader.cc',
149 'src/common/stabs_to_module.cc',
150 'src/tools/mac/dump_syms/dump_syms_tool.mm',
153 # For src/common/stabs_reader.h.
154 'HAVE_MACH_O_NLIST_H',
157 # Like ld, dump_syms needs to operate on enough data that it may
158 # actually need to be able to address more than 4GB. Use x86_64.
159 # Don't worry! An x86_64 dump_syms is perfectly able to dump
165 # The DWARF utilities require -funsigned-char.
166 'GCC_CHAR_IS_UNSIGNED_CHAR': 'YES',
168 # dwarf2reader.cc uses dynamic_cast.
169 'GCC_ENABLE_CPP_RTTI': 'YES',
173 '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
179 # dump_syms crashes when built at -O1, -O2, and -O3. It does
180 # not crash at -Os. To play it safe, dump_syms is always built
181 # at -O0 until this can be sorted out.
182 # http://code.google.com/p/google-breakpad/issues/detail?id=329
183 'GCC_OPTIMIZATION_LEVEL': '0', # -O0
189 'target_name': 'symupload',
190 'type': 'executable',
191 'toolsets': ['host'],
196 'src/common/mac/HTTPMultipartUpload.m',
197 'src/tools/mac/symupload/symupload.m',
201 '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
215 # This is needed for GTMLogger to work correctly.
223 'target_name': 'breakpad_utilities',
224 'type': 'static_library',
226 'src/client/mac/handler/breakpad_nlist_64.cc',
227 'src/client/mac/handler/dynamic_images.cc',
228 'src/client/mac/handler/minidump_generator.cc',
229 'src/client/minidump_file_writer.cc',
230 'src/common/convert_UTF.c',
231 'src/common/mac/MachIPC.mm',
232 'src/common/mac/arch_utilities.cc',
233 'src/common/mac/bootstrap_compat.cc',
234 'src/common/mac/file_id.cc',
235 'src/common/mac/macho_id.cc',
236 'src/common/mac/macho_utilities.cc',
237 'src/common/mac/macho_walker.cc',
238 'src/common/mac/string_utilities.cc',
240 'src/common/simple_string_dictionary.cc',
241 'src/common/string_conversion.cc',
245 'target_name': 'crash_inspector',
246 'type': 'executable',
251 'breakpad_utilities',
254 'src/client/apple/Framework',
258 'src/client/mac/crash_generation/ConfigFile.mm',
259 'src/client/mac/crash_generation/Inspector.mm',
260 'src/client/mac/crash_generation/InspectorMain.mm',
264 '$(SDKROOT)/System/Library/Frameworks/CoreServices.framework',
265 '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
270 'target_name': 'crash_report_sender',
271 'type': 'executable',
280 'src/common/mac/HTTPMultipartUpload.m',
281 'src/client/mac/sender/crash_report_sender.m',
282 'src/client/mac/sender/uploader.mm',
283 'src/common/mac/GTMLogger.m',
285 'mac_bundle_resources': [
286 'src/client/mac/sender/English.lproj/Localizable.strings',
287 'src/client/mac/sender/crash_report_sender.icns',
288 'src/client/mac/sender/Breakpad.xib',
289 'src/client/mac/sender/crash_report_sender-Info.plist',
291 'mac_bundle_resources!': [
292 'src/client/mac/sender/crash_report_sender-Info.plist',
295 'INFOPLIST_FILE': 'src/client/mac/sender/crash_report_sender-Info.plist',
299 '$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
300 '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
301 '$(SDKROOT)/System/Library/Frameworks/SystemConfiguration.framework',
306 'target_name': 'breakpad',
307 'type': 'static_library',
309 'breakpad_utilities',
311 'crash_report_sender',
314 'src/client/apple/Framework',
316 'direct_dependent_settings': {
318 'src/client/apple/Framework',
322 'USE_PROTECTED_ALLOCATIONS=1',
325 'src/client/mac/crash_generation/crash_generation_client.cc',
326 'src/client/mac/crash_generation/crash_generation_client.h',
327 'src/client/mac/handler/protected_memory_allocator.cc',
328 'src/client/mac/handler/exception_handler.cc',
329 'src/client/mac/Framework/Breakpad.mm',
330 'src/client/mac/Framework/OnDemandServer.mm',
335 [ 'OS=="linux" or OS=="android"', {
342 # Tools needed for archiving build symbols.
343 ['linux_breakpad==1', {
346 'target_name': 'symupload',
347 'type': 'executable',
349 'includes': ['breakpad_tools.gypi'],
352 'src/tools/linux/symupload/sym_upload.cc',
353 'src/common/linux/http_upload.cc',
354 'src/common/linux/http_upload.h',
367 'target_name': 'dump_syms',
368 'type': 'executable',
371 'toolsets': [ 'host' ],
375 # dwarf2reader.cc uses dynamic_cast. Because we don't typically
376 # don't support RTTI, we enable it for this single target. Since
377 # dump_syms doesn't share any object files with anything else,
378 # this doesn't end up polluting Chrome itself.
379 'cflags_cc!': ['-fno-rtti'],
382 'src/common/dwarf/bytereader.cc',
383 'src/common/dwarf_cfi_to_module.cc',
384 'src/common/dwarf_cfi_to_module.h',
385 'src/common/dwarf_cu_to_module.cc',
386 'src/common/dwarf_cu_to_module.h',
387 'src/common/dwarf/dwarf2diehandler.cc',
388 'src/common/dwarf/dwarf2reader.cc',
389 'src/common/dwarf_line_to_module.cc',
390 'src/common/dwarf_line_to_module.h',
391 'src/common/language.cc',
392 'src/common/language.h',
393 'src/common/linux/dump_symbols.cc',
394 'src/common/linux/dump_symbols.h',
395 'src/common/linux/elf_symbols_to_module.cc',
396 'src/common/linux/elf_symbols_to_module.h',
397 'src/common/linux/elfutils.cc',
398 'src/common/linux/elfutils.h',
399 'src/common/linux/file_id.cc',
400 'src/common/linux/file_id.h',
401 'src/common/linux/linux_libc_support.cc',
402 'src/common/linux/linux_libc_support.h',
403 'src/common/linux/memory_mapped_file.cc',
404 'src/common/linux/memory_mapped_file.h',
405 'src/common/linux/guid_creator.h',
406 'src/common/module.cc',
407 'src/common/module.h',
408 'src/common/stabs_reader.cc',
409 'src/common/stabs_reader.h',
410 'src/common/stabs_to_module.cc',
411 'src/common/stabs_to_module.h',
412 'src/tools/linux/dump_syms/dump_syms.cc',
415 # Breakpad rev 583 introduced this flag.
416 # Using this define, stabs_reader.h will include a.out.h to
432 'target_name': 'breakpad_client',
433 'type': 'static_library',
436 'src/client/linux/crash_generation/crash_generation_client.cc',
437 'src/client/linux/crash_generation/crash_generation_client.h',
438 'src/client/linux/handler/exception_handler.cc',
439 'src/client/linux/handler/exception_handler.h',
440 'src/client/linux/handler/minidump_descriptor.cc',
441 'src/client/linux/handler/minidump_descriptor.h',
442 'src/client/linux/log/log.cc',
443 'src/client/linux/log/log.h',
444 'src/client/linux/minidump_writer/cpu_set.h',
445 'src/client/linux/minidump_writer/directory_reader.h',
446 'src/client/linux/minidump_writer/line_reader.h',
447 'src/client/linux/minidump_writer/linux_core_dumper.cc',
448 'src/client/linux/minidump_writer/linux_core_dumper.h',
449 'src/client/linux/minidump_writer/linux_dumper.cc',
450 'src/client/linux/minidump_writer/linux_dumper.h',
451 'src/client/linux/minidump_writer/linux_ptrace_dumper.cc',
452 'src/client/linux/minidump_writer/linux_ptrace_dumper.h',
453 'src/client/linux/minidump_writer/minidump_writer.cc',
454 'src/client/linux/minidump_writer/minidump_writer.h',
455 'src/client/linux/minidump_writer/proc_cpuinfo_reader.h',
456 'src/client/minidump_file_writer-inl.h',
457 'src/client/minidump_file_writer.cc',
458 'src/client/minidump_file_writer.h',
459 'src/common/convert_UTF.c',
460 'src/common/convert_UTF.h',
461 'src/common/linux/elf_core_dump.cc',
462 'src/common/linux/elf_core_dump.h',
463 'src/common/linux/elfutils.cc',
464 'src/common/linux/elfutils.h',
465 'src/common/linux/file_id.cc',
466 'src/common/linux/file_id.h',
467 'src/common/linux/google_crashdump_uploader.cc',
468 'src/common/linux/google_crashdump_uploader.h',
469 'src/common/linux/guid_creator.cc',
470 'src/common/linux/guid_creator.h',
471 'src/common/linux/libcurl_wrapper.cc',
472 'src/common/linux/libcurl_wrapper.h',
473 'src/common/linux/linux_libc_support.cc',
474 'src/common/linux/linux_libc_support.h',
475 'src/common/linux/memory_mapped_file.cc',
476 'src/common/linux/memory_mapped_file.h',
477 'src/common/linux/safe_readlink.cc',
478 'src/common/linux/safe_readlink.h',
479 'src/common/memory.h',
480 'src/common/simple_string_dictionary.cc',
481 'src/common/simple_string_dictionary.h',
482 'src/common/string_conversion.cc',
483 'src/common/string_conversion.h',
487 # Android NDK toolchain doesn't support -mimplicit-it=always
488 ['target_arch=="arm" and OS!="android"', {
489 'cflags': ['-Wa,-mimplicit-it=always'],
491 ['target_arch=="arm" and chromeos==1', {
492 # Avoid running out of registers in
493 # linux_syscall_support.h:sys_clone()'s inline assembly.
498 'src/common/android/include',
500 'direct_dependent_settings': {
502 'src/common/android/include',
506 'src/common/android/breakpad_getcontext.S',
520 'src/third_party/linux/include',
526 # Breakpad r693 uses some files from src/processor in unit tests.
527 'target_name': 'breakpad_processor_support',
528 'type': 'static_library',
531 'src/common/scoped_ptr.h',
532 'src/processor/basic_code_modules.cc',
533 'src/processor/basic_code_modules.h',
534 'src/processor/logging.cc',
535 'src/processor/logging.h',
536 'src/processor/minidump.cc',
537 'src/processor/pathname_stripper.cc',
538 'src/processor/pathname_stripper.h',
544 'src/third_party/linux/include',
550 'target_name': 'breakpad_unittests',
551 'type': 'executable',
553 '../testing/gtest.gyp:gtest',
554 '../testing/gtest.gyp:gtest_main',
555 '../testing/gmock.gyp:gmock',
557 'breakpad_processor_support',
558 'linux_dumper_unittest_helper',
562 'linux/breakpad_googletest_includes.h',
563 'src/client/linux/handler/exception_handler_unittest.cc',
564 'src/client/linux/minidump_writer/cpu_set_unittest.cc',
565 'src/client/linux/minidump_writer/directory_reader_unittest.cc',
566 'src/client/linux/minidump_writer/line_reader_unittest.cc',
567 'src/client/linux/minidump_writer/linux_core_dumper_unittest.cc',
568 'src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc',
569 'src/client/linux/minidump_writer/minidump_writer_unittest.cc',
570 'src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc',
571 'src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc',
572 'src/common/linux/elf_core_dump_unittest.cc',
573 'src/common/linux/file_id_unittest.cc',
574 'src/common/linux/linux_libc_support_unittest.cc',
575 'src/common/linux/synth_elf.cc',
576 'src/common/linux/tests/crash_generator.cc',
577 'src/common/linux/tests/crash_generator.h',
578 'src/common/memory_range.h',
579 'src/common/memory_unittest.cc',
580 'src/common/simple_string_dictionary_unittest.cc',
581 'src/common/test_assembler.cc',
582 'src/common/tests/auto_testfile.h',
583 'src/common/tests/file_utils.cc',
584 'src/common/tests/file_utils.h',
585 'src/tools/linux/md2core/minidump_memory_range.h',
586 'src/tools/linux/md2core/minidump_memory_range_unittest.cc',
590 'linux', # Use our copy of breakpad_googletest_includes.h
598 # See http://crbug.com/138571#c18
607 'src/common/android/include',
613 'target_name': 'linux_dumper_unittest_helper',
614 'type': 'executable',
616 'breakpad_processor_support',
619 'src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc',
628 'target_name': 'generate_test_dump',
629 'type': 'executable',
632 'linux/generate-test-dump.cc',
649 'src/common/android/include',
655 'target_name': 'minidump-2-core',
656 'type': 'executable',
659 'src/tools/linux/md2core/minidump-2-core.cc'
672 'target_name': 'core-2-minidump',
673 'type': 'executable',
676 'src/tools/linux/core2md/core2md.cc'
693 'target_name': 'breakpad_client',
694 'type': 'static_library',
696 'src/client/ios/Breakpad.h',
697 'src/client/ios/Breakpad.mm',
698 'src/client/ios/BreakpadController.h',
699 'src/client/ios/BreakpadController.mm',
700 'src/client/ios/handler/ios_exception_minidump_generator.mm',
701 'src/client/ios/handler/ios_exception_minidump_generator.h',
702 'src/client/mac/crash_generation/ConfigFile.h',
703 'src/client/mac/crash_generation/ConfigFile.mm',
704 'src/client/mac/handler/breakpad_nlist_64.cc',
705 'src/client/mac/handler/breakpad_nlist_64.h',
706 'src/client/mac/handler/dynamic_images.cc',
707 'src/client/mac/handler/dynamic_images.h',
708 'src/client/mac/handler/protected_memory_allocator.cc',
709 'src/client/mac/handler/protected_memory_allocator.h',
710 'src/client/mac/handler/exception_handler.cc',
711 'src/client/mac/handler/exception_handler.h',
712 'src/client/mac/handler/minidump_generator.cc',
713 'src/client/mac/handler/minidump_generator.h',
714 'src/client/mac/sender/uploader.h',
715 'src/client/mac/sender/uploader.mm',
716 'src/client/minidump_file_writer.cc',
717 'src/client/minidump_file_writer.h',
718 'src/client/minidump_file_writer-inl.h',
719 'src/common/convert_UTF.c',
720 'src/common/convert_UTF.h',
721 'src/common/mac/file_id.cc',
722 'src/common/mac/file_id.h',
723 'src/common/mac/HTTPMultipartUpload.m',
724 'src/common/mac/macho_id.cc',
725 'src/common/mac/macho_id.h',
726 'src/common/mac/macho_utilities.cc',
727 'src/common/mac/macho_utilities.h',
728 'src/common/mac/macho_walker.cc',
729 'src/common/mac/macho_walker.h',
730 'src/common/mac/string_utilities.cc',
731 'src/common/mac/string_utilities.h',
734 'src/common/simple_string_dictionary.cc',
735 'src/common/simple_string_dictionary.h',
736 'src/common/string_conversion.cc',
737 'src/common/string_conversion.h',
738 'src/google_breakpad/common/minidump_format.h',
742 'src/client/mac/Framework',
745 '<(DEPTH)/third_party/GTM',
746 '<(DEPTH)/third_party/GTM/Foundation',
749 # Build the version of GTMLogger.m in third_party rather than the
750 # one in src/common/mac because the former catches all exceptions
751 # whereas the latter lets them propagate, which can cause odd
754 '<(DEPTH)/third_party/GTM/Foundation/GTMLogger.h',
755 '<(DEPTH)/third_party/GTM/Foundation/GTMLogger.m',
758 '<(DEPTH)/third_party/GTM',
759 '<(DEPTH)/third_party/GTM/Foundation',
765 ['OS=="ios" and "<(GENERATOR)"!="ninja"', {
767 'ninja_output_dir': 'ninja-breakpad',
769 '<(DEPTH)/xcodebuild/<(ninja_output_dir)/<(CONFIGURATION_NAME)',
771 # Generation is done via two actions: (1) compiling the executable with
772 # ninja, and (2) copying the executable into a location that is shared
773 # with other projects. These actions are separated into two targets in
774 # order to be able to specify that the second action should not run until
775 # the first action finishes (since the ordering of multiple actions in
776 # one target is defined only by inputs and outputs, and it's impossible
777 # to set correct inputs for the ninja build, so setting all the inputs
778 # and outputs isn't an option).
781 'target_name': 'compile_breakpad_utilities',
786 'breakpad/breakpad.gyp',
789 'includes': ['../build/ios/mac_build.gypi'],
792 'action_name': 'compile breakpad utilities',
800 'message': 'Generating the breakpad executables',
805 'target_name': 'breakpad_utilities',
808 'compile_breakpad_utilities',
812 'action_name': 'copy dump_syms',
814 '<(ninja_product_dir)/dump_syms',
817 '<(PRODUCT_DIR)/dump_syms',
821 '<(ninja_product_dir)/dump_syms',
822 '<(PRODUCT_DIR)/dump_syms',
826 'action_name': 'copy symupload',
828 '<(ninja_product_dir)/symupload',
831 '<(PRODUCT_DIR)/symupload',
835 '<(ninja_product_dir)/symupload',
836 '<(PRODUCT_DIR)/symupload',
842 'target_name': 'dump_syms',
845 'breakpad_utilities',
849 'target_name': 'symupload',
852 'breakpad_utilities',