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_symbolizer.cc',
49 'src/processor/stackwalker.cc',
50 'src/processor/stackwalker_amd64.cc',
51 'src/processor/stackwalker_amd64.h',
52 'src/processor/stackwalker_arm.cc',
53 'src/processor/stackwalker_arm.h',
54 'src/processor/stackwalker_mips.cc',
55 'src/processor/stackwalker_mips.h',
56 'src/processor/stackwalker_ppc.cc',
57 'src/processor/stackwalker_ppc.h',
58 'src/processor/stackwalker_ppc64.cc',
59 'src/processor/stackwalker_ppc64.h',
60 'src/processor/stackwalker_sparc.cc',
61 'src/processor/stackwalker_sparc.h',
62 'src/processor/stackwalker_x86.cc',
63 'src/processor/stackwalker_x86.h',
64 'src/processor/tokenize.cc',
65 'src/processor/tokenize.h',
67 'src/third_party/libdisasm/ia32_implicit.c',
68 'src/third_party/libdisasm/ia32_implicit.h',
69 'src/third_party/libdisasm/ia32_insn.c',
70 'src/third_party/libdisasm/ia32_insn.h',
71 'src/third_party/libdisasm/ia32_invariant.c',
72 'src/third_party/libdisasm/ia32_invariant.h',
73 'src/third_party/libdisasm/ia32_modrm.c',
74 'src/third_party/libdisasm/ia32_modrm.h',
75 'src/third_party/libdisasm/ia32_opcode_tables.c',
76 'src/third_party/libdisasm/ia32_opcode_tables.h',
77 'src/third_party/libdisasm/ia32_operand.c',
78 'src/third_party/libdisasm/ia32_operand.h',
79 'src/third_party/libdisasm/ia32_reg.c',
80 'src/third_party/libdisasm/ia32_reg.h',
81 'src/third_party/libdisasm/ia32_settings.c',
82 'src/third_party/libdisasm/ia32_settings.h',
83 'src/third_party/libdisasm/libdis.h',
84 'src/third_party/libdisasm/qword.h',
85 'src/third_party/libdisasm/x86_disasm.c',
86 'src/third_party/libdisasm/x86_format.c',
87 'src/third_party/libdisasm/x86_imm.c',
88 'src/third_party/libdisasm/x86_imm.h',
89 'src/third_party/libdisasm/x86_insn.c',
90 'src/third_party/libdisasm/x86_misc.c',
91 'src/third_party/libdisasm/x86_operand_list.c',
92 'src/third_party/libdisasm/x86_operand_list.h',
96 'target_name': 'minidump_dump',
98 'includes': ['breakpad_tools.gypi'],
100 'src/processor/basic_code_module.h',
101 'src/processor/basic_code_modules.cc',
102 'src/processor/basic_code_modules.h',
103 'src/processor/logging.cc',
104 'src/processor/logging.h',
105 'src/processor/minidump.cc',
106 'src/processor/minidump_dump.cc',
107 'src/processor/pathname_stripper.cc',
108 'src/processor/pathname_stripper.h',
113 ['OS=="mac" or (OS=="ios" and "<(GENERATOR)"=="ninja")', {
121 # This is needed for GTMLogger to work correctly.
129 'target_name': 'dump_syms',
130 'type': 'executable',
131 'toolsets': ['host'],
136 'src/common/dwarf/bytereader.cc',
137 'src/common/dwarf_cfi_to_module.cc',
138 'src/common/dwarf_cu_to_module.cc',
139 'src/common/dwarf/dwarf2diehandler.cc',
140 'src/common/dwarf/dwarf2reader.cc',
141 'src/common/dwarf_line_to_module.cc',
142 'src/common/language.cc',
143 'src/common/mac/arch_utilities.cc',
144 'src/common/mac/arch_utilities.h',
145 'src/common/mac/dump_syms.mm',
146 'src/common/mac/file_id.cc',
147 'src/common/mac/macho_id.cc',
148 'src/common/mac/macho_reader.cc',
149 'src/common/mac/macho_utilities.cc',
150 'src/common/mac/macho_walker.cc',
152 'src/common/module.cc',
153 'src/common/stabs_reader.cc',
154 'src/common/stabs_to_module.cc',
155 'src/tools/mac/dump_syms/dump_syms_tool.mm',
158 # For src/common/stabs_reader.h.
159 'HAVE_MACH_O_NLIST_H',
162 # Like ld, dump_syms needs to operate on enough data that it may
163 # actually need to be able to address more than 4GB. Use x86_64.
164 # Don't worry! An x86_64 dump_syms is perfectly able to dump
170 # The DWARF utilities require -funsigned-char.
171 'GCC_CHAR_IS_UNSIGNED_CHAR': 'YES',
173 # dwarf2reader.cc uses dynamic_cast.
174 'GCC_ENABLE_CPP_RTTI': 'YES',
178 '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
184 # dump_syms crashes when built at -O1, -O2, and -O3. It does
185 # not crash at -Os. To play it safe, dump_syms is always built
186 # at -O0 until this can be sorted out.
187 # http://code.google.com/p/google-breakpad/issues/detail?id=329
188 'GCC_OPTIMIZATION_LEVEL': '0', # -O0
194 'target_name': 'symupload',
195 'type': 'executable',
196 'toolsets': ['host'],
201 'src/common/mac/HTTPMultipartUpload.m',
202 'src/tools/mac/symupload/symupload.m',
206 '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
220 # This is needed for GTMLogger to work correctly.
228 'target_name': 'breakpad_utilities',
229 'type': 'static_library',
231 'src/client/mac/handler/breakpad_nlist_64.cc',
232 'src/client/mac/handler/dynamic_images.cc',
233 'src/client/mac/handler/minidump_generator.cc',
234 'src/client/minidump_file_writer.cc',
235 'src/common/convert_UTF.c',
236 'src/common/mac/MachIPC.mm',
237 'src/common/mac/arch_utilities.cc',
238 'src/common/mac/bootstrap_compat.cc',
239 'src/common/mac/file_id.cc',
240 'src/common/mac/macho_id.cc',
241 'src/common/mac/macho_utilities.cc',
242 'src/common/mac/macho_walker.cc',
243 'src/common/mac/string_utilities.cc',
245 'src/common/simple_string_dictionary.cc',
246 'src/common/string_conversion.cc',
250 'target_name': 'crash_inspector',
251 'type': 'executable',
256 'breakpad_utilities',
259 'src/client/apple/Framework',
263 'src/client/mac/crash_generation/ConfigFile.mm',
264 'src/client/mac/crash_generation/Inspector.mm',
265 'src/client/mac/crash_generation/InspectorMain.mm',
269 '$(SDKROOT)/System/Library/Frameworks/CoreServices.framework',
270 '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
275 'target_name': 'crash_report_sender',
276 'type': 'executable',
285 'src/common/mac/HTTPMultipartUpload.m',
286 'src/client/mac/sender/crash_report_sender.m',
287 'src/client/mac/sender/uploader.mm',
288 'src/common/mac/GTMLogger.m',
290 'mac_bundle_resources': [
291 'src/client/mac/sender/English.lproj/Localizable.strings',
292 'src/client/mac/sender/crash_report_sender.icns',
293 'src/client/mac/sender/Breakpad.xib',
294 'src/client/mac/sender/crash_report_sender-Info.plist',
296 'mac_bundle_resources!': [
297 'src/client/mac/sender/crash_report_sender-Info.plist',
300 'INFOPLIST_FILE': 'src/client/mac/sender/crash_report_sender-Info.plist',
304 '$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
305 '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
306 '$(SDKROOT)/System/Library/Frameworks/SystemConfiguration.framework',
311 'target_name': 'breakpad',
312 'type': 'static_library',
314 'breakpad_utilities',
316 'crash_report_sender',
319 'src/client/apple/Framework',
321 'direct_dependent_settings': {
323 'src/client/apple/Framework',
327 'USE_PROTECTED_ALLOCATIONS=1',
330 'src/client/mac/crash_generation/crash_generation_client.cc',
331 'src/client/mac/crash_generation/crash_generation_client.h',
332 'src/client/mac/handler/protected_memory_allocator.cc',
333 'src/client/mac/handler/exception_handler.cc',
334 'src/client/mac/Framework/Breakpad.mm',
335 'src/client/mac/Framework/OnDemandServer.mm',
340 [ 'OS=="linux" or OS=="android"', {
348 # Tools needed for archiving build symbols.
351 'target_name': 'symupload',
352 'type': 'executable',
354 'includes': ['breakpad_tools.gypi'],
357 'src/tools/linux/symupload/sym_upload.cc',
358 'src/common/linux/http_upload.cc',
359 'src/common/linux/http_upload.h',
372 'target_name': 'dump_syms',
373 'type': 'executable',
376 'toolsets': [ 'host' ],
380 # dwarf2reader.cc uses dynamic_cast. Because we don't typically
381 # don't support RTTI, we enable it for this single target. Since
382 # dump_syms doesn't share any object files with anything else,
383 # this doesn't end up polluting Chrome itself.
384 'cflags_cc!': ['-fno-rtti'],
387 'src/common/dwarf/bytereader.cc',
388 'src/common/dwarf_cfi_to_module.cc',
389 'src/common/dwarf_cfi_to_module.h',
390 'src/common/dwarf_cu_to_module.cc',
391 'src/common/dwarf_cu_to_module.h',
392 'src/common/dwarf/dwarf2diehandler.cc',
393 'src/common/dwarf/dwarf2reader.cc',
394 'src/common/dwarf_line_to_module.cc',
395 'src/common/dwarf_line_to_module.h',
396 'src/common/language.cc',
397 'src/common/language.h',
398 'src/common/linux/dump_symbols.cc',
399 'src/common/linux/dump_symbols.h',
400 'src/common/linux/elf_symbols_to_module.cc',
401 'src/common/linux/elf_symbols_to_module.h',
402 'src/common/linux/elfutils.cc',
403 'src/common/linux/elfutils.h',
404 'src/common/linux/file_id.cc',
405 'src/common/linux/file_id.h',
406 'src/common/linux/linux_libc_support.cc',
407 'src/common/linux/linux_libc_support.h',
408 'src/common/linux/memory_mapped_file.cc',
409 'src/common/linux/memory_mapped_file.h',
410 'src/common/linux/guid_creator.h',
411 'src/common/module.cc',
412 'src/common/module.h',
413 'src/common/stabs_reader.cc',
414 'src/common/stabs_reader.h',
415 'src/common/stabs_to_module.cc',
416 'src/common/stabs_to_module.h',
417 'src/tools/linux/dump_syms/dump_syms.cc',
420 # Breakpad rev 583 introduced this flag.
421 # Using this define, stabs_reader.h will include a.out.h to
433 'target_name': 'breakpad_client',
434 'type': 'static_library',
437 'src/client/linux/crash_generation/crash_generation_client.cc',
438 'src/client/linux/crash_generation/crash_generation_client.h',
439 'src/client/linux/handler/exception_handler.cc',
440 'src/client/linux/handler/exception_handler.h',
441 'src/client/linux/handler/minidump_descriptor.cc',
442 'src/client/linux/handler/minidump_descriptor.h',
443 'src/client/linux/log/log.cc',
444 'src/client/linux/log/log.h',
445 'src/client/linux/minidump_writer/cpu_set.h',
446 'src/client/linux/minidump_writer/directory_reader.h',
447 'src/client/linux/minidump_writer/line_reader.h',
448 'src/client/linux/minidump_writer/linux_core_dumper.cc',
449 'src/client/linux/minidump_writer/linux_core_dumper.h',
450 'src/client/linux/minidump_writer/linux_dumper.cc',
451 'src/client/linux/minidump_writer/linux_dumper.h',
452 'src/client/linux/minidump_writer/linux_ptrace_dumper.cc',
453 'src/client/linux/minidump_writer/linux_ptrace_dumper.h',
454 'src/client/linux/minidump_writer/minidump_writer.cc',
455 'src/client/linux/minidump_writer/minidump_writer.h',
456 'src/client/linux/minidump_writer/proc_cpuinfo_reader.h',
457 'src/client/minidump_file_writer-inl.h',
458 'src/client/minidump_file_writer.cc',
459 'src/client/minidump_file_writer.h',
460 'src/common/convert_UTF.c',
461 'src/common/convert_UTF.h',
462 'src/common/linux/elf_core_dump.cc',
463 'src/common/linux/elf_core_dump.h',
464 'src/common/linux/elfutils.cc',
465 'src/common/linux/elfutils.h',
466 'src/common/linux/file_id.cc',
467 'src/common/linux/file_id.h',
468 'src/common/linux/google_crashdump_uploader.cc',
469 'src/common/linux/google_crashdump_uploader.h',
470 'src/common/linux/guid_creator.cc',
471 'src/common/linux/guid_creator.h',
472 'src/common/linux/libcurl_wrapper.cc',
473 'src/common/linux/libcurl_wrapper.h',
474 'src/common/linux/linux_libc_support.cc',
475 'src/common/linux/linux_libc_support.h',
476 'src/common/linux/memory_mapped_file.cc',
477 'src/common/linux/memory_mapped_file.h',
478 'src/common/linux/safe_readlink.cc',
479 'src/common/linux/safe_readlink.h',
480 'src/common/memory.h',
481 'src/common/simple_string_dictionary.cc',
482 'src/common/simple_string_dictionary.h',
483 'src/common/string_conversion.cc',
484 'src/common/string_conversion.h',
488 # Android NDK toolchain doesn't support -mimplicit-it=always
489 ['target_arch=="arm" and OS!="android"', {
490 'cflags': ['-Wa,-mimplicit-it=always'],
492 ['target_arch=="arm" and chromeos==1', {
493 # Avoid running out of registers in
494 # linux_syscall_support.h:sys_clone()'s inline assembly.
499 'src/common/android/include',
501 'direct_dependent_settings': {
503 'src/common/android/include',
507 'src/common/android/breakpad_getcontext.S',
513 # In case of Android, '-ldl' is added in common.gypi, since it
514 # is needed for stlport_static. For LD, the order of libraries
515 # is important, and thus we skip to add it here.
525 'src/third_party/linux/include',
531 # Breakpad r693 uses some files from src/processor in unit tests.
532 'target_name': 'breakpad_processor_support',
533 'type': 'static_library',
536 'src/common/scoped_ptr.h',
537 'src/processor/basic_code_modules.cc',
538 'src/processor/basic_code_modules.h',
539 'src/processor/logging.cc',
540 'src/processor/logging.h',
541 'src/processor/minidump.cc',
542 'src/processor/pathname_stripper.cc',
543 'src/processor/pathname_stripper.h',
549 'src/third_party/linux/include',
555 'target_name': 'breakpad_unittests',
556 'type': 'executable',
558 '../testing/gtest.gyp:gtest',
559 '../testing/gtest.gyp:gtest_main',
560 '../testing/gmock.gyp:gmock',
562 'breakpad_processor_support',
563 'linux_dumper_unittest_helper',
567 'linux/breakpad_googletest_includes.h',
568 'src/client/linux/handler/exception_handler_unittest.cc',
569 'src/client/linux/minidump_writer/cpu_set_unittest.cc',
570 'src/client/linux/minidump_writer/directory_reader_unittest.cc',
571 'src/client/linux/minidump_writer/line_reader_unittest.cc',
572 'src/client/linux/minidump_writer/linux_core_dumper_unittest.cc',
573 'src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc',
574 'src/client/linux/minidump_writer/minidump_writer_unittest.cc',
575 'src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc',
576 'src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc',
577 'src/common/linux/elf_core_dump_unittest.cc',
578 'src/common/linux/file_id_unittest.cc',
579 'src/common/linux/linux_libc_support_unittest.cc',
580 'src/common/linux/synth_elf.cc',
581 'src/common/linux/tests/crash_generator.cc',
582 'src/common/linux/tests/crash_generator.h',
583 'src/common/memory_range.h',
584 'src/common/memory_unittest.cc',
585 'src/common/simple_string_dictionary_unittest.cc',
586 'src/common/test_assembler.cc',
587 'src/common/tests/auto_testfile.h',
588 'src/common/tests/file_utils.cc',
589 'src/common/tests/file_utils.h',
590 'src/tools/linux/md2core/minidump_memory_range.h',
591 'src/tools/linux/md2core/minidump_memory_range_unittest.cc',
595 'linux', # Use our copy of breakpad_googletest_includes.h
603 # See http://crbug.com/138571#c18
612 'src/common/android/include',
618 'target_name': 'linux_dumper_unittest_helper',
619 'type': 'executable',
621 'breakpad_processor_support',
624 'src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc',
632 ['target_arch=="mipsel" and OS=="android"', {
634 'src/common/android/include',
640 'target_name': 'generate_test_dump',
641 'type': 'executable',
644 'linux/generate-test-dump.cc',
661 'src/common/android/include',
667 'target_name': 'minidump-2-core',
668 'type': 'executable',
671 'src/tools/linux/md2core/minidump-2-core.cc'
684 'target_name': 'core-2-minidump',
685 'type': 'executable',
688 'src/tools/linux/core2md/core2md.cc'
705 'target_name': 'breakpad_client',
706 'type': 'static_library',
708 'src/client/ios/Breakpad.h',
709 'src/client/ios/Breakpad.mm',
710 'src/client/ios/BreakpadController.h',
711 'src/client/ios/BreakpadController.mm',
712 'src/client/ios/handler/ios_exception_minidump_generator.mm',
713 'src/client/ios/handler/ios_exception_minidump_generator.h',
714 'src/client/mac/crash_generation/ConfigFile.h',
715 'src/client/mac/crash_generation/ConfigFile.mm',
716 'src/client/mac/handler/breakpad_nlist_64.cc',
717 'src/client/mac/handler/breakpad_nlist_64.h',
718 'src/client/mac/handler/dynamic_images.cc',
719 'src/client/mac/handler/dynamic_images.h',
720 'src/client/mac/handler/protected_memory_allocator.cc',
721 'src/client/mac/handler/protected_memory_allocator.h',
722 'src/client/mac/handler/exception_handler.cc',
723 'src/client/mac/handler/exception_handler.h',
724 'src/client/mac/handler/minidump_generator.cc',
725 'src/client/mac/handler/minidump_generator.h',
726 'src/client/mac/sender/uploader.h',
727 'src/client/mac/sender/uploader.mm',
728 'src/client/minidump_file_writer.cc',
729 'src/client/minidump_file_writer.h',
730 'src/client/minidump_file_writer-inl.h',
731 'src/common/convert_UTF.c',
732 'src/common/convert_UTF.h',
733 'src/common/mac/file_id.cc',
734 'src/common/mac/file_id.h',
735 'src/common/mac/HTTPMultipartUpload.m',
736 'src/common/mac/macho_id.cc',
737 'src/common/mac/macho_id.h',
738 'src/common/mac/macho_utilities.cc',
739 'src/common/mac/macho_utilities.h',
740 'src/common/mac/macho_walker.cc',
741 'src/common/mac/macho_walker.h',
742 'src/common/mac/string_utilities.cc',
743 'src/common/mac/string_utilities.h',
746 'src/common/simple_string_dictionary.cc',
747 'src/common/simple_string_dictionary.h',
748 'src/common/string_conversion.cc',
749 'src/common/string_conversion.h',
750 'src/google_breakpad/common/minidump_format.h',
754 'src/client/mac/Framework',
757 '<(DEPTH)/third_party/GTM',
758 '<(DEPTH)/third_party/GTM/Foundation',
761 # Build the version of GTMLogger.m in third_party rather than the
762 # one in src/common/mac because the former catches all exceptions
763 # whereas the latter lets them propagate, which can cause odd
766 '<(DEPTH)/third_party/GTM/Foundation/GTMLogger.h',
767 '<(DEPTH)/third_party/GTM/Foundation/GTMLogger.m',
770 '<(DEPTH)/third_party/GTM',
771 '<(DEPTH)/third_party/GTM/Foundation',
777 ['OS=="ios" and "<(GENERATOR)"!="ninja"', {
779 'ninja_output_dir': 'ninja-breakpad',
781 '<(DEPTH)/xcodebuild/<(ninja_output_dir)/<(CONFIGURATION_NAME)',
783 # Generation is done via two actions: (1) compiling the executable with
784 # ninja, and (2) copying the executable into a location that is shared
785 # with other projects. These actions are separated into two targets in
786 # order to be able to specify that the second action should not run until
787 # the first action finishes (since the ordering of multiple actions in
788 # one target is defined only by inputs and outputs, and it's impossible
789 # to set correct inputs for the ninja build, so setting all the inputs
790 # and outputs isn't an option).
793 'target_name': 'compile_breakpad_utilities',
798 'breakpad/breakpad.gyp',
801 'includes': ['../build/ios/mac_build.gypi'],
804 'action_name': 'compile breakpad utilities',
812 'message': 'Generating the breakpad executables',
817 'target_name': 'breakpad_utilities',
820 'compile_breakpad_utilities',
824 'action_name': 'copy dump_syms',
826 '<(ninja_product_dir)/dump_syms',
829 '<(PRODUCT_DIR)/dump_syms',
833 '<(ninja_product_dir)/dump_syms',
834 '<(PRODUCT_DIR)/dump_syms',
838 'action_name': 'copy symupload',
840 '<(ninja_product_dir)/symupload',
843 '<(PRODUCT_DIR)/symupload',
847 '<(ninja_product_dir)/symupload',
848 '<(PRODUCT_DIR)/symupload',
854 'target_name': 'dump_syms',
857 'breakpad_utilities',
861 'target_name': 'symupload',
864 'breakpad_utilities',