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"', {
343 # Tools needed for archiving build symbols.
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
428 'target_name': 'breakpad_client',
429 'type': 'static_library',
432 'src/client/linux/crash_generation/crash_generation_client.cc',
433 'src/client/linux/crash_generation/crash_generation_client.h',
434 'src/client/linux/handler/exception_handler.cc',
435 'src/client/linux/handler/exception_handler.h',
436 'src/client/linux/handler/minidump_descriptor.cc',
437 'src/client/linux/handler/minidump_descriptor.h',
438 'src/client/linux/log/log.cc',
439 'src/client/linux/log/log.h',
440 'src/client/linux/minidump_writer/cpu_set.h',
441 'src/client/linux/minidump_writer/directory_reader.h',
442 'src/client/linux/minidump_writer/line_reader.h',
443 'src/client/linux/minidump_writer/linux_core_dumper.cc',
444 'src/client/linux/minidump_writer/linux_core_dumper.h',
445 'src/client/linux/minidump_writer/linux_dumper.cc',
446 'src/client/linux/minidump_writer/linux_dumper.h',
447 'src/client/linux/minidump_writer/linux_ptrace_dumper.cc',
448 'src/client/linux/minidump_writer/linux_ptrace_dumper.h',
449 'src/client/linux/minidump_writer/minidump_writer.cc',
450 'src/client/linux/minidump_writer/minidump_writer.h',
451 'src/client/linux/minidump_writer/proc_cpuinfo_reader.h',
452 'src/client/minidump_file_writer-inl.h',
453 'src/client/minidump_file_writer.cc',
454 'src/client/minidump_file_writer.h',
455 'src/common/convert_UTF.c',
456 'src/common/convert_UTF.h',
457 'src/common/linux/elf_core_dump.cc',
458 'src/common/linux/elf_core_dump.h',
459 'src/common/linux/elfutils.cc',
460 'src/common/linux/elfutils.h',
461 'src/common/linux/file_id.cc',
462 'src/common/linux/file_id.h',
463 'src/common/linux/google_crashdump_uploader.cc',
464 'src/common/linux/google_crashdump_uploader.h',
465 'src/common/linux/guid_creator.cc',
466 'src/common/linux/guid_creator.h',
467 'src/common/linux/libcurl_wrapper.cc',
468 'src/common/linux/libcurl_wrapper.h',
469 'src/common/linux/linux_libc_support.cc',
470 'src/common/linux/linux_libc_support.h',
471 'src/common/linux/memory_mapped_file.cc',
472 'src/common/linux/memory_mapped_file.h',
473 'src/common/linux/safe_readlink.cc',
474 'src/common/linux/safe_readlink.h',
475 'src/common/memory.h',
476 'src/common/simple_string_dictionary.cc',
477 'src/common/simple_string_dictionary.h',
478 'src/common/string_conversion.cc',
479 'src/common/string_conversion.h',
483 # Android NDK toolchain doesn't support -mimplicit-it=always
484 ['target_arch=="arm" and OS!="android"', {
485 'cflags': ['-Wa,-mimplicit-it=always'],
487 ['target_arch=="arm" and chromeos==1', {
488 # Avoid running out of registers in
489 # linux_syscall_support.h:sys_clone()'s inline assembly.
494 'src/common/android/include',
496 'direct_dependent_settings': {
498 'src/common/android/include',
502 'src/common/android/breakpad_getcontext.S',
516 'src/third_party/linux/include',
522 # Breakpad r693 uses some files from src/processor in unit tests.
523 'target_name': 'breakpad_processor_support',
524 'type': 'static_library',
527 'src/common/scoped_ptr.h',
528 'src/processor/basic_code_modules.cc',
529 'src/processor/basic_code_modules.h',
530 'src/processor/logging.cc',
531 'src/processor/logging.h',
532 'src/processor/minidump.cc',
533 'src/processor/pathname_stripper.cc',
534 'src/processor/pathname_stripper.h',
540 'src/third_party/linux/include',
546 'target_name': 'breakpad_unittests',
547 'type': 'executable',
549 '../testing/gtest.gyp:gtest',
550 '../testing/gtest.gyp:gtest_main',
551 '../testing/gmock.gyp:gmock',
553 'breakpad_processor_support',
554 'linux_dumper_unittest_helper',
558 'linux/breakpad_googletest_includes.h',
559 'src/client/linux/handler/exception_handler_unittest.cc',
560 'src/client/linux/minidump_writer/cpu_set_unittest.cc',
561 'src/client/linux/minidump_writer/directory_reader_unittest.cc',
562 'src/client/linux/minidump_writer/line_reader_unittest.cc',
563 'src/client/linux/minidump_writer/linux_core_dumper_unittest.cc',
564 'src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc',
565 'src/client/linux/minidump_writer/minidump_writer_unittest.cc',
566 'src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc',
567 'src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc',
568 'src/common/linux/elf_core_dump_unittest.cc',
569 'src/common/linux/file_id_unittest.cc',
570 'src/common/linux/linux_libc_support_unittest.cc',
571 'src/common/linux/synth_elf.cc',
572 'src/common/linux/tests/crash_generator.cc',
573 'src/common/linux/tests/crash_generator.h',
574 'src/common/memory_range.h',
575 'src/common/memory_unittest.cc',
576 'src/common/simple_string_dictionary_unittest.cc',
577 'src/common/test_assembler.cc',
578 'src/common/tests/auto_testfile.h',
579 'src/common/tests/file_utils.cc',
580 'src/common/tests/file_utils.h',
581 'src/tools/linux/md2core/minidump_memory_range.h',
582 'src/tools/linux/md2core/minidump_memory_range_unittest.cc',
586 'linux', # Use our copy of breakpad_googletest_includes.h
594 # See http://crbug.com/138571#c18
603 'src/common/android/include',
609 'target_name': 'linux_dumper_unittest_helper',
610 'type': 'executable',
612 'breakpad_processor_support',
615 'src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc',
624 'target_name': 'generate_test_dump',
625 'type': 'executable',
628 'linux/generate-test-dump.cc',
645 'src/common/android/include',
651 'target_name': 'minidump-2-core',
652 'type': 'executable',
655 'src/tools/linux/md2core/minidump-2-core.cc'
668 'target_name': 'core-2-minidump',
669 'type': 'executable',
672 'src/tools/linux/core2md/core2md.cc'
689 'target_name': 'breakpad_client',
690 'type': 'static_library',
692 'src/client/ios/Breakpad.h',
693 'src/client/ios/Breakpad.mm',
694 'src/client/ios/BreakpadController.h',
695 'src/client/ios/BreakpadController.mm',
696 'src/client/ios/handler/ios_exception_minidump_generator.mm',
697 'src/client/ios/handler/ios_exception_minidump_generator.h',
698 'src/client/mac/crash_generation/ConfigFile.h',
699 'src/client/mac/crash_generation/ConfigFile.mm',
700 'src/client/mac/handler/breakpad_nlist_64.cc',
701 'src/client/mac/handler/breakpad_nlist_64.h',
702 'src/client/mac/handler/dynamic_images.cc',
703 'src/client/mac/handler/dynamic_images.h',
704 'src/client/mac/handler/protected_memory_allocator.cc',
705 'src/client/mac/handler/protected_memory_allocator.h',
706 'src/client/mac/handler/exception_handler.cc',
707 'src/client/mac/handler/exception_handler.h',
708 'src/client/mac/handler/minidump_generator.cc',
709 'src/client/mac/handler/minidump_generator.h',
710 'src/client/mac/sender/uploader.h',
711 'src/client/mac/sender/uploader.mm',
712 'src/client/minidump_file_writer.cc',
713 'src/client/minidump_file_writer.h',
714 'src/client/minidump_file_writer-inl.h',
715 'src/common/convert_UTF.c',
716 'src/common/convert_UTF.h',
717 'src/common/mac/file_id.cc',
718 'src/common/mac/file_id.h',
719 'src/common/mac/HTTPMultipartUpload.m',
720 'src/common/mac/macho_id.cc',
721 'src/common/mac/macho_id.h',
722 'src/common/mac/macho_utilities.cc',
723 'src/common/mac/macho_utilities.h',
724 'src/common/mac/macho_walker.cc',
725 'src/common/mac/macho_walker.h',
726 'src/common/mac/string_utilities.cc',
727 'src/common/mac/string_utilities.h',
730 'src/common/simple_string_dictionary.cc',
731 'src/common/simple_string_dictionary.h',
732 'src/common/string_conversion.cc',
733 'src/common/string_conversion.h',
734 'src/google_breakpad/common/minidump_format.h',
738 'src/client/mac/Framework',
741 '<(DEPTH)/third_party/GTM',
742 '<(DEPTH)/third_party/GTM/Foundation',
745 # Build the version of GTMLogger.m in third_party rather than the
746 # one in src/common/mac because the former catches all exceptions
747 # whereas the latter lets them propagate, which can cause odd
750 '<(DEPTH)/third_party/GTM/Foundation/GTMLogger.h',
751 '<(DEPTH)/third_party/GTM/Foundation/GTMLogger.m',
754 '<(DEPTH)/third_party/GTM',
755 '<(DEPTH)/third_party/GTM/Foundation',
761 ['OS=="ios" and "<(GENERATOR)"!="ninja"', {
763 'ninja_output_dir': 'ninja-breakpad',
765 '<(DEPTH)/xcodebuild/<(ninja_output_dir)/<(CONFIGURATION_NAME)',
767 # Generation is done via two actions: (1) compiling the executable with
768 # ninja, and (2) copying the executable into a location that is shared
769 # with other projects. These actions are separated into two targets in
770 # order to be able to specify that the second action should not run until
771 # the first action finishes (since the ordering of multiple actions in
772 # one target is defined only by inputs and outputs, and it's impossible
773 # to set correct inputs for the ninja build, so setting all the inputs
774 # and outputs isn't an option).
777 'target_name': 'compile_breakpad_utilities',
782 'breakpad/breakpad.gyp',
785 'includes': ['../build/ios/mac_build.gypi'],
788 'action_name': 'compile breakpad utilities',
796 'message': 'Generating the breakpad executables',
801 'target_name': 'breakpad_utilities',
804 'compile_breakpad_utilities',
808 'action_name': 'copy dump_syms',
810 '<(ninja_product_dir)/dump_syms',
813 '<(PRODUCT_DIR)/dump_syms',
817 '<(ninja_product_dir)/dump_syms',
818 '<(PRODUCT_DIR)/dump_syms',
822 'action_name': 'copy symupload',
824 '<(ninja_product_dir)/symupload',
827 '<(PRODUCT_DIR)/symupload',
831 '<(ninja_product_dir)/symupload',
832 '<(PRODUCT_DIR)/symupload',
838 'target_name': 'dump_syms',
841 'breakpad_utilities',
845 'target_name': 'symupload',
848 'breakpad_utilities',