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_mips.cc',
52 'src/processor/stackwalker_mips.h',
53 'src/processor/stackwalker_ppc.cc',
54 'src/processor/stackwalker_ppc.h',
55 'src/processor/stackwalker_ppc64.cc',
56 'src/processor/stackwalker_ppc64.h',
57 'src/processor/stackwalker_sparc.cc',
58 'src/processor/stackwalker_sparc.h',
59 'src/processor/stackwalker_x86.cc',
60 'src/processor/stackwalker_x86.h',
61 'src/processor/tokenize.cc',
62 'src/processor/tokenize.h',
64 'src/third_party/libdisasm/ia32_implicit.c',
65 'src/third_party/libdisasm/ia32_implicit.h',
66 'src/third_party/libdisasm/ia32_insn.c',
67 'src/third_party/libdisasm/ia32_insn.h',
68 'src/third_party/libdisasm/ia32_invariant.c',
69 'src/third_party/libdisasm/ia32_invariant.h',
70 'src/third_party/libdisasm/ia32_modrm.c',
71 'src/third_party/libdisasm/ia32_modrm.h',
72 'src/third_party/libdisasm/ia32_opcode_tables.c',
73 'src/third_party/libdisasm/ia32_opcode_tables.h',
74 'src/third_party/libdisasm/ia32_operand.c',
75 'src/third_party/libdisasm/ia32_operand.h',
76 'src/third_party/libdisasm/ia32_reg.c',
77 'src/third_party/libdisasm/ia32_reg.h',
78 'src/third_party/libdisasm/ia32_settings.c',
79 'src/third_party/libdisasm/ia32_settings.h',
80 'src/third_party/libdisasm/libdis.h',
81 'src/third_party/libdisasm/qword.h',
82 'src/third_party/libdisasm/x86_disasm.c',
83 'src/third_party/libdisasm/x86_format.c',
84 'src/third_party/libdisasm/x86_imm.c',
85 'src/third_party/libdisasm/x86_imm.h',
86 'src/third_party/libdisasm/x86_insn.c',
87 'src/third_party/libdisasm/x86_misc.c',
88 'src/third_party/libdisasm/x86_operand_list.c',
89 'src/third_party/libdisasm/x86_operand_list.h',
93 'target_name': 'minidump_dump',
95 'includes': ['breakpad_tools.gypi'],
97 'src/processor/basic_code_module.h',
98 'src/processor/basic_code_modules.cc',
99 'src/processor/basic_code_modules.h',
100 'src/processor/logging.cc',
101 'src/processor/logging.h',
102 'src/processor/minidump.cc',
103 'src/processor/minidump_dump.cc',
104 'src/processor/pathname_stripper.cc',
105 'src/processor/pathname_stripper.h',
110 ['OS=="mac" or (OS=="ios" and "<(GENERATOR)"=="ninja")', {
118 # This is needed for GTMLogger to work correctly.
126 'target_name': 'dump_syms',
127 'type': 'executable',
128 'toolsets': ['host'],
133 'src/common/dwarf/bytereader.cc',
134 'src/common/dwarf_cfi_to_module.cc',
135 'src/common/dwarf_cu_to_module.cc',
136 'src/common/dwarf/dwarf2diehandler.cc',
137 'src/common/dwarf/dwarf2reader.cc',
138 'src/common/dwarf_line_to_module.cc',
139 'src/common/language.cc',
140 'src/common/mac/arch_utilities.cc',
141 'src/common/mac/arch_utilities.h',
142 'src/common/mac/dump_syms.mm',
143 'src/common/mac/file_id.cc',
144 'src/common/mac/macho_id.cc',
145 'src/common/mac/macho_reader.cc',
146 'src/common/mac/macho_utilities.cc',
147 'src/common/mac/macho_walker.cc',
149 'src/common/module.cc',
150 'src/common/stabs_reader.cc',
151 'src/common/stabs_to_module.cc',
152 'src/tools/mac/dump_syms/dump_syms_tool.mm',
155 # For src/common/stabs_reader.h.
156 'HAVE_MACH_O_NLIST_H',
159 # Like ld, dump_syms needs to operate on enough data that it may
160 # actually need to be able to address more than 4GB. Use x86_64.
161 # Don't worry! An x86_64 dump_syms is perfectly able to dump
167 # The DWARF utilities require -funsigned-char.
168 'GCC_CHAR_IS_UNSIGNED_CHAR': 'YES',
170 # dwarf2reader.cc uses dynamic_cast.
171 'GCC_ENABLE_CPP_RTTI': 'YES',
175 '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
181 # dump_syms crashes when built at -O1, -O2, and -O3. It does
182 # not crash at -Os. To play it safe, dump_syms is always built
183 # at -O0 until this can be sorted out.
184 # http://code.google.com/p/google-breakpad/issues/detail?id=329
185 'GCC_OPTIMIZATION_LEVEL': '0', # -O0
191 'target_name': 'symupload',
192 'type': 'executable',
193 'toolsets': ['host'],
198 'src/common/mac/HTTPMultipartUpload.m',
199 'src/tools/mac/symupload/symupload.m',
203 '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
217 # This is needed for GTMLogger to work correctly.
225 'target_name': 'breakpad_utilities',
226 'type': 'static_library',
228 'src/client/mac/handler/breakpad_nlist_64.cc',
229 'src/client/mac/handler/dynamic_images.cc',
230 'src/client/mac/handler/minidump_generator.cc',
231 'src/client/minidump_file_writer.cc',
232 'src/common/convert_UTF.c',
233 'src/common/mac/MachIPC.mm',
234 'src/common/mac/arch_utilities.cc',
235 'src/common/mac/bootstrap_compat.cc',
236 'src/common/mac/file_id.cc',
237 'src/common/mac/macho_id.cc',
238 'src/common/mac/macho_utilities.cc',
239 'src/common/mac/macho_walker.cc',
240 'src/common/mac/string_utilities.cc',
242 'src/common/simple_string_dictionary.cc',
243 'src/common/string_conversion.cc',
247 'target_name': 'crash_inspector',
248 'type': 'executable',
253 'breakpad_utilities',
256 'src/client/apple/Framework',
260 'src/client/mac/crash_generation/ConfigFile.mm',
261 'src/client/mac/crash_generation/Inspector.mm',
262 'src/client/mac/crash_generation/InspectorMain.mm',
266 '$(SDKROOT)/System/Library/Frameworks/CoreServices.framework',
267 '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
272 'target_name': 'crash_report_sender',
273 'type': 'executable',
282 'src/common/mac/HTTPMultipartUpload.m',
283 'src/client/mac/sender/crash_report_sender.m',
284 'src/client/mac/sender/uploader.mm',
285 'src/common/mac/GTMLogger.m',
287 'mac_bundle_resources': [
288 'src/client/mac/sender/English.lproj/Localizable.strings',
289 'src/client/mac/sender/crash_report_sender.icns',
290 'src/client/mac/sender/Breakpad.xib',
291 'src/client/mac/sender/crash_report_sender-Info.plist',
293 'mac_bundle_resources!': [
294 'src/client/mac/sender/crash_report_sender-Info.plist',
297 'INFOPLIST_FILE': 'src/client/mac/sender/crash_report_sender-Info.plist',
301 '$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
302 '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
303 '$(SDKROOT)/System/Library/Frameworks/SystemConfiguration.framework',
308 'target_name': 'breakpad',
309 'type': 'static_library',
311 'breakpad_utilities',
313 'crash_report_sender',
316 'src/client/apple/Framework',
318 'direct_dependent_settings': {
320 'src/client/apple/Framework',
324 'USE_PROTECTED_ALLOCATIONS=1',
327 'src/client/mac/crash_generation/crash_generation_client.cc',
328 'src/client/mac/crash_generation/crash_generation_client.h',
329 'src/client/mac/handler/protected_memory_allocator.cc',
330 'src/client/mac/handler/exception_handler.cc',
331 'src/client/mac/Framework/Breakpad.mm',
332 'src/client/mac/Framework/OnDemandServer.mm',
337 [ 'OS=="linux" or OS=="android"', {
345 # Tools needed for archiving build symbols.
348 'target_name': 'symupload',
349 'type': 'executable',
351 'includes': ['breakpad_tools.gypi'],
354 'src/tools/linux/symupload/sym_upload.cc',
355 'src/common/linux/http_upload.cc',
356 'src/common/linux/http_upload.h',
369 'target_name': 'dump_syms',
370 'type': 'executable',
373 'toolsets': [ 'host' ],
377 # dwarf2reader.cc uses dynamic_cast. Because we don't typically
378 # don't support RTTI, we enable it for this single target. Since
379 # dump_syms doesn't share any object files with anything else,
380 # this doesn't end up polluting Chrome itself.
381 'cflags_cc!': ['-fno-rtti'],
384 'src/common/dwarf/bytereader.cc',
385 'src/common/dwarf_cfi_to_module.cc',
386 'src/common/dwarf_cfi_to_module.h',
387 'src/common/dwarf_cu_to_module.cc',
388 'src/common/dwarf_cu_to_module.h',
389 'src/common/dwarf/dwarf2diehandler.cc',
390 'src/common/dwarf/dwarf2reader.cc',
391 'src/common/dwarf_line_to_module.cc',
392 'src/common/dwarf_line_to_module.h',
393 'src/common/language.cc',
394 'src/common/language.h',
395 'src/common/linux/dump_symbols.cc',
396 'src/common/linux/dump_symbols.h',
397 'src/common/linux/elf_symbols_to_module.cc',
398 'src/common/linux/elf_symbols_to_module.h',
399 'src/common/linux/elfutils.cc',
400 'src/common/linux/elfutils.h',
401 'src/common/linux/file_id.cc',
402 'src/common/linux/file_id.h',
403 'src/common/linux/linux_libc_support.cc',
404 'src/common/linux/linux_libc_support.h',
405 'src/common/linux/memory_mapped_file.cc',
406 'src/common/linux/memory_mapped_file.h',
407 'src/common/linux/guid_creator.h',
408 'src/common/module.cc',
409 'src/common/module.h',
410 'src/common/stabs_reader.cc',
411 'src/common/stabs_reader.h',
412 'src/common/stabs_to_module.cc',
413 'src/common/stabs_to_module.h',
414 'src/tools/linux/dump_syms/dump_syms.cc',
417 # Breakpad rev 583 introduced this flag.
418 # Using this define, stabs_reader.h will include a.out.h to
430 'target_name': 'breakpad_client',
431 'type': 'static_library',
434 'src/client/linux/crash_generation/crash_generation_client.cc',
435 'src/client/linux/crash_generation/crash_generation_client.h',
436 'src/client/linux/handler/exception_handler.cc',
437 'src/client/linux/handler/exception_handler.h',
438 'src/client/linux/handler/minidump_descriptor.cc',
439 'src/client/linux/handler/minidump_descriptor.h',
440 'src/client/linux/log/log.cc',
441 'src/client/linux/log/log.h',
442 'src/client/linux/minidump_writer/cpu_set.h',
443 'src/client/linux/minidump_writer/directory_reader.h',
444 'src/client/linux/minidump_writer/line_reader.h',
445 'src/client/linux/minidump_writer/linux_core_dumper.cc',
446 'src/client/linux/minidump_writer/linux_core_dumper.h',
447 'src/client/linux/minidump_writer/linux_dumper.cc',
448 'src/client/linux/minidump_writer/linux_dumper.h',
449 'src/client/linux/minidump_writer/linux_ptrace_dumper.cc',
450 'src/client/linux/minidump_writer/linux_ptrace_dumper.h',
451 'src/client/linux/minidump_writer/minidump_writer.cc',
452 'src/client/linux/minidump_writer/minidump_writer.h',
453 'src/client/linux/minidump_writer/proc_cpuinfo_reader.h',
454 'src/client/minidump_file_writer-inl.h',
455 'src/client/minidump_file_writer.cc',
456 'src/client/minidump_file_writer.h',
457 'src/common/convert_UTF.c',
458 'src/common/convert_UTF.h',
459 'src/common/linux/elf_core_dump.cc',
460 'src/common/linux/elf_core_dump.h',
461 'src/common/linux/elfutils.cc',
462 'src/common/linux/elfutils.h',
463 'src/common/linux/file_id.cc',
464 'src/common/linux/file_id.h',
465 'src/common/linux/google_crashdump_uploader.cc',
466 'src/common/linux/google_crashdump_uploader.h',
467 'src/common/linux/guid_creator.cc',
468 'src/common/linux/guid_creator.h',
469 'src/common/linux/libcurl_wrapper.cc',
470 'src/common/linux/libcurl_wrapper.h',
471 'src/common/linux/linux_libc_support.cc',
472 'src/common/linux/linux_libc_support.h',
473 'src/common/linux/memory_mapped_file.cc',
474 'src/common/linux/memory_mapped_file.h',
475 'src/common/linux/safe_readlink.cc',
476 'src/common/linux/safe_readlink.h',
477 'src/common/memory.h',
478 'src/common/simple_string_dictionary.cc',
479 'src/common/simple_string_dictionary.h',
480 'src/common/string_conversion.cc',
481 'src/common/string_conversion.h',
485 # Android NDK toolchain doesn't support -mimplicit-it=always
486 ['target_arch=="arm" and OS!="android"', {
487 'cflags': ['-Wa,-mimplicit-it=always'],
489 ['target_arch=="arm" and chromeos==1', {
490 # Avoid running out of registers in
491 # linux_syscall_support.h:sys_clone()'s inline assembly.
496 'src/common/android/include',
498 'direct_dependent_settings': {
500 'src/common/android/include',
504 'src/common/android/breakpad_getcontext.S',
510 # In case of Android, '-ldl' is added in common.gypi, since it
511 # is needed for stlport_static. For LD, the order of libraries
512 # is important, and thus we skip to add it here.
522 'src/third_party/linux/include',
528 # Breakpad r693 uses some files from src/processor in unit tests.
529 'target_name': 'breakpad_processor_support',
530 'type': 'static_library',
533 'src/common/scoped_ptr.h',
534 'src/processor/basic_code_modules.cc',
535 'src/processor/basic_code_modules.h',
536 'src/processor/logging.cc',
537 'src/processor/logging.h',
538 'src/processor/minidump.cc',
539 'src/processor/pathname_stripper.cc',
540 'src/processor/pathname_stripper.h',
546 'src/third_party/linux/include',
552 'target_name': 'breakpad_unittests',
553 'type': 'executable',
555 '../testing/gtest.gyp:gtest',
556 '../testing/gtest.gyp:gtest_main',
557 '../testing/gmock.gyp:gmock',
559 'breakpad_processor_support',
560 'linux_dumper_unittest_helper',
564 'linux/breakpad_googletest_includes.h',
565 'src/client/linux/handler/exception_handler_unittest.cc',
566 'src/client/linux/minidump_writer/cpu_set_unittest.cc',
567 'src/client/linux/minidump_writer/directory_reader_unittest.cc',
568 'src/client/linux/minidump_writer/line_reader_unittest.cc',
569 'src/client/linux/minidump_writer/linux_core_dumper_unittest.cc',
570 'src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc',
571 'src/client/linux/minidump_writer/minidump_writer_unittest.cc',
572 'src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc',
573 'src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc',
574 'src/common/linux/elf_core_dump_unittest.cc',
575 'src/common/linux/file_id_unittest.cc',
576 'src/common/linux/linux_libc_support_unittest.cc',
577 'src/common/linux/synth_elf.cc',
578 'src/common/linux/tests/crash_generator.cc',
579 'src/common/linux/tests/crash_generator.h',
580 'src/common/memory_range.h',
581 'src/common/memory_unittest.cc',
582 'src/common/simple_string_dictionary_unittest.cc',
583 'src/common/test_assembler.cc',
584 'src/common/tests/auto_testfile.h',
585 'src/common/tests/file_utils.cc',
586 'src/common/tests/file_utils.h',
587 'src/tools/linux/md2core/minidump_memory_range.h',
588 'src/tools/linux/md2core/minidump_memory_range_unittest.cc',
592 'linux', # Use our copy of breakpad_googletest_includes.h
600 # See http://crbug.com/138571#c18
609 'src/common/android/include',
615 'target_name': 'linux_dumper_unittest_helper',
616 'type': 'executable',
618 'breakpad_processor_support',
621 'src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc',
629 ['target_arch=="mipsel" and OS=="android"', {
631 'src/common/android/include',
637 'target_name': 'generate_test_dump',
638 'type': 'executable',
641 'linux/generate-test-dump.cc',
658 'src/common/android/include',
664 'target_name': 'minidump-2-core',
665 'type': 'executable',
668 'src/tools/linux/md2core/minidump-2-core.cc'
681 'target_name': 'core-2-minidump',
682 'type': 'executable',
685 'src/tools/linux/core2md/core2md.cc'
702 'target_name': 'breakpad_client',
703 'type': 'static_library',
705 'src/client/ios/Breakpad.h',
706 'src/client/ios/Breakpad.mm',
707 'src/client/ios/BreakpadController.h',
708 'src/client/ios/BreakpadController.mm',
709 'src/client/ios/handler/ios_exception_minidump_generator.mm',
710 'src/client/ios/handler/ios_exception_minidump_generator.h',
711 'src/client/mac/crash_generation/ConfigFile.h',
712 'src/client/mac/crash_generation/ConfigFile.mm',
713 'src/client/mac/handler/breakpad_nlist_64.cc',
714 'src/client/mac/handler/breakpad_nlist_64.h',
715 'src/client/mac/handler/dynamic_images.cc',
716 'src/client/mac/handler/dynamic_images.h',
717 'src/client/mac/handler/protected_memory_allocator.cc',
718 'src/client/mac/handler/protected_memory_allocator.h',
719 'src/client/mac/handler/exception_handler.cc',
720 'src/client/mac/handler/exception_handler.h',
721 'src/client/mac/handler/minidump_generator.cc',
722 'src/client/mac/handler/minidump_generator.h',
723 'src/client/mac/sender/uploader.h',
724 'src/client/mac/sender/uploader.mm',
725 'src/client/minidump_file_writer.cc',
726 'src/client/minidump_file_writer.h',
727 'src/client/minidump_file_writer-inl.h',
728 'src/common/convert_UTF.c',
729 'src/common/convert_UTF.h',
730 'src/common/mac/file_id.cc',
731 'src/common/mac/file_id.h',
732 'src/common/mac/HTTPMultipartUpload.m',
733 'src/common/mac/macho_id.cc',
734 'src/common/mac/macho_id.h',
735 'src/common/mac/macho_utilities.cc',
736 'src/common/mac/macho_utilities.h',
737 'src/common/mac/macho_walker.cc',
738 'src/common/mac/macho_walker.h',
739 'src/common/mac/string_utilities.cc',
740 'src/common/mac/string_utilities.h',
743 'src/common/simple_string_dictionary.cc',
744 'src/common/simple_string_dictionary.h',
745 'src/common/string_conversion.cc',
746 'src/common/string_conversion.h',
747 'src/google_breakpad/common/minidump_format.h',
751 'src/client/mac/Framework',
754 '<(DEPTH)/third_party/GTM',
755 '<(DEPTH)/third_party/GTM/Foundation',
758 # Build the version of GTMLogger.m in third_party rather than the
759 # one in src/common/mac because the former catches all exceptions
760 # whereas the latter lets them propagate, which can cause odd
763 '<(DEPTH)/third_party/GTM/Foundation/GTMLogger.h',
764 '<(DEPTH)/third_party/GTM/Foundation/GTMLogger.m',
767 '<(DEPTH)/third_party/GTM',
768 '<(DEPTH)/third_party/GTM/Foundation',
774 ['OS=="ios" and "<(GENERATOR)"!="ninja"', {
776 'ninja_output_dir': 'ninja-breakpad',
778 '<(DEPTH)/xcodebuild/<(ninja_output_dir)/<(CONFIGURATION_NAME)',
780 # Generation is done via two actions: (1) compiling the executable with
781 # ninja, and (2) copying the executable into a location that is shared
782 # with other projects. These actions are separated into two targets in
783 # order to be able to specify that the second action should not run until
784 # the first action finishes (since the ordering of multiple actions in
785 # one target is defined only by inputs and outputs, and it's impossible
786 # to set correct inputs for the ninja build, so setting all the inputs
787 # and outputs isn't an option).
790 'target_name': 'compile_breakpad_utilities',
795 'breakpad/breakpad.gyp',
798 'includes': ['../build/ios/mac_build.gypi'],
801 'action_name': 'compile breakpad utilities',
809 'message': 'Generating the breakpad executables',
814 'target_name': 'breakpad_utilities',
817 'compile_breakpad_utilities',
821 'action_name': 'copy dump_syms',
823 '<(ninja_product_dir)/dump_syms',
826 '<(PRODUCT_DIR)/dump_syms',
830 '<(ninja_product_dir)/dump_syms',
831 '<(PRODUCT_DIR)/dump_syms',
835 'action_name': 'copy symupload',
837 '<(ninja_product_dir)/symupload',
840 '<(PRODUCT_DIR)/symupload',
844 '<(ninja_product_dir)/symupload',
845 '<(PRODUCT_DIR)/symupload',
851 'target_name': 'dump_syms',
854 'breakpad_utilities',
858 'target_name': 'symupload',
861 'breakpad_utilities',