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/dump_symbols.cc',
402 'src/common/linux/dump_symbols.h',
403 'src/common/linux/elf_symbols_to_module.cc',
404 'src/common/linux/elf_symbols_to_module.h',
405 'src/common/linux/elfutils.cc',
406 'src/common/linux/elfutils.h',
407 'src/common/linux/file_id.cc',
408 'src/common/linux/file_id.h',
409 'src/common/linux/linux_libc_support.cc',
410 'src/common/linux/linux_libc_support.h',
411 'src/common/linux/memory_mapped_file.cc',
412 'src/common/linux/memory_mapped_file.h',
413 'src/common/linux/guid_creator.h',
414 'src/common/module.cc',
415 'src/common/module.h',
416 'src/common/stabs_reader.cc',
417 'src/common/stabs_reader.h',
418 'src/common/stabs_to_module.cc',
419 'src/common/stabs_to_module.h',
420 'src/tools/linux/dump_syms/dump_syms.cc',
423 # Breakpad rev 583 introduced this flag.
424 # Using this define, stabs_reader.h will include a.out.h to
436 'target_name': 'breakpad_client',
437 'type': 'static_library',
440 'src/client/linux/crash_generation/crash_generation_client.cc',
441 'src/client/linux/crash_generation/crash_generation_client.h',
442 'src/client/linux/handler/exception_handler.cc',
443 'src/client/linux/handler/exception_handler.h',
444 'src/client/linux/handler/minidump_descriptor.cc',
445 'src/client/linux/handler/minidump_descriptor.h',
446 'src/client/linux/log/log.cc',
447 'src/client/linux/log/log.h',
448 'src/client/linux/minidump_writer/cpu_set.h',
449 'src/client/linux/minidump_writer/directory_reader.h',
450 'src/client/linux/minidump_writer/line_reader.h',
451 'src/client/linux/minidump_writer/linux_core_dumper.cc',
452 'src/client/linux/minidump_writer/linux_core_dumper.h',
453 'src/client/linux/minidump_writer/linux_dumper.cc',
454 'src/client/linux/minidump_writer/linux_dumper.h',
455 'src/client/linux/minidump_writer/linux_ptrace_dumper.cc',
456 'src/client/linux/minidump_writer/linux_ptrace_dumper.h',
457 'src/client/linux/minidump_writer/minidump_writer.cc',
458 'src/client/linux/minidump_writer/minidump_writer.h',
459 'src/client/linux/minidump_writer/proc_cpuinfo_reader.h',
460 'src/client/minidump_file_writer-inl.h',
461 'src/client/minidump_file_writer.cc',
462 'src/client/minidump_file_writer.h',
463 'src/common/convert_UTF.c',
464 'src/common/convert_UTF.h',
465 'src/common/linux/elf_core_dump.cc',
466 'src/common/linux/elf_core_dump.h',
467 'src/common/linux/elfutils.cc',
468 'src/common/linux/elfutils.h',
469 'src/common/linux/file_id.cc',
470 'src/common/linux/file_id.h',
471 'src/common/linux/google_crashdump_uploader.cc',
472 'src/common/linux/google_crashdump_uploader.h',
473 'src/common/linux/guid_creator.cc',
474 'src/common/linux/guid_creator.h',
475 'src/common/linux/libcurl_wrapper.cc',
476 'src/common/linux/libcurl_wrapper.h',
477 'src/common/linux/linux_libc_support.cc',
478 'src/common/linux/linux_libc_support.h',
479 'src/common/linux/memory_mapped_file.cc',
480 'src/common/linux/memory_mapped_file.h',
481 'src/common/linux/safe_readlink.cc',
482 'src/common/linux/safe_readlink.h',
483 'src/common/memory.h',
484 'src/common/simple_string_dictionary.cc',
485 'src/common/simple_string_dictionary.h',
486 'src/common/string_conversion.cc',
487 'src/common/string_conversion.h',
491 # Android NDK toolchain doesn't support -mimplicit-it=always
492 ['target_arch=="arm" and OS!="android"', {
493 'cflags': ['-Wa,-mimplicit-it=always'],
495 ['target_arch=="arm" and chromeos==1', {
496 # Avoid running out of registers in
497 # linux_syscall_support.h:sys_clone()'s inline assembly.
502 'src/common/android/include',
504 'direct_dependent_settings': {
506 'src/common/android/include',
510 'src/common/android/breakpad_getcontext.S',
516 # In case of Android, '-ldl' is added in common.gypi, since it
517 # is needed for stlport_static. For LD, the order of libraries
518 # is important, and thus we skip to add it here.
528 'src/third_party/linux/include',
534 # Breakpad r693 uses some files from src/processor in unit tests.
535 'target_name': 'breakpad_processor_support',
536 'type': 'static_library',
539 'src/common/scoped_ptr.h',
540 'src/processor/basic_code_modules.cc',
541 'src/processor/basic_code_modules.h',
542 'src/processor/logging.cc',
543 'src/processor/logging.h',
544 'src/processor/minidump.cc',
545 'src/processor/pathname_stripper.cc',
546 'src/processor/pathname_stripper.h',
552 'src/third_party/linux/include',
558 'target_name': 'breakpad_unittests',
559 'type': 'executable',
561 '../testing/gtest.gyp:gtest',
562 '../testing/gtest.gyp:gtest_main',
563 '../testing/gmock.gyp:gmock',
565 'breakpad_processor_support',
566 'linux_dumper_unittest_helper',
570 'linux/breakpad_googletest_includes.h',
571 'src/client/linux/handler/exception_handler_unittest.cc',
572 'src/client/linux/minidump_writer/cpu_set_unittest.cc',
573 'src/client/linux/minidump_writer/directory_reader_unittest.cc',
574 'src/client/linux/minidump_writer/line_reader_unittest.cc',
575 'src/client/linux/minidump_writer/linux_core_dumper_unittest.cc',
576 'src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc',
577 'src/client/linux/minidump_writer/minidump_writer_unittest.cc',
578 'src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc',
579 'src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc',
580 'src/common/linux/elf_core_dump_unittest.cc',
581 'src/common/linux/file_id_unittest.cc',
582 'src/common/linux/linux_libc_support_unittest.cc',
583 'src/common/linux/synth_elf.cc',
584 'src/common/linux/tests/auto_testfile.h',
585 'src/common/linux/tests/crash_generator.cc',
586 'src/common/linux/tests/crash_generator.h',
587 'src/common/memory_range.h',
588 'src/common/memory_unittest.cc',
589 'src/common/simple_string_dictionary_unittest.cc',
590 'src/common/test_assembler.cc',
591 'src/common/tests/file_utils.cc',
592 'src/common/tests/file_utils.h',
593 'src/tools/linux/md2core/minidump_memory_range.h',
594 'src/tools/linux/md2core/minidump_memory_range_unittest.cc',
598 'linux', # Use our copy of breakpad_googletest_includes.h
606 # See http://crbug.com/138571#c18
615 'src/common/android/include',
618 'src/common/android/breakpad_getcontext_unittest.cc',
624 'target_name': 'linux_dumper_unittest_helper',
625 'type': 'executable',
627 'breakpad_processor_support',
630 'src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc',
638 ['target_arch=="mipsel" and OS=="android"', {
640 'src/common/android/include',
646 'target_name': 'generate_test_dump',
647 'type': 'executable',
650 'linux/generate-test-dump.cc',
667 'src/common/android/include',
673 'target_name': 'minidump-2-core',
674 'type': 'executable',
677 'src/tools/linux/md2core/minidump-2-core.cc'
690 'target_name': 'core-2-minidump',
691 'type': 'executable',
694 'src/tools/linux/core2md/core2md.cc'
711 'target_name': 'breakpad_client',
712 'type': 'static_library',
714 'src/client/ios/Breakpad.h',
715 'src/client/ios/Breakpad.mm',
716 'src/client/ios/BreakpadController.h',
717 'src/client/ios/BreakpadController.mm',
718 'src/client/ios/handler/ios_exception_minidump_generator.mm',
719 'src/client/ios/handler/ios_exception_minidump_generator.h',
720 'src/client/mac/crash_generation/ConfigFile.h',
721 'src/client/mac/crash_generation/ConfigFile.mm',
722 'src/client/mac/handler/breakpad_nlist_64.cc',
723 'src/client/mac/handler/breakpad_nlist_64.h',
724 'src/client/mac/handler/dynamic_images.cc',
725 'src/client/mac/handler/dynamic_images.h',
726 'src/client/mac/handler/protected_memory_allocator.cc',
727 'src/client/mac/handler/protected_memory_allocator.h',
728 'src/client/mac/handler/exception_handler.cc',
729 'src/client/mac/handler/exception_handler.h',
730 'src/client/mac/handler/minidump_generator.cc',
731 'src/client/mac/handler/minidump_generator.h',
732 'src/client/mac/sender/uploader.h',
733 'src/client/mac/sender/uploader.mm',
734 'src/client/minidump_file_writer.cc',
735 'src/client/minidump_file_writer.h',
736 'src/client/minidump_file_writer-inl.h',
737 'src/common/convert_UTF.c',
738 'src/common/convert_UTF.h',
739 'src/common/mac/file_id.cc',
740 'src/common/mac/file_id.h',
741 'src/common/mac/HTTPMultipartUpload.m',
742 'src/common/mac/macho_id.cc',
743 'src/common/mac/macho_id.h',
744 'src/common/mac/macho_utilities.cc',
745 'src/common/mac/macho_utilities.h',
746 'src/common/mac/macho_walker.cc',
747 'src/common/mac/macho_walker.h',
748 'src/common/mac/string_utilities.cc',
749 'src/common/mac/string_utilities.h',
752 'src/common/simple_string_dictionary.cc',
753 'src/common/simple_string_dictionary.h',
754 'src/common/string_conversion.cc',
755 'src/common/string_conversion.h',
756 'src/google_breakpad/common/minidump_format.h',
760 'src/client/mac/Framework',
766 ['OS=="ios" and "<(GENERATOR)"!="ninja"', {
768 'ninja_output_dir': 'ninja-breakpad',
770 '<(DEPTH)/xcodebuild/<(ninja_output_dir)/<(CONFIGURATION_NAME)',
772 # Generation is done via two actions: (1) compiling the executable with
773 # ninja, and (2) copying the executable into a location that is shared
774 # with other projects. These actions are separated into two targets in
775 # order to be able to specify that the second action should not run until
776 # the first action finishes (since the ordering of multiple actions in
777 # one target is defined only by inputs and outputs, and it's impossible
778 # to set correct inputs for the ninja build, so setting all the inputs
779 # and outputs isn't an option).
782 'target_name': 'compile_breakpad_utilities',
787 'breakpad/breakpad.gyp',
790 'includes': ['../build/ios/mac_build.gypi'],
793 'action_name': 'compile breakpad utilities',
801 'message': 'Generating the breakpad executables',
806 'target_name': 'breakpad_utilities',
809 'compile_breakpad_utilities',
813 'action_name': 'copy dump_syms',
815 '<(ninja_product_dir)/dump_syms',
818 '<(PRODUCT_DIR)/dump_syms',
822 '<(ninja_product_dir)/dump_syms',
823 '<(PRODUCT_DIR)/dump_syms',
827 'action_name': 'copy symupload',
829 '<(ninja_product_dir)/symupload',
832 '<(PRODUCT_DIR)/symupload',
836 '<(ninja_product_dir)/symupload',
837 '<(PRODUCT_DIR)/symupload',
843 'target_name': 'dump_syms',
846 'breakpad_utilities',
850 'target_name': 'symupload',
853 'breakpad_utilities',
861 'target_name': 'breakpad_unittests_stripped',
863 'dependencies': [ 'breakpad_unittests' ],
865 'action_name': 'strip breakpad_unittests',
866 'inputs': [ '<(PRODUCT_DIR)/breakpad_unittests' ],
867 'outputs': [ '<(PRODUCT_DIR)/breakpad_unittests_stripped' ],
868 'action': [ '<(android_strip)', '<@(_inputs)', '-o', '<@(_outputs)' ],