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_sparc.cc',
54 'src/processor/stackwalker_sparc.h',
55 'src/processor/stackwalker_x86.cc',
56 'src/processor/stackwalker_x86.h',
57 'src/processor/tokenize.cc',
58 'src/processor/tokenize.h',
60 'src/third_party/libdisasm/ia32_implicit.c',
61 'src/third_party/libdisasm/ia32_implicit.h',
62 'src/third_party/libdisasm/ia32_insn.c',
63 'src/third_party/libdisasm/ia32_insn.h',
64 'src/third_party/libdisasm/ia32_invariant.c',
65 'src/third_party/libdisasm/ia32_invariant.h',
66 'src/third_party/libdisasm/ia32_modrm.c',
67 'src/third_party/libdisasm/ia32_modrm.h',
68 'src/third_party/libdisasm/ia32_opcode_tables.c',
69 'src/third_party/libdisasm/ia32_opcode_tables.h',
70 'src/third_party/libdisasm/ia32_operand.c',
71 'src/third_party/libdisasm/ia32_operand.h',
72 'src/third_party/libdisasm/ia32_reg.c',
73 'src/third_party/libdisasm/ia32_reg.h',
74 'src/third_party/libdisasm/ia32_settings.c',
75 'src/third_party/libdisasm/ia32_settings.h',
76 'src/third_party/libdisasm/libdis.h',
77 'src/third_party/libdisasm/qword.h',
78 'src/third_party/libdisasm/x86_disasm.c',
79 'src/third_party/libdisasm/x86_format.c',
80 'src/third_party/libdisasm/x86_imm.c',
81 'src/third_party/libdisasm/x86_imm.h',
82 'src/third_party/libdisasm/x86_insn.c',
83 'src/third_party/libdisasm/x86_misc.c',
84 'src/third_party/libdisasm/x86_operand_list.c',
85 'src/third_party/libdisasm/x86_operand_list.h',
89 'target_name': 'minidump_dump',
91 'includes': ['breakpad_tools.gypi'],
93 'src/processor/basic_code_module.h',
94 'src/processor/basic_code_modules.cc',
95 'src/processor/basic_code_modules.h',
96 'src/processor/logging.cc',
97 'src/processor/logging.h',
98 'src/processor/minidump.cc',
99 'src/processor/minidump_dump.cc',
100 'src/processor/pathname_stripper.cc',
101 'src/processor/pathname_stripper.h',
114 # This is needed for GTMLogger to work correctly.
122 'target_name': 'breakpad_utilities',
123 'type': 'static_library',
125 'src/client/mac/handler/breakpad_nlist_64.cc',
126 'src/client/mac/handler/dynamic_images.cc',
127 'src/client/mac/handler/minidump_generator.cc',
128 'src/client/minidump_file_writer.cc',
129 'src/common/convert_UTF.c',
130 'src/common/mac/MachIPC.mm',
131 'src/common/mac/SimpleStringDictionary.mm',
132 'src/common/mac/arch_utilities.cc',
133 'src/common/mac/bootstrap_compat.cc',
134 'src/common/mac/file_id.cc',
135 'src/common/mac/macho_id.cc',
136 'src/common/mac/macho_utilities.cc',
137 'src/common/mac/macho_walker.cc',
138 'src/common/mac/string_utilities.cc',
140 'src/common/string_conversion.cc',
144 'target_name': 'crash_inspector',
145 'type': 'executable',
150 'breakpad_utilities',
153 'src/client/apple/Framework',
157 'src/client/mac/crash_generation/ConfigFile.mm',
158 'src/client/mac/crash_generation/Inspector.mm',
159 'src/client/mac/crash_generation/InspectorMain.mm',
163 '$(SDKROOT)/System/Library/Frameworks/CoreServices.framework',
164 '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
169 'target_name': 'crash_report_sender',
170 'type': 'executable',
179 'src/common/mac/HTTPMultipartUpload.m',
180 'src/client/mac/sender/crash_report_sender.m',
181 'src/client/mac/sender/uploader.mm',
182 'src/common/mac/GTMLogger.m',
184 'mac_bundle_resources': [
185 'src/client/mac/sender/English.lproj/Localizable.strings',
186 'src/client/mac/sender/crash_report_sender.icns',
187 'src/client/mac/sender/Breakpad.xib',
188 'src/client/mac/sender/crash_report_sender-Info.plist',
190 'mac_bundle_resources!': [
191 'src/client/mac/sender/crash_report_sender-Info.plist',
194 'INFOPLIST_FILE': 'src/client/mac/sender/crash_report_sender-Info.plist',
198 '$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
199 '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
200 '$(SDKROOT)/System/Library/Frameworks/SystemConfiguration.framework',
205 'target_name': 'dump_syms',
206 'type': 'executable',
208 # ++ ensures this comes before src brought in from target_defaults.
215 'pending/src/common/dwarf_cu_to_module.cc',
216 'pending/src/common/module.cc',
217 'src/common/dwarf/bytereader.cc',
218 'src/common/dwarf_cfi_to_module.cc',
219 'src/common/dwarf/dwarf2diehandler.cc',
220 'src/common/dwarf/dwarf2reader.cc',
221 'src/common/dwarf_line_to_module.cc',
222 'src/common/language.cc',
223 'src/common/mac/arch_utilities.cc',
224 'src/common/mac/arch_utilities.h',
225 'src/common/mac/dump_syms.mm',
226 'src/common/mac/file_id.cc',
227 'src/common/mac/macho_id.cc',
228 'src/common/mac/macho_reader.cc',
229 'src/common/mac/macho_utilities.cc',
230 'src/common/mac/macho_walker.cc',
232 'src/common/stabs_reader.cc',
233 'src/common/stabs_to_module.cc',
234 'src/tools/mac/dump_syms/dump_syms_tool.mm',
237 # For src/common/stabs_reader.h.
238 'HAVE_MACH_O_NLIST_H',
241 # Like ld, dump_syms needs to operate on enough data that it may
242 # actually need to be able to address more than 4GB. Use x86_64.
243 # Don't worry! An x86_64 dump_syms is perfectly able to dump
249 # The DWARF utilities require -funsigned-char.
250 'GCC_CHAR_IS_UNSIGNED_CHAR': 'YES',
252 # dwarf2reader.cc uses dynamic_cast.
253 'GCC_ENABLE_CPP_RTTI': 'YES',
257 '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
263 # dump_syms crashes when built at -O1, -O2, and -O3. It does
264 # not crash at -Os. To play it safe, dump_syms is always built
265 # at -O0 until this can be sorted out.
266 # http://code.google.com/p/google-breakpad/issues/detail?id=329
267 'GCC_OPTIMIZATION_LEVEL': '0', # -O0
273 'target_name': 'symupload',
274 'type': 'executable',
279 'src/common/mac/HTTPMultipartUpload.m',
280 'src/tools/mac/symupload/symupload.m',
284 '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
289 'target_name': 'breakpad',
290 'type': 'static_library',
292 'breakpad_utilities',
294 'crash_report_sender',
297 'src/client/apple/Framework',
299 'direct_dependent_settings': {
301 'src/client/apple/Framework',
305 'USE_PROTECTED_ALLOCATIONS=1',
308 'src/client/mac/crash_generation/crash_generation_client.cc',
309 'src/client/mac/crash_generation/crash_generation_client.h',
310 'src/client/mac/handler/protected_memory_allocator.cc',
311 'src/client/mac/handler/exception_handler.cc',
312 'src/client/mac/Framework/Breakpad.mm',
313 'src/client/mac/Framework/OnDemandServer.mm',
318 [ 'OS=="linux" or OS=="android"', {
325 # Tools needed for archiving build symbols.
326 ['linux_breakpad==1', {
329 'target_name': 'symupload',
330 'type': 'executable',
332 'includes': ['breakpad_tools.gypi'],
335 'src/tools/linux/symupload/sym_upload.cc',
336 'src/common/linux/http_upload.cc',
337 'src/common/linux/http_upload.h',
350 'target_name': 'dump_syms',
351 'type': 'executable',
354 'toolsets': [ 'host' ],
358 # dwarf2reader.cc uses dynamic_cast. Because we don't typically
359 # don't support RTTI, we enable it for this single target. Since
360 # dump_syms doesn't share any object files with anything else,
361 # this doesn't end up polluting Chrome itself.
362 'cflags_cc!': ['-fno-rtti'],
365 'src/common/dwarf/bytereader.cc',
366 'src/common/dwarf_cfi_to_module.cc',
367 'src/common/dwarf_cfi_to_module.h',
368 'src/common/dwarf_cu_to_module.cc',
369 'src/common/dwarf_cu_to_module.h',
370 'src/common/dwarf/dwarf2diehandler.cc',
371 'src/common/dwarf/dwarf2reader.cc',
372 'src/common/dwarf_line_to_module.cc',
373 'src/common/dwarf_line_to_module.h',
374 'src/common/language.cc',
375 'src/common/language.h',
376 'src/common/linux/dump_symbols.cc',
377 'src/common/linux/dump_symbols.h',
378 'src/common/linux/elf_symbols_to_module.cc',
379 'src/common/linux/elf_symbols_to_module.h',
380 'src/common/linux/elfutils.cc',
381 'src/common/linux/elfutils.h',
382 'src/common/linux/file_id.cc',
383 'src/common/linux/file_id.h',
384 'src/common/linux/linux_libc_support.cc',
385 'src/common/linux/linux_libc_support.h',
386 'src/common/linux/memory_mapped_file.cc',
387 'src/common/linux/memory_mapped_file.h',
388 'src/common/linux/guid_creator.h',
389 'src/common/module.cc',
390 'src/common/module.h',
391 'src/common/stabs_reader.cc',
392 'src/common/stabs_reader.h',
393 'src/common/stabs_to_module.cc',
394 'src/common/stabs_to_module.h',
395 'src/tools/linux/dump_syms/dump_syms.cc',
398 # Breakpad rev 583 introduced this flag.
399 # Using this define, stabs_reader.h will include a.out.h to
415 'target_name': 'breakpad_client',
416 'type': 'static_library',
419 'src/client/linux/crash_generation/crash_generation_client.cc',
420 'src/client/linux/crash_generation/crash_generation_client.h',
421 'src/client/linux/handler/exception_handler.cc',
422 'src/client/linux/handler/exception_handler.h',
423 'src/client/linux/handler/minidump_descriptor.cc',
424 'src/client/linux/handler/minidump_descriptor.h',
425 'src/client/linux/log/log.cc',
426 'src/client/linux/log/log.h',
427 'src/client/linux/minidump_writer/directory_reader.h',
428 'src/client/linux/minidump_writer/line_reader.h',
429 'src/client/linux/minidump_writer/linux_core_dumper.cc',
430 'src/client/linux/minidump_writer/linux_core_dumper.h',
431 'src/client/linux/minidump_writer/linux_dumper.cc',
432 'src/client/linux/minidump_writer/linux_dumper.h',
433 'src/client/linux/minidump_writer/linux_ptrace_dumper.cc',
434 'src/client/linux/minidump_writer/linux_ptrace_dumper.h',
435 'src/client/linux/minidump_writer/minidump_writer.cc',
436 'src/client/linux/minidump_writer/minidump_writer.h',
437 'src/client/minidump_file_writer-inl.h',
438 'src/client/minidump_file_writer.cc',
439 'src/client/minidump_file_writer.h',
440 'src/common/convert_UTF.c',
441 'src/common/convert_UTF.h',
442 'src/common/linux/elf_core_dump.cc',
443 'src/common/linux/elf_core_dump.h',
444 'src/common/linux/elfutils.cc',
445 'src/common/linux/elfutils.h',
446 'src/common/linux/file_id.cc',
447 'src/common/linux/file_id.h',
448 'src/common/linux/google_crashdump_uploader.cc',
449 'src/common/linux/google_crashdump_uploader.h',
450 'src/common/linux/guid_creator.cc',
451 'src/common/linux/guid_creator.h',
452 'src/common/linux/libcurl_wrapper.cc',
453 'src/common/linux/libcurl_wrapper.h',
454 'src/common/linux/linux_libc_support.cc',
455 'src/common/linux/linux_libc_support.h',
456 'src/common/linux/memory_mapped_file.cc',
457 'src/common/linux/memory_mapped_file.h',
458 'src/common/linux/safe_readlink.cc',
459 'src/common/linux/safe_readlink.h',
460 'src/common/memory.h',
461 'src/common/string_conversion.cc',
462 'src/common/string_conversion.h',
466 # Android NDK toolchain doesn't support -mimplicit-it=always
467 ['target_arch=="arm" and OS!="android"', {
468 'cflags': ['-Wa,-mimplicit-it=always'],
470 ['target_arch=="arm" and chromeos==1', {
471 # Avoid running out of registers in
472 # linux_syscall_support.h:sys_clone()'s inline assembly.
477 'src/common/android/include',
479 'direct_dependent_settings': {
481 'src/common/android/include',
485 'src/common/android/breakpad_getcontext.S',
499 'src/third_party/linux/include',
505 # Breakpad r693 uses some files from src/processor in unit tests.
506 'target_name': 'breakpad_processor_support',
507 'type': 'static_library',
510 'src/processor/basic_code_modules.cc',
511 'src/processor/basic_code_modules.h',
512 'src/processor/logging.cc',
513 'src/processor/logging.h',
514 'src/processor/minidump.cc',
515 'src/processor/pathname_stripper.cc',
516 'src/processor/pathname_stripper.h',
517 'src/processor/scoped_ptr.h',
523 'src/third_party/linux/include',
529 'target_name': 'breakpad_unittests',
530 'type': 'executable',
532 '../testing/gtest.gyp:gtest',
533 '../testing/gtest.gyp:gtest_main',
534 '../testing/gmock.gyp:gmock',
536 'breakpad_processor_support',
537 'linux_dumper_unittest_helper',
541 'linux/breakpad_googletest_includes.h',
542 'src/client/linux/handler/exception_handler_unittest.cc',
543 'src/client/linux/minidump_writer/directory_reader_unittest.cc',
544 'src/client/linux/minidump_writer/line_reader_unittest.cc',
545 'src/client/linux/minidump_writer/linux_core_dumper_unittest.cc',
546 'src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc',
547 'src/client/linux/minidump_writer/minidump_writer_unittest.cc',
548 'src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc',
549 'src/common/linux/elf_core_dump_unittest.cc',
550 'src/common/linux/file_id_unittest.cc',
551 'src/common/linux/linux_libc_support_unittest.cc',
552 'src/common/linux/synth_elf.cc',
553 'src/common/linux/tests/crash_generator.cc',
554 'src/common/linux/tests/crash_generator.h',
555 'src/common/memory_range.h',
556 'src/common/memory_unittest.cc',
557 'src/common/test_assembler.cc',
558 'src/common/tests/file_utils.cc',
559 'src/common/tests/file_utils.h',
560 'src/tools/linux/md2core/minidump_memory_range.h',
561 'src/tools/linux/md2core/minidump_memory_range_unittest.cc',
565 'linux', # Use our copy of breakpad_googletest_includes.h
573 # See http://crbug.com/138571#c18
582 'src/common/android/include',
588 'target_name': 'linux_dumper_unittest_helper',
589 'type': 'executable',
591 'breakpad_processor_support',
594 'src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc',
603 'target_name': 'generate_test_dump',
604 'type': 'executable',
607 'linux/generate-test-dump.cc',
620 'target_name': 'minidump-2-core',
621 'type': 'executable',
624 'src/tools/linux/md2core/minidump-2-core.cc'
637 'target_name': 'core-2-minidump',
638 'type': 'executable',
641 'src/tools/linux/core2md/core2md.cc'
657 'ninja_output_dir': 'ninja-breakpad',
659 '<(DEPTH)/xcodebuild/<(ninja_output_dir)/<(CONFIGURATION_NAME)',
661 # Generation is done via two actions: (1) compiling the executable with
662 # ninja, and (2) copying the executable into a location that is shared
663 # with other projects. These actions are separated into two targets in
664 # order to be able to specify that the second action should not run until
665 # the first action finishes (since the ordering of multiple actions in
666 # one target is defined only by inputs and outputs, and it's impossible
667 # to set correct inputs for the ninja build, so setting all the inputs
668 # and outputs isn't an option).
671 'target_name': 'compile_breakpad_utilities',
676 'breakpad/breakpad.gyp',
679 'includes': ['../build/ios/mac_build.gypi'],
682 'action_name': 'compile breakpad utilities',
690 'message': 'Generating the breakpad executables',
695 'target_name': 'breakpad_utilities',
698 'compile_breakpad_utilities',
702 'action_name': 'copy dump_syms',
704 '<(ninja_product_dir)/dump_syms',
707 '<(PRODUCT_DIR)/dump_syms',
711 '<(ninja_product_dir)/dump_syms',
712 '<(PRODUCT_DIR)/dump_syms',
716 'action_name': 'copy symupload',
718 '<(ninja_product_dir)/symupload',
721 '<(PRODUCT_DIR)/symupload',
725 '<(ninja_product_dir)/symupload',
726 '<(PRODUCT_DIR)/symupload',
732 'target_name': 'dump_syms',
735 'breakpad_utilities',
739 'target_name': 'symupload',
742 'breakpad_utilities',
746 'target_name': 'breakpad_client',
747 'type': 'static_library',
749 'src/client/ios/Breakpad.h',
750 'src/client/ios/Breakpad.mm',
751 'src/client/ios/BreakpadController.h',
752 'src/client/ios/BreakpadController.mm',
753 'src/client/ios/handler/ios_exception_minidump_generator.mm',
754 'src/client/ios/handler/ios_exception_minidump_generator.h',
755 'src/client/mac/crash_generation/ConfigFile.h',
756 'src/client/mac/crash_generation/ConfigFile.mm',
757 'src/client/mac/handler/breakpad_nlist_64.cc',
758 'src/client/mac/handler/breakpad_nlist_64.h',
759 'src/client/mac/handler/dynamic_images.cc',
760 'src/client/mac/handler/dynamic_images.h',
761 'src/client/mac/handler/protected_memory_allocator.cc',
762 'src/client/mac/handler/protected_memory_allocator.h',
763 'src/client/mac/handler/exception_handler.cc',
764 'src/client/mac/handler/exception_handler.h',
765 'src/client/mac/handler/minidump_generator.cc',
766 'src/client/mac/handler/minidump_generator.h',
767 'src/client/mac/sender/uploader.h',
768 'src/client/mac/sender/uploader.mm',
769 'src/client/minidump_file_writer.cc',
770 'src/client/minidump_file_writer.h',
771 'src/client/minidump_file_writer-inl.h',
772 'src/common/convert_UTF.c',
773 'src/common/convert_UTF.h',
774 'src/common/mac/file_id.cc',
775 'src/common/mac/file_id.h',
776 'src/common/mac/HTTPMultipartUpload.m',
777 'src/common/mac/macho_id.cc',
778 'src/common/mac/macho_id.h',
779 'src/common/mac/macho_utilities.cc',
780 'src/common/mac/macho_utilities.h',
781 'src/common/mac/macho_walker.cc',
782 'src/common/mac/macho_walker.h',
783 'src/common/mac/string_utilities.cc',
784 'src/common/mac/string_utilities.h',
785 'src/common/mac/SimpleStringDictionary.mm',
786 'src/common/mac/SimpleStringDictionary.h',
789 'src/common/string_conversion.cc',
790 'src/common/string_conversion.h',
791 'src/google_breakpad/common/minidump_format.h',
795 'src/client/mac/Framework',
798 '<(DEPTH)/third_party/GTM',
799 '<(DEPTH)/third_party/GTM/Foundation',
802 # Build the version of GTMLogger.m in third_party rather than the
803 # one in src/common/mac because the former catches all exceptions
804 # whereas the latter lets them propagate, which can cause odd
807 '<(DEPTH)/third_party/GTM/Foundation/GTMLogger.h',
808 '<(DEPTH)/third_party/GTM/Foundation/GTMLogger.m',
811 '<(DEPTH)/third_party/GTM',
812 '<(DEPTH)/third_party/GTM/Foundation',