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'],
19 'defines': ['BPLOG_MINIMUM_SEVERITY=SEVERITY_ERROR'],
21 'src/processor/basic_code_module.h',
22 'src/processor/basic_code_modules.cc',
23 'src/processor/basic_code_modules.h',
24 'src/processor/basic_source_line_resolver.cc',
25 'src/processor/binarystream.cc',
26 'src/processor/binarystream.h',
27 'src/processor/call_stack.cc',
28 'src/processor/cfi_frame_info.cc',
29 'src/processor/cfi_frame_info.h',
30 'src/processor/disassembler_x86.cc',
31 'src/processor/disassembler_x86.h',
32 'src/processor/exploitability.cc',
33 'src/processor/exploitability_linux.cc',
34 'src/processor/exploitability_linux.h',
35 'src/processor/exploitability_win.cc',
36 'src/processor/exploitability_win.h',
37 'src/processor/logging.cc',
38 'src/processor/logging.h',
39 'src/processor/minidump.cc',
40 'src/processor/minidump_processor.cc',
41 'src/processor/minidump_stackwalk.cc',
42 'src/processor/pathname_stripper.cc',
43 'src/processor/pathname_stripper.h',
44 'src/processor/process_state.cc',
45 'src/processor/simple_symbol_supplier.cc',
46 'src/processor/simple_symbol_supplier.h',
47 'src/processor/source_line_resolver_base.cc',
48 'src/processor/stack_frame_cpu.cc',
49 'src/processor/stack_frame_symbolizer.cc',
50 'src/processor/stackwalker.cc',
51 'src/processor/stackwalker_amd64.cc',
52 'src/processor/stackwalker_amd64.h',
53 'src/processor/stackwalker_arm.cc',
54 'src/processor/stackwalker_arm.h',
55 'src/processor/stackwalker_arm64.cc',
56 'src/processor/stackwalker_arm64.h',
57 'src/processor/stackwalker_mips.cc',
58 'src/processor/stackwalker_mips.h',
59 'src/processor/stackwalker_ppc.cc',
60 'src/processor/stackwalker_ppc.h',
61 'src/processor/stackwalker_ppc64.cc',
62 'src/processor/stackwalker_ppc64.h',
63 'src/processor/stackwalker_sparc.cc',
64 'src/processor/stackwalker_sparc.h',
65 'src/processor/stackwalker_x86.cc',
66 'src/processor/stackwalker_x86.h',
67 'src/processor/tokenize.cc',
68 'src/processor/tokenize.h',
70 'src/third_party/libdisasm/ia32_implicit.c',
71 'src/third_party/libdisasm/ia32_implicit.h',
72 'src/third_party/libdisasm/ia32_insn.c',
73 'src/third_party/libdisasm/ia32_insn.h',
74 'src/third_party/libdisasm/ia32_invariant.c',
75 'src/third_party/libdisasm/ia32_invariant.h',
76 'src/third_party/libdisasm/ia32_modrm.c',
77 'src/third_party/libdisasm/ia32_modrm.h',
78 'src/third_party/libdisasm/ia32_opcode_tables.c',
79 'src/third_party/libdisasm/ia32_opcode_tables.h',
80 'src/third_party/libdisasm/ia32_operand.c',
81 'src/third_party/libdisasm/ia32_operand.h',
82 'src/third_party/libdisasm/ia32_reg.c',
83 'src/third_party/libdisasm/ia32_reg.h',
84 'src/third_party/libdisasm/ia32_settings.c',
85 'src/third_party/libdisasm/ia32_settings.h',
86 'src/third_party/libdisasm/libdis.h',
87 'src/third_party/libdisasm/qword.h',
88 'src/third_party/libdisasm/x86_disasm.c',
89 'src/third_party/libdisasm/x86_format.c',
90 'src/third_party/libdisasm/x86_imm.c',
91 'src/third_party/libdisasm/x86_imm.h',
92 'src/third_party/libdisasm/x86_insn.c',
93 'src/third_party/libdisasm/x86_misc.c',
94 'src/third_party/libdisasm/x86_operand_list.c',
95 'src/third_party/libdisasm/x86_operand_list.h',
99 'target_name': 'minidump_dump',
100 'type': 'executable',
101 'includes': ['breakpad_tools.gypi'],
103 'src/processor/basic_code_module.h',
104 'src/processor/basic_code_modules.cc',
105 'src/processor/basic_code_modules.h',
106 'src/processor/logging.cc',
107 'src/processor/logging.h',
108 'src/processor/minidump.cc',
109 'src/processor/minidump_dump.cc',
110 'src/processor/pathname_stripper.cc',
111 'src/processor/pathname_stripper.h',
116 ['OS=="mac" or (OS=="ios" and "<(GENERATOR)"=="ninja")', {
124 # This is needed for GTMLogger to work correctly.
132 'target_name': 'dump_syms',
133 'type': 'executable',
134 'toolsets': ['host'],
139 'src/common/dwarf/bytereader.cc',
140 'src/common/dwarf_cfi_to_module.cc',
141 'src/common/dwarf_cu_to_module.cc',
142 'src/common/dwarf/dwarf2diehandler.cc',
143 'src/common/dwarf/dwarf2reader.cc',
144 'src/common/dwarf_line_to_module.cc',
145 'src/common/language.cc',
146 'src/common/mac/arch_utilities.cc',
147 'src/common/mac/arch_utilities.h',
148 'src/common/mac/dump_syms.mm',
149 'src/common/mac/file_id.cc',
150 'src/common/mac/macho_id.cc',
151 'src/common/mac/macho_reader.cc',
152 'src/common/mac/macho_utilities.cc',
153 'src/common/mac/macho_walker.cc',
155 'src/common/module.cc',
156 'src/common/stabs_reader.cc',
157 'src/common/stabs_to_module.cc',
158 'src/tools/mac/dump_syms/dump_syms_tool.mm',
161 # For src/common/stabs_reader.h.
162 'HAVE_MACH_O_NLIST_H',
165 # Like ld, dump_syms needs to operate on enough data that it may
166 # actually need to be able to address more than 4GB. Use x86_64.
167 # Don't worry! An x86_64 dump_syms is perfectly able to dump
173 # The DWARF utilities require -funsigned-char.
174 'GCC_CHAR_IS_UNSIGNED_CHAR': 'YES',
176 # dwarf2reader.cc uses dynamic_cast.
177 'GCC_ENABLE_CPP_RTTI': 'YES',
181 '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
187 # dump_syms crashes when built at -O1, -O2, and -O3. It does
188 # not crash at -Os. To play it safe, dump_syms is always built
189 # at -O0 until this can be sorted out.
190 # http://code.google.com/p/google-breakpad/issues/detail?id=329
191 'GCC_OPTIMIZATION_LEVEL': '0', # -O0
197 'target_name': 'symupload',
198 'type': 'executable',
199 'toolsets': ['host'],
204 'src/common/mac/HTTPMultipartUpload.m',
205 'src/tools/mac/symupload/symupload.m',
209 '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
223 # This is needed for GTMLogger to work correctly.
231 'target_name': 'breakpad_utilities',
232 'type': 'static_library',
234 'src/client/mac/handler/breakpad_nlist_64.cc',
235 'src/client/mac/handler/dynamic_images.cc',
236 'src/client/mac/handler/minidump_generator.cc',
237 'src/client/minidump_file_writer.cc',
238 'src/common/convert_UTF.c',
239 'src/common/mac/MachIPC.mm',
240 'src/common/mac/arch_utilities.cc',
241 'src/common/mac/bootstrap_compat.cc',
242 'src/common/mac/file_id.cc',
243 'src/common/mac/macho_id.cc',
244 'src/common/mac/macho_utilities.cc',
245 'src/common/mac/macho_walker.cc',
246 'src/common/mac/string_utilities.cc',
248 'src/common/simple_string_dictionary.cc',
249 'src/common/string_conversion.cc',
253 'target_name': 'crash_inspector',
254 'type': 'executable',
259 'breakpad_utilities',
262 'src/client/apple/Framework',
266 'src/client/mac/crash_generation/ConfigFile.mm',
267 'src/client/mac/crash_generation/Inspector.mm',
268 'src/client/mac/crash_generation/InspectorMain.mm',
272 '$(SDKROOT)/System/Library/Frameworks/CoreServices.framework',
273 '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
278 'target_name': 'crash_report_sender',
279 'type': 'executable',
288 'src/common/mac/HTTPMultipartUpload.m',
289 'src/client/mac/sender/crash_report_sender.m',
290 'src/client/mac/sender/uploader.mm',
291 'src/common/mac/GTMLogger.m',
293 'mac_bundle_resources': [
294 'src/client/mac/sender/English.lproj/Localizable.strings',
295 'src/client/mac/sender/crash_report_sender.icns',
296 'src/client/mac/sender/Breakpad.xib',
297 'src/client/mac/sender/crash_report_sender-Info.plist',
299 'mac_bundle_resources!': [
300 'src/client/mac/sender/crash_report_sender-Info.plist',
303 'INFOPLIST_FILE': 'src/client/mac/sender/crash_report_sender-Info.plist',
307 '$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
308 '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
309 '$(SDKROOT)/System/Library/Frameworks/SystemConfiguration.framework',
314 'target_name': 'breakpad',
315 'type': 'static_library',
317 'breakpad_utilities',
319 'crash_report_sender',
322 'src/client/apple/Framework',
324 'direct_dependent_settings': {
326 'src/client/apple/Framework',
330 'USE_PROTECTED_ALLOCATIONS=1',
333 'src/client/mac/crash_generation/crash_generation_client.cc',
334 'src/client/mac/crash_generation/crash_generation_client.h',
335 'src/client/mac/handler/protected_memory_allocator.cc',
336 'src/client/mac/handler/exception_handler.cc',
337 'src/client/mac/Framework/Breakpad.mm',
338 'src/client/mac/Framework/OnDemandServer.mm',
343 [ 'OS=="linux" or OS=="android" or OS=="freebsd"', {
351 # Tools needed for archiving build symbols.
354 'target_name': 'symupload',
355 'type': 'executable',
357 'includes': ['breakpad_tools.gypi'],
360 'src/tools/linux/symupload/sym_upload.cc',
361 'src/common/linux/http_upload.cc',
362 'src/common/linux/http_upload.h',
375 'target_name': 'dump_syms',
376 'type': 'executable',
379 'toolsets': [ 'host' ],
383 # dwarf2reader.cc uses dynamic_cast. Because we don't typically
384 # don't support RTTI, we enable it for this single target. Since
385 # dump_syms doesn't share any object files with anything else,
386 # this doesn't end up polluting Chrome itself.
387 'cflags_cc!': ['-fno-rtti'],
390 'src/common/dwarf/bytereader.cc',
391 'src/common/dwarf_cfi_to_module.cc',
392 'src/common/dwarf_cfi_to_module.h',
393 'src/common/dwarf_cu_to_module.cc',
394 'src/common/dwarf_cu_to_module.h',
395 'src/common/dwarf/dwarf2diehandler.cc',
396 'src/common/dwarf/dwarf2reader.cc',
397 'src/common/dwarf_line_to_module.cc',
398 'src/common/dwarf_line_to_module.h',
399 'src/common/language.cc',
400 'src/common/language.h',
401 'src/common/linux/crc32.cc',
402 'src/common/linux/crc32.h',
403 'src/common/linux/dump_symbols.cc',
404 'src/common/linux/dump_symbols.h',
405 'src/common/linux/elf_symbols_to_module.cc',
406 'src/common/linux/elf_symbols_to_module.h',
407 'src/common/linux/elfutils.cc',
408 'src/common/linux/elfutils.h',
409 'src/common/linux/file_id.cc',
410 'src/common/linux/file_id.h',
411 'src/common/linux/linux_libc_support.cc',
412 'src/common/linux/linux_libc_support.h',
413 'src/common/linux/memory_mapped_file.cc',
414 'src/common/linux/memory_mapped_file.h',
415 'src/common/linux/guid_creator.h',
416 'src/common/module.cc',
417 'src/common/module.h',
418 'src/common/stabs_reader.cc',
419 'src/common/stabs_reader.h',
420 'src/common/stabs_to_module.cc',
421 'src/common/stabs_to_module.h',
422 'src/tools/linux/dump_syms/dump_syms.cc',
425 # Breakpad rev 583 introduced this flag.
426 # Using this define, stabs_reader.h will include a.out.h to
438 'target_name': 'breakpad_client',
439 'type': 'static_library',
442 'src/client/linux/crash_generation/crash_generation_client.cc',
443 'src/client/linux/crash_generation/crash_generation_client.h',
444 'src/client/linux/handler/exception_handler.cc',
445 'src/client/linux/handler/exception_handler.h',
446 'src/client/linux/handler/minidump_descriptor.cc',
447 'src/client/linux/handler/minidump_descriptor.h',
448 'src/client/linux/log/log.cc',
449 'src/client/linux/log/log.h',
450 'src/client/linux/minidump_writer/cpu_set.h',
451 'src/client/linux/minidump_writer/directory_reader.h',
452 'src/client/linux/minidump_writer/line_reader.h',
453 'src/client/linux/minidump_writer/linux_core_dumper.cc',
454 'src/client/linux/minidump_writer/linux_core_dumper.h',
455 'src/client/linux/minidump_writer/linux_dumper.cc',
456 'src/client/linux/minidump_writer/linux_dumper.h',
457 'src/client/linux/minidump_writer/linux_ptrace_dumper.cc',
458 'src/client/linux/minidump_writer/linux_ptrace_dumper.h',
459 'src/client/linux/minidump_writer/minidump_writer.cc',
460 'src/client/linux/minidump_writer/minidump_writer.h',
461 'src/client/linux/minidump_writer/proc_cpuinfo_reader.h',
462 'src/client/minidump_file_writer-inl.h',
463 'src/client/minidump_file_writer.cc',
464 'src/client/minidump_file_writer.h',
465 'src/common/convert_UTF.c',
466 'src/common/convert_UTF.h',
467 'src/common/linux/elf_core_dump.cc',
468 'src/common/linux/elf_core_dump.h',
469 'src/common/linux/elfutils.cc',
470 'src/common/linux/elfutils.h',
471 'src/common/linux/file_id.cc',
472 'src/common/linux/file_id.h',
473 'src/common/linux/google_crashdump_uploader.cc',
474 'src/common/linux/google_crashdump_uploader.h',
475 'src/common/linux/guid_creator.cc',
476 'src/common/linux/guid_creator.h',
477 'src/common/linux/libcurl_wrapper.cc',
478 'src/common/linux/libcurl_wrapper.h',
479 'src/common/linux/linux_libc_support.cc',
480 'src/common/linux/linux_libc_support.h',
481 'src/common/linux/memory_mapped_file.cc',
482 'src/common/linux/memory_mapped_file.h',
483 'src/common/linux/safe_readlink.cc',
484 'src/common/linux/safe_readlink.h',
485 'src/common/memory.h',
486 'src/common/simple_string_dictionary.cc',
487 'src/common/simple_string_dictionary.h',
488 'src/common/string_conversion.cc',
489 'src/common/string_conversion.h',
493 # Android NDK toolchain doesn't support -mimplicit-it=always
494 ['target_arch=="arm" and OS!="android"', {
495 'cflags': ['-Wa,-mimplicit-it=always'],
497 ['target_arch=="arm" and chromeos==1', {
498 # Avoid running out of registers in
499 # linux_syscall_support.h:sys_clone()'s inline assembly.
504 'src/common/android/include',
506 'direct_dependent_settings': {
508 'src/common/android/include',
512 'src/common/android/breakpad_getcontext.S',
518 # In case of Android, '-ldl' is added in common.gypi, since it
519 # is needed for stlport_static. For LD, the order of libraries
520 # is important, and thus we skip to add it here.
530 'src/third_party/linux/include',
536 # Breakpad r693 uses some files from src/processor in unit tests.
537 'target_name': 'breakpad_processor_support',
538 'type': 'static_library',
541 'src/common/scoped_ptr.h',
542 'src/processor/basic_code_modules.cc',
543 'src/processor/basic_code_modules.h',
544 'src/processor/logging.cc',
545 'src/processor/logging.h',
546 'src/processor/minidump.cc',
547 'src/processor/pathname_stripper.cc',
548 'src/processor/pathname_stripper.h',
554 'src/third_party/linux/include',
560 'target_name': 'breakpad_unittests',
561 'type': 'executable',
563 '../testing/gtest.gyp:gtest',
564 '../testing/gtest.gyp:gtest_main',
565 '../testing/gmock.gyp:gmock',
567 'breakpad_processor_support',
568 'linux_dumper_unittest_helper',
572 'linux/breakpad_googletest_includes.h',
573 'src/client/linux/handler/exception_handler_unittest.cc',
574 'src/client/linux/minidump_writer/cpu_set_unittest.cc',
575 'src/client/linux/minidump_writer/directory_reader_unittest.cc',
576 'src/client/linux/minidump_writer/line_reader_unittest.cc',
577 'src/client/linux/minidump_writer/linux_core_dumper_unittest.cc',
578 'src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc',
579 'src/client/linux/minidump_writer/minidump_writer_unittest.cc',
580 'src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc',
581 'src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc',
582 'src/common/linux/elf_core_dump_unittest.cc',
583 'src/common/linux/file_id_unittest.cc',
584 'src/common/linux/linux_libc_support_unittest.cc',
585 'src/common/linux/synth_elf.cc',
586 'src/common/linux/tests/auto_testfile.h',
587 'src/common/linux/tests/crash_generator.cc',
588 'src/common/linux/tests/crash_generator.h',
589 'src/common/memory_range.h',
590 'src/common/memory_unittest.cc',
591 'src/common/simple_string_dictionary_unittest.cc',
592 'src/common/test_assembler.cc',
593 'src/common/tests/file_utils.cc',
594 'src/common/tests/file_utils.h',
595 'src/tools/linux/md2core/minidump_memory_range.h',
596 'src/tools/linux/md2core/minidump_memory_range_unittest.cc',
600 'linux', # Use our copy of breakpad_googletest_includes.h
608 # See http://crbug.com/138571#c18
617 'src/common/android/include',
620 'src/common/android/breakpad_getcontext_unittest.cc',
626 'target_name': 'linux_dumper_unittest_helper',
627 'type': 'executable',
629 'breakpad_processor_support',
632 'src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc',
640 ['target_arch=="mipsel" and OS=="android"', {
642 'src/common/android/include',
648 'target_name': 'generate_test_dump',
649 'type': 'executable',
652 'linux/generate-test-dump.cc',
669 'src/common/android/include',
675 'target_name': 'minidump-2-core',
676 'type': 'executable',
679 'src/tools/linux/md2core/minidump-2-core.cc'
692 'target_name': 'core-2-minidump',
693 'type': 'executable',
696 'src/tools/linux/core2md/core2md.cc'
713 'target_name': 'breakpad_client',
714 'type': 'static_library',
716 'src/client/ios/Breakpad.h',
717 'src/client/ios/Breakpad.mm',
718 'src/client/ios/BreakpadController.h',
719 'src/client/ios/BreakpadController.mm',
720 'src/client/ios/handler/ios_exception_minidump_generator.mm',
721 'src/client/ios/handler/ios_exception_minidump_generator.h',
722 'src/client/mac/crash_generation/ConfigFile.h',
723 'src/client/mac/crash_generation/ConfigFile.mm',
724 'src/client/mac/handler/breakpad_nlist_64.cc',
725 'src/client/mac/handler/breakpad_nlist_64.h',
726 'src/client/mac/handler/dynamic_images.cc',
727 'src/client/mac/handler/dynamic_images.h',
728 'src/client/mac/handler/protected_memory_allocator.cc',
729 'src/client/mac/handler/protected_memory_allocator.h',
730 'src/client/mac/handler/exception_handler.cc',
731 'src/client/mac/handler/exception_handler.h',
732 'src/client/mac/handler/minidump_generator.cc',
733 'src/client/mac/handler/minidump_generator.h',
734 'src/client/mac/sender/uploader.h',
735 'src/client/mac/sender/uploader.mm',
736 'src/client/minidump_file_writer.cc',
737 'src/client/minidump_file_writer.h',
738 'src/client/minidump_file_writer-inl.h',
739 'src/common/convert_UTF.c',
740 'src/common/convert_UTF.h',
741 'src/common/mac/file_id.cc',
742 'src/common/mac/file_id.h',
743 'src/common/mac/HTTPMultipartUpload.m',
744 'src/common/mac/macho_id.cc',
745 'src/common/mac/macho_id.h',
746 'src/common/mac/macho_utilities.cc',
747 'src/common/mac/macho_utilities.h',
748 'src/common/mac/macho_walker.cc',
749 'src/common/mac/macho_walker.h',
750 'src/common/mac/string_utilities.cc',
751 'src/common/mac/string_utilities.h',
754 'src/common/simple_string_dictionary.cc',
755 'src/common/simple_string_dictionary.h',
756 'src/common/string_conversion.cc',
757 'src/common/string_conversion.h',
758 'src/google_breakpad/common/minidump_format.h',
762 'src/client/mac/Framework',
768 ['OS=="ios" and "<(GENERATOR)"!="ninja"', {
770 'ninja_output_dir': 'ninja-breakpad',
772 '<(DEPTH)/xcodebuild/<(ninja_output_dir)/<(CONFIGURATION_NAME)',
774 # Generation is done via two actions: (1) compiling the executable with
775 # ninja, and (2) copying the executable into a location that is shared
776 # with other projects. These actions are separated into two targets in
777 # order to be able to specify that the second action should not run until
778 # the first action finishes (since the ordering of multiple actions in
779 # one target is defined only by inputs and outputs, and it's impossible
780 # to set correct inputs for the ninja build, so setting all the inputs
781 # and outputs isn't an option).
784 'target_name': 'compile_breakpad_utilities',
789 'breakpad/breakpad.gyp',
792 'includes': ['../build/ios/mac_build.gypi'],
795 'action_name': 'compile breakpad utilities',
803 'message': 'Generating the breakpad executables',
808 'target_name': 'breakpad_utilities',
811 'compile_breakpad_utilities',
815 'action_name': 'copy dump_syms',
817 '<(ninja_product_dir)/dump_syms',
820 '<(PRODUCT_DIR)/dump_syms',
824 '<(ninja_product_dir)/dump_syms',
825 '<(PRODUCT_DIR)/dump_syms',
829 'action_name': 'copy symupload',
831 '<(ninja_product_dir)/symupload',
834 '<(PRODUCT_DIR)/symupload',
838 '<(ninja_product_dir)/symupload',
839 '<(PRODUCT_DIR)/symupload',
845 'target_name': 'dump_syms',
848 'breakpad_utilities',
852 'target_name': 'symupload',
855 'breakpad_utilities',
863 'target_name': 'breakpad_unittests_stripped',
865 'dependencies': [ 'breakpad_unittests' ],
867 'action_name': 'strip breakpad_unittests',
868 'inputs': [ '<(PRODUCT_DIR)/breakpad_unittests' ],
869 'outputs': [ '<(PRODUCT_DIR)/breakpad_unittests_stripped' ],
870 'action': [ '<(android_strip)', '<@(_inputs)', '-o', '<@(_outputs)' ],